@Override public void onResume() { // TODO Auto-generated method stub super.onResume(); // setProfilePic(); if (myNameView != null) myNameView.setText(sharedPrefManager.getDisplayName()); setProfilePic(sharedPrefManager.getUserName()); if (aboutSuperGroupView != null) aboutSuperGroupView.setText("About " + sharedPrefManager.getCurrentSGDisplayName()); }
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.more_screen); UtilSetFont.setFontMainScreen(this); profileIconLayout = (RelativeLayout) findViewById(R.id.id_profile_layout); // advancedSettings = (RelativeLayout)findViewById(R.id.id_advanced_settings); // sharedID = (RelativeLayout)findViewById(R.id.id_shared); // accountIconLayout = (LinearLayout)view.findViewById(R.id.id_account_layout); // settingIconLayout = (LinearLayout)view.findViewById(R.id.id_setting_layout); myNameView = (TextView) findViewById(R.id.id_my_name); aboutSuperGroupView = (TextView) findViewById(R.id.id_about_supergroup); aboutIconLayout = (RelativeLayout) findViewById(R.id.id_about_us); blockListLayout = (RelativeLayout) findViewById(R.id.id_block_list_layout); feedbackLayout = (RelativeLayout) findViewById(R.id.id_feedback_layout); consolePassLayout = (RelativeLayout) findViewById(R.id.id_configure_console_pass); id_open_console = (RelativeLayout) findViewById(R.id.id_open_console); sgProfileLayout = (RelativeLayout) findViewById(R.id.id_supergroup_profile); privacyLayout = (RelativeLayout) findViewById(R.id.id_privacy_layout); checkUpdateLayout = (RelativeLayout) findViewById(R.id.id_checkupdate_layout); soonzeLayout = (RelativeLayout) findViewById(R.id.id_snooze_layout); muteSettingText = (TextView) findViewById(R.id.mute_setting_txt); id_data_usage_layout = (RelativeLayout) findViewById(R.id.id_data_usage_layout); switchSaveGalleryMedia = (Switch) findViewById(R.id.switchSaveGalleryMedia); superGroupDownloadSettingsHandler = new SuperGroupDownloadSettingsHandler(this); boolean isSaveInGallery = superGroupDownloadSettingsHandler.isSavedInGallery(); switchSaveGalleryMedia.setChecked(isSaveInGallery); switchSaveGalleryMedia.setOnCheckedChangeListener( new CompoundButton.OnCheckedChangeListener() { public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { superGroupDownloadSettingsHandler.changeMediaGallerySetting(isChecked); } }); officialIDLayout = (RelativeLayout) findViewById(R.id.id_offocial_id_layout); memberStatsLayout = (RelativeLayout) findViewById(R.id.id_memberstats_layout); privacyLayout.setOnClickListener(this); id_data_usage_layout.setOnClickListener(this); soonzeLayout.setOnClickListener(this); ((RelativeLayout) findViewById(R.id.id_chat_layout)).setOnClickListener(this); sharedPrefManager = SharedPrefManager.getInstance(); myNameView.setText(sharedPrefManager.getDisplayName()); aboutSuperGroupView.setText("About " + sharedPrefManager.getCurrentSGDisplayName()); if (sharedPrefManager.isDomainAdmin(sharedPrefManager.getUserDomain()) || sharedPrefManager.isDomainSubAdmin(sharedPrefManager.getUserDomain())) { // memberStatsLayout = (RelativeLayout)findViewById(R.id.id_member_stats_layout); advancedSettings = (RelativeLayout) findViewById(R.id.id_advanced_settings); memberManageLayout = (RelativeLayout) findViewById(R.id.id_manage_members_layout); // memberStatsLayout.setVisibility(View.VISIBLE); memberManageLayout.setVisibility(View.VISIBLE); // advancedSettings.setVisibility(View.VISIBLE); officialIDLayout.setVisibility(View.VISIBLE); memberStatsLayout.setVisibility(View.VISIBLE); // consolePassLayout.setVisibility(View.VISIBLE); advancedSettings.setOnClickListener(this); officialIDLayout.setOnClickListener(this); memberStatsLayout.setOnClickListener(this); memberManageLayout.setOnClickListener(this); } if ((sharedPrefManager.getSnoozeExpiryTime(sharedPrefManager.getUserDomain()) - System.currentTimeMillis()) > 0) { String time = (getResources().getStringArray(R.array.snooze_list_array)) [sharedPrefManager.getSnoozeIndex(sharedPrefManager.getUserDomain())]; muteSettingText.setVisibility(View.VISIBLE); muteSettingText.setText(time); } ((ImageView) findViewById(R.id.id_profile_pic)) .setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub String file_path = getImagePath( SharedPrefManager.getInstance() .getUserFileId(sharedPrefManager.getUserName())); if (file_path == null || (file_path != null && file_path.trim().length() == 0)) file_path = getImagePath(null); if (file_path != null) { Intent intent = new Intent(); intent.setAction(Intent.ACTION_VIEW); if (file_path.startsWith("http://")) intent.setDataAndType(Uri.parse(file_path), "image/*"); else intent.setDataAndType(Uri.parse("file://" + file_path), "image/*"); startActivity(intent); } } }); // profileIconView = (RoundedImageView)view.findViewById(R.id.id_profile_icon); ((TextView) findViewById(R.id.id_back)) .setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub finish(); } }); ImageView xmppStatusView = (ImageView) findViewById(R.id.id_xmpp_status); if (ChatService.xmppConectionStatus) { xmppStatusView.setImageResource(R.drawable.blue_dot); } else { xmppStatusView.setImageResource(R.drawable.red_dot); } // settingIconLayout.setOnClickListener(this); blockListLayout.setOnClickListener(this); feedbackLayout.setOnClickListener(this); consolePassLayout.setOnClickListener(this); id_open_console.setOnClickListener(this); profileIconLayout.setOnClickListener(this); // sharedID.setOnClickListener(this); // accountIconLayout.setOnClickListener(this); sgProfileLayout.setVisibility(View.VISIBLE); sgProfileLayout.setOnClickListener(this); checkUpdateLayout.setOnClickListener(this); aboutIconLayout.setOnClickListener(this); // Tracker t = ((SuperChatApplication) // SuperChatApplication.context).getTracker(TrackerName.APP_TRACKER); // t.setScreenName("More Options Screen"); // t.send(new HitBuilders.AppViewBuilder().build()); // setProfilePic(sharedPrefManager.getUserName()); UtilSetFont.setFontMainScreen(this); }