@Override
 protected void onCreate(Bundle savedInstanceState) {
   requestWindowFeature(Window.FEATURE_NO_TITLE);
   super.onCreate(savedInstanceState);
   setContentView(R.layout.activity_advertisement);
   initData();
 }
Esempio n. 2
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    AM.getActivityManager().pushActivity(this);
    super.onCreate(savedInstanceState);
    if (getSupportActionBar() != null) {
      getSupportActionBar().setElevation(0);
    }

    if (translucentStatus()) {
      if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        setTranslucentStatus(true);
      }
      //            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
      //                Window window = getWindow();
      //                window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
      //
      // window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
      //                        | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
      //
      // window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
      //                window.setStatusBarColor(Color.TRANSPARENT);
      //            }
      mTintManager = new SystemBarTintManager(this);
      mTintManager.setStatusBarTintEnabled(true);
      // 使StatusBarTintView 和 actionbar的颜色保持一致,风格统一。
      mTintManager.setStatusBarTintResource(R.color.actionbar);
      mTintManager.setStatusBarDarkMode(true, this);
    }
  }
  @Override
  protected void onResume() {
    super.onResume();

    // load data
    loadIndex();
  }
 @Override
 protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   // set layout
   setContentView(R.layout.activity_index);
   // set table
   table = (TableLayout) findViewById(R.id.layout_activity_index);
 }
Esempio n. 5
0
 /** Called when the activity is first created. */
 @Override
 public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   Log.i(LOG_TAG, "creating " + getClass());
   TextView tv = new TextView(this);
   doSampleDatabaseStuff("onCreate", tv);
   setContentView(tv);
 }
  @Override
  protected void onCreate(Bundle bundle) {
    super.onCreate(bundle);
    Log.i(TAG, "created");
    // this.setContentView(R.layout.task_detail);
    this.setContentView(R.layout.edit_alarm);
    this.getActionBar().setDisplayHomeAsUpEnabled(true);
    oldAlarm = (TaskEntity) this.getIntent().getSerializableExtra("alarmTask");
    if (oldAlarm != null) this.editAlarm = new TaskEntity(oldAlarm);
    else this.editAlarm = Utils.createTask(this);

    int[] repeat_lines =
        new int[] {
          R.id.repeat_monday_line,
          R.id.repeat_tuesday_line,
          R.id.repeat_wendsday_line,
          R.id.repeat_thursday_line,
          R.id.repeat_friday_line,
          R.id.repeat_saturday_line,
          R.id.repeat_sunday_line
        };
    int[] repeat_txt =
        new int[] {
          R.id.repeat_monday,
          R.id.repeat_tuesday,
          R.id.repeat_wendsday,
          R.id.repeat_thursday,
          R.id.repeat_friday,
          R.id.repeat_saturday,
          R.id.repeat_sunday
        };
    for (int i = 0; i < 7; i++) {
      FrameLayout localFrameLayout = (FrameLayout) this.findViewById(repeat_lines[i]);
      this.setUpRepeat(localFrameLayout, (TextView) this.findViewById(repeat_txt[i]), i + 1);
    }

    txtTimeView = (TextView) this.findViewById(R.id.edit_alarm_hour);
    txtTaskName = (TextView) this.findViewById(R.id.edit_alarm_label);

    TimeOnClickListener timeClickListener = new TimeOnClickListener();
    txtTimeView.setOnClickListener(timeClickListener);
    TaskNameOnClickListener taskNameOnClickListener = new TaskNameOnClickListener();
    txtTaskName.setOnClickListener(taskNameOnClickListener);

    radioOn = (RadioButton) this.findViewById(R.id.idRadioOn);
    radioOff = (RadioButton) this.findViewById(R.id.idRadioOff);

    if (this.editAlarm.isModeOn()) {
      radioOn.setChecked(true);
      radioOff.setChecked(false);
    } else {
      radioOn.setChecked(false);
      radioOff.setChecked(true);
    }
    txtTimeView.setText(this.editAlarm.getTimeStr(this));
    txtTaskName.setText(this.editAlarm.getTitle());
  }
  /** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    ActivityHelper.setupTheme(this);
    setContentView(R.layout.connectionlist);

    LayoutInflater inflator = getLayoutInflater();
    View formJump = inflator.inflate(R.layout.issuejump, null);
    final RedmineIssueJumpForm header = new RedmineIssueJumpForm(formJump);

    formList = new RedmineBaseAdapterListFormHelper<RedmineProjectListAdapter>();
    formList.setList((ListView) findViewById(R.id.listConnectionList));
    formList.setHeader(formJump, true);
    formList.setFooter(inflator.inflate(R.layout.listview_footer, null), false);
    formList.setAdapter(new RedmineProjectListAdapter(getHelper()));
    formList.onRestoreInstanceState(savedInstanceState);

    header.buttonOK.setOnClickListener(
        new OnClickListener() {

          @Override
          public void onClick(View v) {
            if (!header.Validate()) return;

            ActionActivityHelper help = new ActionActivityHelper(v.getContext());
            ProjectIntent intent = new ProjectIntent(getIntent());
            help.issue(intent.getConnectionId(), header.getIssueId());
          }
        });

    // リスト項目がクリックされた時の処理
    formList.list.setOnItemClickListener(
        new AdapterView.OnItemClickListener() {
          public void onItemClick(AdapterView<?> parent, View view, int position, long arg3) {
            ListView listView = (ListView) parent;
            Object item = listView.getItemAtPosition(position);
            if (item == null || !(item instanceof RedmineProject)) return;
            onItemSelect((RedmineProject) item);
          }
        });

    /*
    //リスト項目が長押しされた時の処理
    formList.list.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
    	public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {
    		ListView listView = (ListView) parent;
    		RedmineConnection item = (RedmineConnection) listView.getItemAtPosition(position);
    		Bundle bundle = new Bundle();
    		bundle.putInt(DIALOG_PARAM_ID, item.Id());
    		bundle.putString(DIALOG_PARAM_NAME, item.Name());
    		showDialog(DIALOG_ITEM_ACTION, bundle);
    		return false;
    	}
    });
    */
  }
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
    super.onCreateOptionsMenu(menu);

    MenuInflater inflater = getMenuInflater();
    inflater.inflate(R.menu.projects, menu);
    menu_refresh = menu.findItem(R.id.menu_refresh);
    if (task != null && task.getStatus() == Status.RUNNING) menu_refresh.setEnabled(false);
    return true;
  }
 @Override
 protected void onStart() {
   super.onStart();
   ConnectionIntent intent = new ConnectionIntent(getIntent());
   formList.adapter.setupParameter(intent.getConnectionId());
   formList.refresh();
   if (formList.adapter.getCount() == 0) {
     onRefresh();
   }
 }
Esempio n. 10
0
  @Override
  protected void onResume() {
    super.onResume();
    MobclickAgent.onResume(this);
    if (loginStatus()) {
      try {
        final LoginUser user = getHelper().getUser();
        if (user == null) {
          return;
        }
        if (Util.fmtDate
            .parse(ac.cs.getLoginTime(user.getId()))
            .before(Util.fmtDate.parse(Util.fmtDate.format(new Date())))) {

          ac.finalHttp.post(
              URL.EVERYDAY_LOGIN,
              getAjaxParams(),
              new MyJsonHttpResponseHandler(this) {
                @Override
                public void onSuccessRetCode(JSONObject jo) throws Throwable {
                  jo = new JSONObject(jo.getString(URL.RESPONSE));
                  ac.cs.setLoginTime(user.getId(), Util.fmtDate.format(new Date()));
                  Intent intent = new Intent(DogCoinActivity.TAG);
                  intent.putExtra("coin", jo.getString("coin"));
                  sendBroadcast(intent);
                  if ("1".equals(jo.getString("result"))) {
                    new Handler()
                        .postDelayed(
                            new Runnable() {
                              @Override
                              public void run() {
                                LayoutInflater inflater = LayoutInflater.from(BaseActivity.this);
                                View view = inflater.inflate(R.layout.login_remind, null);
                                Toast toast = new Toast(BaseActivity.this);
                                toast.setGravity(Gravity.FILL, 0, 0);
                                toast.setDuration(Toast.LENGTH_SHORT);
                                toast.setView(view);
                                toast.show();
                              }
                            },
                            1000);
                  }
                }

                @Override
                public void onFailure() {}
              });
        }
      } catch (ParseException e) {
        e.printStackTrace();
      }
    }
  }
Esempio n. 11
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_login);

    txLogin = (TextView) findViewById(R.id.textViewLogin);
    etLogin = (EditText) findViewById(R.id.editTextLogin);
    txSenha = (TextView) findViewById(R.id.textViewSenha);
    etSenha = (EditText) findViewById(R.id.editTextSenha);
    btnOK = (Button) findViewById(R.id.buttonOK);

    etLogin.setText("user1");
    etSenha.setText("1234");

    btnOK.setOnClickListener(this);
  }
 @Override
 public void onDestroy() {
   super.onDestroy();
 }
Esempio n. 13
0
 @Override
 protected void onSaveInstanceState(Bundle outState) {
   formList.onSaveInstanceState(outState);
   super.onSaveInstanceState(outState);
 }
 @Override
 protected void onPause() {
   super.onPause();
 }
Esempio n. 15
0
 @Override
 protected void onRestoreInstanceState(Bundle savedInstanceState) {
   formList.onRestoreInstanceState(savedInstanceState);
   super.onRestoreInstanceState(savedInstanceState);
 }
Esempio n. 16
0
 @Override
 protected void onDestroy() {
   cancelTask();
   super.onDestroy();
 }
 @Override
 public void onPause() {
   super.onPause();
   MobclickAgent.onPause(this);
 }
 @Override
 protected void onResume() {
   super.onResume();
   MobclickAgent.onResume(this);
 }
Esempio n. 19
0
 @Override
 protected void onDestroy() {
   super.onDestroy();
   closeInput();
   AM.getActivityManager().popActivity(this);
 }