diff options
author | Samuel Holland <samuel@sholland.org> | 2017-08-13 07:24:03 -0500 |
---|---|---|
committer | Samuel Holland <samuel@sholland.org> | 2017-08-13 07:24:03 -0500 |
commit | 5e55d196be092f4a4dcb212cf09d7a1bdab70e00 (patch) | |
tree | eb765a1b961fefdaa7ddc3cfae9cb83a09e0c031 /app/src/main/java/com/wireguard/android/ProfileActivity.java | |
parent | c72d30a1af8114ef506a137e3e7274ac33d82bd1 (diff) |
Major renaming and refactoring in activity and service
Apparently "configuration" is the proper term, not "profile".
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'app/src/main/java/com/wireguard/android/ProfileActivity.java')
-rw-r--r-- | app/src/main/java/com/wireguard/android/ProfileActivity.java | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/app/src/main/java/com/wireguard/android/ProfileActivity.java b/app/src/main/java/com/wireguard/android/ProfileActivity.java deleted file mode 100644 index 29d249d4..00000000 --- a/app/src/main/java/com/wireguard/android/ProfileActivity.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.wireguard.android; - -import android.content.Intent; -import android.os.Bundle; -import android.view.Menu; -import android.view.MenuItem; - -/** - * Base class for activities that use ProfileListFragment and ProfileDetailFragment. - */ - -abstract class ProfileActivity extends ServiceClientActivity<ProfileServiceInterface> { - public static final String KEY_IS_EDITING = "is_editing"; - public static final String KEY_PROFILE_NAME = "profile_name"; - protected static final String TAG_DETAIL = "detail"; - protected static final String TAG_EDIT = "edit"; - protected static final String TAG_LIST = "list"; - protected static final String TAG_PLACEHOLDER = "placeholder"; - - private String currentProfile; - private boolean isEditing; - - public ProfileActivity() { - super(ProfileService.class); - } - - protected String getCurrentProfile() { - return currentProfile; - } - - protected boolean isEditing() { - return isEditing; - } - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - // Restore the saved profile if there is one; otherwise grab it from the intent. - if (savedInstanceState != null) { - currentProfile = savedInstanceState.getString(KEY_PROFILE_NAME); - isEditing = savedInstanceState.getBoolean(KEY_IS_EDITING, false); - } else { - final Intent intent = getIntent(); - currentProfile = intent.getStringExtra(KEY_PROFILE_NAME); - isEditing = intent.getBooleanExtra(KEY_IS_EDITING, false); - } - } - - @Override - public boolean onCreateOptionsMenu(Menu menu) { - getMenuInflater().inflate(R.menu.main, menu); - return true; - } - - @Override - public void onSaveInstanceState(Bundle outState) { - super.onSaveInstanceState(outState); - outState.putBoolean(KEY_IS_EDITING, isEditing); - outState.putString(KEY_PROFILE_NAME, currentProfile); - } - - protected void setCurrentProfile(String profile) { - currentProfile = profile; - } - - protected void setIsEditing(boolean isEditing) { - this.isEditing = isEditing; - } -} |