public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.world_info); gameModeText = (TextView) findViewById(R.id.world_info_gamemode); gameModeChangeButton = (Button) findViewById(R.id.world_info_gamemode_change); gameModeChangeButton.setOnClickListener(this); worldTimeText = (EditText) findViewById(R.id.world_info_time_text); worldTimeText.setOnFocusChangeListener(this); spawnToPlayerButton = (Button) findViewById(R.id.world_info_spawn_to_player_button); spawnToPlayerButton.setOnClickListener(this); warpToSpawnButton = (Button) findViewById(R.id.world_info_warp_to_spawn_button); warpToSpawnButton.setOnClickListener(this); timeToMorningButton = (Button) findViewById(R.id.world_info_time_to_morning); timeToMorningButton.setOnClickListener(this); timeToNightButton = (Button) findViewById(R.id.world_info_time_to_night); timeToNightButton.setOnClickListener(this); playerXText = (TextView) findViewById(R.id.world_info_player_x); playerYText = (TextView) findViewById(R.id.world_info_player_y); playerZText = (TextView) findViewById(R.id.world_info_player_z); healthText = (EditText) findViewById(R.id.world_info_health); fullHealthButton = (Button) findViewById(R.id.world_info_full_health); infiniteHealthButton = (Button) findViewById(R.id.world_info_infinite_health); healthText.setOnFocusChangeListener(this); fullHealthButton.setOnClickListener(this); infiniteHealthButton.setOnClickListener(this); sidewaysOnButton = (Button) findViewById(R.id.world_info_sideways_on); sidewaysOffButton = (Button) findViewById(R.id.world_info_sideways_off); sidewaysOnButton.setOnClickListener(this); sidewaysOffButton.setOnClickListener(this); worldNameText = (TextView) findViewById(R.id.world_info_name); worldNameText.setOnFocusChangeListener(this); worldFolderNameText = (TextView) findViewById(R.id.world_info_folder_name); worldFolderNameText.setOnFocusChangeListener(this); movePlayerButton = (Button) findViewById(R.id.world_info_move_player); movePlayerButton.setOnClickListener(this); flyingBox = (CheckBox) findViewById(R.id.world_info_flying); flyingBox.setOnClickListener(this); invulnerableBox = (CheckBox) findViewById(R.id.world_info_invulnerable); invulnerableBox.setOnClickListener(this); instaBuildBox = (CheckBox) findViewById(R.id.world_info_insta_build); instaBuildBox.setOnClickListener(this); mayFlyBox = (CheckBox) findViewById(R.id.world_info_may_fly); mayFlyBox.setOnClickListener(this); dayCycleStopTimeText = (TextView) findViewById(R.id.world_info_day_cycle_stop_time_text); dayCycleStopTimeText.setOnFocusChangeListener(this); spawnMobsBox = (CheckBox) findViewById(R.id.world_info_spawn_mobs); spawnMobsBox.setOnClickListener(this); // if (EditorActivity.level != null) { // onLevelDataLoad(); // } else { // } }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow() .setFlags( WindowManager.LayoutParams.FLAG_FULLSCREEN | WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM, WindowManager.LayoutParams.FLAG_FULLSCREEN | WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM); setContentView(R.layout.activity_third_game_detail); ScaleViewUtils.init(this); ScaleViewUtils.scaleView(getWindow().getDecorView()); setBlackTitle(false); icon = (ImageView) findViewById(R.id.iv_icon); gameSize = (TextView) findViewById(R.id.tv_game_size); handleType = (TextView) findViewById(R.id.tv_game_handle); gameName = (TextView) findViewById(R.id.tv_game_name); gameDesc = (TextView) findViewById(R.id.tv_game_desc); gameDesc.setMovementMethod(ScrollingMovementMethod.getInstance()); gameDesc.setOnFocusChangeListener(onFocusChangeListener); mRecyclerView = (RecyclerView) findViewById(R.id.rv_game_source); LayoutManager layoutManager = new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false); mRecyclerView.setLayoutManager(layoutManager); mAdapter = new GameSourceAdapter(this, mRecyclerView, mImageFetcher); mRecyclerView.setAdapter(mAdapter); // gameSourceLayout = (LinearLayout)findViewById(R.id.ll_game_source); contentView = (RelativeLayout) findViewById(R.id.rl_desc); loadingView = (LoadingView) findViewById(R.id.contentLoading); loadingView.setDataView(contentView); if (getIntent() != null) { mGameId = getIntent().getStringExtra(GAMEID); } if (mGameId != null && mGameId != "") { Log.i("life", "mGameId:" + mGameId); getData(mGameId); } registReceiver(); }
/** * Create the Contact Details menu activity (non-Javadoc) * * @see org.easyaccess.EasyAccessActivity#onCreate(android.os.Bundle) */ @SuppressLint("HandlerLeak") @Override protected void onCreate(Bundle savedInstanceState) { setContentView(R.layout.contactsotheroptions); super.onCreate(savedInstanceState); // get UI elements contactName = (TextView) findViewById(R.id.txtContactsName); btnDelete = (Button) findViewById(R.id.btnDelete); btnCopyToSD = (Button) findViewById(R.id.btnCopyToSD); btnImport = (Button) findViewById(R.id.btnImportFromSD); btnExport = (Button) findViewById(R.id.btnExportToSD); // get the details of the contact from the number if (getIntent().getExtras() != null) { this.id = getIntent().getExtras().getString("id"); this.contactNumber = getIntent().getExtras().getString("number"); } HashMap<String, ArrayList<String>> contactDetails = new ContactManager(getApplicationContext()).getDetailsFromId(this.id); contactName.setText(contactDetails.get("name").get(0)); contactName.setContentDescription( contactDetails.get("name").get(0).replaceAll(".(?=[0-9])", "$0 ")); contactName.setOnFocusChangeListener( new OnFocusChangeListener() { @Override public void onFocusChange(View view, boolean hasFocus) { if (hasFocus) { giveFeedback(((TextView) view).getText().toString()); } } }); attachListener(btnDelete); attachListener(btnCopyToSD); attachListener(btnImport); attachListener(btnExport); attachKeyListener(btnDelete, 1); btnDelete.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { confirmDelete("Are you sure you want to delete the contact?"); } }); attachKeyListener(btnCopyToSD, 2); btnCopyToSD.setOnClickListener( new OnClickListener() { @Override public void onClick(View view) { copyToSDcard(); } }); btnExport.setOnClickListener( new OnClickListener() { @Override public void onClick(View view) { export(); } }); attachKeyListener(btnExport, 3); btnImport.setOnClickListener( new OnClickListener() { @Override public void onClick(View view) { importContact(); } }); attachKeyListener(btnImport, 4); handler = new Handler() { public void handleMessage(Message message) { if (message.getData().getInt("type") == EXPORTONECONTACT) { if (message.getData().getBoolean("success") == true) { TTS.stop(); // check if keyboard is connected but accessibility // services are disabled if (!Utils.isAccessibilityEnabled(getApplicationContext()) && getResources().getConfiguration().keyboard != Configuration.KEYBOARD_NOKEYS) TTS.speak(getResources().getString(R.string.copycontactsuccess)); Toast.makeText( getApplicationContext(), getResources().getString(R.string.copycontactsuccess), Toast.LENGTH_SHORT) .show(); } else { TTS.stop(); // check if keyboard is connected but accessibility // services are disabled if (!Utils.isAccessibilityEnabled(getApplicationContext()) && getResources().getConfiguration().keyboard != Configuration.KEYBOARD_NOKEYS) TTS.speak(getResources().getString(R.string.copycontactfailure)); Toast.makeText( getApplicationContext(), getResources().getString(R.string.copycontactfailure), Toast.LENGTH_SHORT) .show(); } } else if (message.getData().getInt("type") == EXPORTALLCONTACTS) { if (message.getData().getBoolean("success") == true) { TTS.stop(); // check if keyboard is connected but accessibility // services are disabled if (!Utils.isAccessibilityEnabled(getApplicationContext()) && getResources().getConfiguration().keyboard != Configuration.KEYBOARD_NOKEYS) TTS.speak(getResources().getString(R.string.copyallcontactssuccess)); Toast.makeText( getApplicationContext(), getResources().getString(R.string.copyallcontactssuccess), Toast.LENGTH_SHORT) .show(); } else { TTS.stop(); // check if keyboard is connected but accessibility // services are disabled if (!Utils.isAccessibilityEnabled(getApplicationContext()) && getResources().getConfiguration().keyboard != Configuration.KEYBOARD_NOKEYS) TTS.speak(getResources().getString(R.string.copyallcontactsfailure)); Toast.makeText( getApplicationContext(), getResources().getString(R.string.copyallcontactsfailure), Toast.LENGTH_SHORT) .show(); } } } }; }
@Override public View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View root = inflater.inflate(R.layout.fragment_advanced_options, container, false); getDialog().setCancelable(true); getDialog().setCanceledOnTouchOutside(true); mPlaybackSpeed = (TextView) root.findViewById(R.id.playback_speed); mPlaybackSpeed.setOnFocusChangeListener(mFocusListener); mPlaybackSpeed.setOnClickListener(this); mPlaybackSpeed.setOnLongClickListener(this); mSleep = (TextView) root.findViewById(R.id.sleep); mSleep.setOnClickListener(this); mSleep.setOnFocusChangeListener(mFocusListener); mJumpTitle = (TextView) root.findViewById(R.id.jump_title); mJumpTitle.setOnClickListener(this); if (mMode == MODE_VIDEO) { mPlayAsAudio = (ImageView) root.findViewById(R.id.play_as_audio_icon); mPlayAsAudio.setOnClickListener(this); mChaptersTitle = (TextView) root.findViewById(R.id.jump_chapter_title); mChaptersTitle.setOnFocusChangeListener(mFocusListener); mChaptersTitle.setOnClickListener(this); mAudioDelay = (TextView) root.findViewById(R.id.audio_delay); mAudioDelay.setOnFocusChangeListener(mFocusListener); mAudioDelay.setOnClickListener(this); mSpuDelay = (TextView) root.findViewById(R.id.spu_delay); mSpuDelay.setOnFocusChangeListener(mFocusListener); mSpuDelay.setOnClickListener(this); } else { root.findViewById(R.id.audio_delay).setVisibility(View.GONE); root.findViewById(R.id.spu_delay).setVisibility(View.GONE); root.findViewById(R.id.jump_chapter_title).setVisibility(View.GONE); root.findViewById(R.id.play_as_audio_icon).setVisibility(View.GONE); } if (mMode == MODE_AUDIO) { mEqualizer = (TextView) root.findViewById(R.id.opt_equalizer); mEqualizer.setOnClickListener(this); } else root.findViewById(R.id.opt_equalizer).setVisibility(View.GONE); mTextColor = mSleep.getCurrentTextColor(); if (getDialog() != null) { int dialogWidth = getResources() .getDimensionPixelSize( mMode == MODE_VIDEO ? R.dimen.adv_options_video_width : R.dimen.adv_options_music_width); int dialogHeight = ViewGroup.LayoutParams.WRAP_CONTENT; getDialog().getWindow().setLayout(dialogWidth, dialogHeight); getDialog() .getWindow() .setBackgroundDrawableResource( Util.getResourceFromAttribute(getActivity(), R.attr.rounded_bg)); } return root; }