Ejemplo n.º 1
0
  @TargetApi(Build.VERSION_CODES.HONEYCOMB)
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    that = this;

    final ActionBar actionBar = getActionBar();
    actionBar.setCustomView(R.layout.actionbar_profiler_audio);
    actionBar.setDisplayShowTitleEnabled(true);
    actionBar.setDisplayShowCustomEnabled(true);
    actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.setBackgroundDrawable(getResources().getDrawable(R.color.black));

    if (savedInstanceState == null) {
      Bundle extras = getIntent().getExtras();
      imageUrl = extras.getString("image_url");
      profileName = extras.getString("profile_name");
      identityProfileId = extras.getString("identity_profile_id");
      firstName = extras.getString("first_name");
      lastName = extras.getString("last_name");
      userIdentityProfileId = extras.getString("user_identity_profile_id");
      useDefault = extras.getBoolean("use_default");
    }

    Bundle extras = getIntent().getExtras();
    audioFileName = extras.getStringArray("audio_file_name");
    fileName = extras.getStringArray("file_name");
    fileLocation = extras.getStringArray("file_location");
    audioDescription = extras.getStringArray("audio_description");

    setListAdapter(new ProfilerAudioAdapter(this, audioFileName, fileName, audioDescription));
  }
Ejemplo n.º 2
0
  @SuppressLint("DefaultLocale")
  @Override
  public void onCreate(Bundle savedInstanceState) {
    // TODO refactor
    super.onCreate(savedInstanceState);

    getSupportActionBar().setHomeButtonEnabled(true);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);

    String license = "";
    Bundle bundle = getIntent().getExtras();
    if (bundle != null) {
      license = bundle.getString(KEY_BU_LICENSE_NAME);
    }
    setContentView(R.layout.activity_licensing);
    setTitle(license.toUpperCase());
    final TextView textView = (TextView) findViewById(R.id.license);
    final ProgressBar progressBar = (ProgressBar) findViewById(R.id.progress);
    final ThreadedLicenseReader reader = new ThreadedLicenseReader(this, license);
    reader.setOnLicenseReadListener(
        new OnLicenseReadListener() {
          @Override
          public void onLicenseRead() {
            runOnUiThread(
                new Runnable() {
                  @Override
                  public void run() {
                    String license = reader.getLicense();
                    if (license != null) {
                      textView.setText(license);
                    }
                    progressBar.setVisibility(View.INVISIBLE);
                    textView.setVisibility(View.VISIBLE);
                  }
                });
          }
        });
    reader.start();
  }
Ejemplo n.º 3
0
  /** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle savedInstanceState) {
    try {
      mSharedPreferences = Prefs.getSharedPreferences(this);
    } catch (NullPointerException e) {
      if (BuildConfig.DEBUG) {
        Log.w("[" + TAG + "]", "mSharedPreferences == NullPointerException :" + e.getMessage());
      }
    }

    mSharedPreferences.registerOnSharedPreferenceChangeListener(this);

    if (Prefs.getThemeType(this) == false) {
      mThemeId = R.style.AppTheme_Light;
      setTheme(mThemeId);
    } else {
      mThemeId = R.style.AppTheme_Dark;
      setTheme(mThemeId);
    }

    // Eula.showDisclaimer( this );
    Eula.showEula(this, getApplicationContext());

    mActionBar = getActionBar();
    if (mActionBar != null) {
      mActionBar.setDisplayHomeAsUpEnabled(false);
      mActionBar.setDisplayShowHomeEnabled(true);
      mActionBar.setDisplayShowTitleEnabled(true);
    } else {
      if (BuildConfig.DEBUG) {
        Log.w("[" + TAG + "]", "mActionBar == null");
      }
    }

    Bundle extras = getIntent().getExtras();
    if (extras != null) {
      this.setTitle(extras.getString("dir") + " :: " + getString(R.string.app_name));
    } else {
      this.setTitle(" :: " + getString(R.string.app_name));
    }

    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    tvDisplay = (TextView) findViewById(R.id.tvDisplay);

    bRename = (Button) findViewById(R.id.bRename);
    bSettings = (Button) findViewById(R.id.bSettings);
    bHelp = (Button) findViewById(R.id.bHelp);
    bExit = (Button) findViewById(R.id.bExit);

    bRename.setOnClickListener(
        new View.OnClickListener() {
          public void onClick(View v) {
            Intent openAndroidFileBrowser = new Intent("com.scto.filerenamer.ANDROIDFILEBROWSER");
            openAndroidFileBrowser.putExtra("what", "renamer");
            openAndroidFileBrowser.putExtra("theme", mThemeId);
            startActivity(openAndroidFileBrowser);
          }
        });

    bSettings.setOnClickListener(
        new View.OnClickListener() {
          public void onClick(View v) {
            Intent openPreferencesActivity = new Intent("com.scto.filerenamer.PREFERENCESACTIVITY");
            startActivity(openPreferencesActivity);
          }
        });

    bHelp.setOnClickListener(
        new View.OnClickListener() {
          public void onClick(View v) {
            FragmentManager fm = getSupportFragmentManager();
            HelpDialog helpDialog = new HelpDialog();
            helpDialog.show(fm, "dlg_help");
          }
        });

    bExit.setOnClickListener(
        new View.OnClickListener() {
          public void onClick(View v) {
            FragmentManager fm = getSupportFragmentManager();
            ExitDialog exitDialog = new ExitDialog();
            exitDialog.show(fm, "dlg_exit");
          }
        });

    /*
    ChangeLog cl = new ChangeLog( this );
    if( cl.firstRun() )
    {
    	cl.getLogDialog().show();
    }
    */
    init();
  }