Use global keys for two other arguments
This commit is contained in:
parent
e9448c6dde
commit
00f9a8ed89
@ -35,6 +35,8 @@ import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
import static com.readrops.app.fragments.settings.AccountSettingsFragment.OPEN_OPML_FILE_REQUEST;
|
||||
import static com.readrops.app.utils.ReadropsKeys.ACCOUNT;
|
||||
import static com.readrops.app.utils.ReadropsKeys.ACCOUNT_TYPE;
|
||||
import static com.readrops.app.utils.ReadropsKeys.FROM_MAIN_ACTIVITY;
|
||||
|
||||
public class AccountTypeListActivity extends AppCompatActivity {
|
||||
|
||||
@ -58,7 +60,7 @@ public class AccountTypeListActivity extends AppCompatActivity {
|
||||
binding.accountTypeRecyclerview.setLayoutManager(new LinearLayoutManager(this));
|
||||
binding.accountTypeRecyclerview.addItemDecoration(new DividerItemDecoration(this, LinearLayout.VERTICAL));
|
||||
|
||||
fromMainActivity = getIntent().getBooleanExtra("fromMainActivity", false);
|
||||
fromMainActivity = getIntent().getBooleanExtra(FROM_MAIN_ACTIVITY, false);
|
||||
|
||||
if (fromMainActivity)
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
@ -70,7 +72,7 @@ public class AccountTypeListActivity extends AppCompatActivity {
|
||||
if (fromMainActivity)
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT);
|
||||
|
||||
intent.putExtra("accountType", (Parcelable) accountType);
|
||||
intent.putExtra(ACCOUNT_TYPE, (Parcelable) accountType);
|
||||
|
||||
startActivity(intent);
|
||||
finish();
|
||||
|
@ -27,6 +27,7 @@ import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
import static com.readrops.app.utils.ReadropsKeys.ACCOUNT;
|
||||
import static com.readrops.app.utils.ReadropsKeys.ACCOUNT_TYPE;
|
||||
import static com.readrops.app.utils.ReadropsKeys.EDIT_ACCOUNT;
|
||||
|
||||
public class AddAccountActivity extends AppCompatActivity {
|
||||
@ -46,7 +47,7 @@ public class AddAccountActivity extends AppCompatActivity {
|
||||
binding = DataBindingUtil.setContentView(this, R.layout.activity_add_account);
|
||||
viewModel = ViewModelProviders.of(this).get(AccountViewModel.class);
|
||||
|
||||
accountType = getIntent().getParcelableExtra("accountType");
|
||||
accountType = getIntent().getParcelableExtra(ACCOUNT_TYPE);
|
||||
|
||||
int flag = getIntent().getFlags();
|
||||
forwardResult = flag == Intent.FLAG_ACTIVITY_FORWARD_RESULT;
|
||||
|
@ -65,6 +65,7 @@ import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
import static com.readrops.app.utils.ReadropsKeys.ACCOUNT;
|
||||
import static com.readrops.app.utils.ReadropsKeys.FEEDS;
|
||||
import static com.readrops.app.utils.ReadropsKeys.FROM_MAIN_ACTIVITY;
|
||||
import static com.readrops.app.utils.ReadropsKeys.IMAGE_URL;
|
||||
import static com.readrops.app.utils.ReadropsKeys.ITEM_ID;
|
||||
import static com.readrops.app.utils.ReadropsKeys.SETTINGS;
|
||||
@ -160,7 +161,7 @@ public class MainActivity extends AppCompatActivity implements SwipeRefreshLayou
|
||||
switch (id) {
|
||||
case DrawerManager.ADD_ACCOUNT_ID:
|
||||
Intent intent = new Intent(this, AccountTypeListActivity.class);
|
||||
intent.putExtra("fromMainActivity", true);
|
||||
intent.putExtra(FROM_MAIN_ACTIVITY, true);
|
||||
startActivityForResult(intent, ADD_ACCOUNT_REQUEST);
|
||||
break;
|
||||
case DrawerManager.ACCOUNT_SETTINGS_ID:
|
||||
|
@ -3,8 +3,11 @@ package com.readrops.app.utils
|
||||
object ReadropsKeys {
|
||||
|
||||
const val ACCOUNT = "ACCOUNT_KEY"
|
||||
const val ACCOUNT_TYPE = "ACCOUNT_TYPE_KEY"
|
||||
const val EDIT_ACCOUNT = "EDIT_ACCOUNT"
|
||||
|
||||
const val FROM_MAIN_ACTIVITY = "FROM_MAIN_ACTIVITY_KEY"
|
||||
|
||||
const val ITEM_ID = "ITEM_ID_KEY"
|
||||
const val IMAGE_URL = "IMAGE_URL_KEY"
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user