@Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.blackmagicactivity_layout);

    ActionBar actionBar = getActionBar();
    actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.setTitle(getString(R.string.hack_login));

    username = (EditText) findViewById(R.id.username);
    password = (EditText) findViewById(R.id.password);
    spinner = (Spinner) findViewById(R.id.spinner);

    SpinnerAdapter mSpinnerAdapter =
        ArrayAdapter.createFromResource(
            this, R.array.tail, android.R.layout.simple_spinner_dropdown_item);

    spinner.setAdapter(mSpinnerAdapter);
    spinner.setOnItemSelectedListener(
        new AdapterView.OnItemSelectedListener() {

          @Override
          public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
            String[] array = getResources().getStringArray(R.array.tail_value);
            String value = array[position];
            appkey = value.substring(0, value.indexOf(","));
            appSecret = value.substring(value.indexOf(",") + 1);
          }

          @Override
          public void onNothingSelected(AdapterView<?> parent) {}
        });
  }
Esempio n. 2
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);
    getActionBar().setDisplayHomeAsUpEnabled(true);
    getActionBar().setTitle(getString(R.string.filter));

    View title = getLayoutInflater().inflate(R.layout.filteractivity_title_layout, null);
    Switch switchBtn = (Switch) title.findViewById(R.id.switchBtn);
    getActionBar().setCustomView(title, new ActionBar.LayoutParams(Gravity.RIGHT));
    getActionBar().setDisplayShowCustomEnabled(true);

    switchBtn.setChecked(SettingUtility.isEnableFilter());
    switchBtn.setOnCheckedChangeListener(
        new CompoundButton.OnCheckedChangeListener() {
          @Override
          public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            SettingUtility.setEnableFilter(isChecked);
          }
        });

    if (savedInstanceState == null) {
      getFragmentManager()
          .beginTransaction()
          .replace(android.R.id.content, new FilterFragment())
          .commit();
    }
  }
Esempio n. 3
0
 @Override
 public void onBackPressed() {
   super.onBackPressed();
   if (webView.canGoBack()) {
     webView.goBack();
   } else {
     Toast.makeText(OAuthActivity.this, getString(R.string.you_cancel_login), Toast.LENGTH_SHORT)
         .show();
     finish();
   }
 }
Esempio n. 4
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);
    getActionBar().setDisplayHomeAsUpEnabled(true);
    getActionBar().setTitle(getString(R.string.setting));

    if (savedInstanceState == null) {
      getFragmentManager()
          .beginTransaction()
          .replace(android.R.id.content, new SettingsFragment())
          .commit();
    }
  }
Esempio n. 5
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    getActionBar().setDisplayShowHomeEnabled(false);
    getActionBar().setDisplayShowTitleEnabled(true);
    getActionBar().setDisplayHomeAsUpEnabled(true);

    UserBean bean = (UserBean) getIntent().getSerializableExtra("user");

    setTitle(bean.getScreen_name());

    getFragmentManager()
        .beginTransaction()
        .replace(android.R.id.content, new DMConversationListFragment(bean))
        .commit();
  }
Esempio n. 6
0
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.oauthactivity_layout);
    ActionBar actionBar = getActionBar();
    actionBar.setDisplayHomeAsUpEnabled(false);
    actionBar.setTitle(getString(R.string.login));
    webView = (WebView) findViewById(R.id.webView);
    webView.setWebViewClient(new WeiboWebViewClient());

    WebSettings settings = webView.getSettings();
    settings.setJavaScriptEnabled(true);
    settings.setSaveFormData(false);
    settings.setSavePassword(false);
    settings.setCacheMode(WebSettings.LOAD_NO_CACHE);
    settings.setRenderPriority(WebSettings.RenderPriority.HIGH);

    CookieSyncManager.createInstance(this);
    CookieManager cookieManager = CookieManager.getInstance();
    cookieManager.removeAllCookie();
  }
 @Override
 protected void onDestroy() {
   super.onDestroy();
   Utility.cancelTasks(loginTask);
 }
Esempio n. 8
0
 @Override
 protected void onDestroy() {
   super.onDestroy();
   webView.clearCache(true);
 }
Esempio n. 9
0
 @Override
 protected void onPause() {
   super.onPause();
   if (isFinishing()) webView.stopLoading();
 }