use of com.applozic.mobicomkit.uiwidgets.people.contact.ContactSelectionFragment in project Applozic-Android-SDK by AppLozic.
the class ContactSelectionActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.contact_select_layout);
contactDatabase = new ContactDatabase(this);
contactSelectionFragment = new ContactSelectionFragment();
setSearchListFragment(contactSelectionFragment);
Toolbar toolbar = (Toolbar) findViewById(R.id.my_toolbar);
setSupportActionBar(toolbar);
contactService = new AppContactService(this);
mActionBar = getSupportActionBar();
String jsonString = FileUtils.loadSettingsJsonFile(getApplicationContext());
if (!TextUtils.isEmpty(jsonString)) {
alCustomizationSettings = (AlCustomizationSettings) GsonUtils.getObjectFromJson(jsonString, AlCustomizationSettings.class);
} else {
alCustomizationSettings = new AlCustomizationSettings();
}
if (!TextUtils.isEmpty(alCustomizationSettings.getThemeColorPrimary()) && !TextUtils.isEmpty(alCustomizationSettings.getThemeColorPrimaryDark())) {
mActionBar.setBackgroundDrawable(new ColorDrawable(Color.parseColor(alCustomizationSettings.getThemeColorPrimary())));
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
getWindow().setStatusBarColor(Color.parseColor(alCustomizationSettings.getThemeColorPrimaryDark()));
}
}
mActionBar.setDisplayShowHomeEnabled(true);
mActionBar.setDisplayHomeAsUpEnabled(true);
if (getIntent().getExtras() != null) {
channel = (Channel) getIntent().getSerializableExtra(CHANNEL_OBJECT);
disableCheckBox = getIntent().getBooleanExtra(CHECK_BOX, false);
mActionBar.setTitle(R.string.channel_member_title);
name = getIntent().getStringExtra(CHANNEL);
imageUrl = getIntent().getStringExtra(IMAGE_LINK);
groupType = getIntent().getIntExtra(GROUP_TYPE, Channel.GroupType.PUBLIC.getValue().intValue());
} else {
mActionBar.setTitle(R.string.channel_members_title);
}
Bundle bundle = new Bundle();
bundle.putSerializable(CHANNEL_OBJECT, channel);
bundle.putBoolean(CHECK_BOX, disableCheckBox);
bundle.putString(CHANNEL, name);
bundle.putString(IMAGE_LINK, imageUrl);
bundle.putInt(GROUP_TYPE, groupType);
contactSelectionFragment.setArguments(bundle);
addFragment(this, contactSelectionFragment, "ContactSelectionFragment");
connectivityReceiver = new ConnectivityReceiver();
registerReceiver(connectivityReceiver, new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION));
}
Aggregations