diff --git a/app/src/main/java/com/keylesspalace/tusky/AboutActivity.java b/app/src/main/java/com/keylesspalace/tusky/AboutActivity.java index 00a9ef0b..8c1fa88b 100644 --- a/app/src/main/java/com/keylesspalace/tusky/AboutActivity.java +++ b/app/src/main/java/com/keylesspalace/tusky/AboutActivity.java @@ -26,7 +26,7 @@ public class AboutActivity extends BaseActivity { super.onCreate(savedInstanceState); setContentView(R.layout.activity_about); - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); + Toolbar toolbar = findViewById(R.id.toolbar); setSupportActionBar(toolbar); ActionBar bar = getSupportActionBar(); if (bar != null) { @@ -34,12 +34,12 @@ public class AboutActivity extends BaseActivity { bar.setDisplayShowHomeEnabled(true); } - TextView versionTextView = (TextView) findViewById(R.id.versionTV); + TextView versionTextView = findViewById(R.id.versionTV); String versionName = BuildConfig.VERSION_NAME; String versionFormat = getString(R.string.about_application_version); versionTextView.setText(String.format(versionFormat, versionName)); - appAccountButton = (Button) findViewById(R.id.tusky_profile_button); + appAccountButton = findViewById(R.id.tusky_profile_button); appAccountButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { diff --git a/app/src/main/java/com/keylesspalace/tusky/AccountListActivity.java b/app/src/main/java/com/keylesspalace/tusky/AccountListActivity.java index 6b70c89c..735c1612 100644 --- a/app/src/main/java/com/keylesspalace/tusky/AccountListActivity.java +++ b/app/src/main/java/com/keylesspalace/tusky/AccountListActivity.java @@ -46,7 +46,7 @@ public class AccountListActivity extends BaseActivity { type = Type.BLOCKS; } - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); + Toolbar toolbar = findViewById(R.id.toolbar); setSupportActionBar(toolbar); ActionBar bar = getSupportActionBar(); if (bar != null) { diff --git a/app/src/main/java/com/keylesspalace/tusky/ComposeActivity.java b/app/src/main/java/com/keylesspalace/tusky/ComposeActivity.java index b34e05ae..1f6a4630 100644 --- a/app/src/main/java/com/keylesspalace/tusky/ComposeActivity.java +++ b/app/src/main/java/com/keylesspalace/tusky/ComposeActivity.java @@ -169,20 +169,20 @@ public class ComposeActivity extends BaseActivity implements ComposeOptionsFragm super.onCreate(savedInstanceState); setContentView(R.layout.activity_compose); - textEditor = (EditTextTyped) findViewById(R.id.compose_edit_field); - mediaPreviewBar = (LinearLayout) findViewById(R.id.compose_media_preview_bar); + textEditor = findViewById(R.id.compose_edit_field); + mediaPreviewBar = findViewById(R.id.compose_media_preview_bar); contentWarningBar = findViewById(R.id.compose_content_warning_bar); - contentWarningEditor = (EditText) findViewById(R.id.field_content_warning); - charactersLeft = (TextView) findViewById(R.id.characters_left); - floatingBtn = (Button) findViewById(R.id.floating_btn); - pickButton = (ImageButton) findViewById(R.id.compose_photo_pick); - visibilityBtn = (ImageButton) findViewById(R.id.action_toggle_visibility); - saveButton = (ImageButton) findViewById(R.id.compose_save_draft); - hideMediaToggle = (ImageButton) findViewById(R.id.action_hide_media); - postProgress = (ProgressBar) findViewById(R.id.postProgress); + contentWarningEditor = findViewById(R.id.field_content_warning); + charactersLeft = findViewById(R.id.characters_left); + floatingBtn = findViewById(R.id.floating_btn); + pickButton = findViewById(R.id.compose_photo_pick); + visibilityBtn = findViewById(R.id.action_toggle_visibility); + saveButton = findViewById(R.id.compose_save_draft); + hideMediaToggle = findViewById(R.id.action_hide_media); + postProgress = findViewById(R.id.postProgress); // Setup the toolbar. - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); + Toolbar toolbar = findViewById(R.id.toolbar); setSupportActionBar(toolbar); ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { @@ -666,7 +666,7 @@ public class ComposeActivity extends BaseActivity implements ComposeOptionsFragm return c; } - public boolean saveTheToot(String s, @Nullable String contentWarning) { + private boolean saveTheToot(String s, @Nullable String contentWarning) { if (TextUtils.isEmpty(s)) { return false; } @@ -789,13 +789,13 @@ public class ComposeActivity extends BaseActivity implements ComposeOptionsFragm updateVisibleCharactersLeft(); } - void setStateToReadying() { + private void setStateToReadying() { statusAlreadyInFlight = true; disableButtons(); postProgress.setVisibility(View.VISIBLE); } - void setStateToNotReadying() { + private void setStateToNotReadying() { postProgress.setVisibility(View.INVISIBLE); statusAlreadyInFlight = false; enableButtons(); @@ -1706,9 +1706,9 @@ public class ComposeActivity extends BaseActivity implements ComposeOptionsFragm Account account = getItem(position); if (account != null) { - TextView username = (TextView) view.findViewById(R.id.username); - TextView displayName = (TextView) view.findViewById(R.id.display_name); - ImageView avatar = (ImageView) view.findViewById(R.id.avatar); + TextView username = view.findViewById(R.id.username); + TextView displayName = view.findViewById(R.id.display_name); + ImageView avatar = view.findViewById(R.id.avatar); String format = getContext().getString(R.string.status_username_format); String formattedUsername = String.format(format, account.username); username.setText(formattedUsername); diff --git a/app/src/main/java/com/keylesspalace/tusky/EditProfileActivity.java b/app/src/main/java/com/keylesspalace/tusky/EditProfileActivity.java index ba6e4c30..ccc6950e 100644 --- a/app/src/main/java/com/keylesspalace/tusky/EditProfileActivity.java +++ b/app/src/main/java/com/keylesspalace/tusky/EditProfileActivity.java @@ -95,17 +95,17 @@ public class EditProfileActivity extends BaseActivity { super.onCreate(savedInstanceState); setContentView(R.layout.activity_edit_profile); - ImageButton headerButton = (ImageButton) findViewById(R.id.edit_profile_header); - headerPreview = (ImageView) findViewById(R.id.edit_profile_header_preview); - headerProgress = (ProgressBar) findViewById(R.id.edit_profile_header_progress); - avatarButton = (ImageButton) findViewById(R.id.edit_profile_avatar); - avatarPreview = (ImageView) findViewById(R.id.edit_profile_avatar_preview); - avatarProgress = (ProgressBar) findViewById(R.id.edit_profile_avatar_progress); - displayNameEditText = (EditText) findViewById(R.id.edit_profile_display_name); - noteEditText = (EditText) findViewById(R.id.edit_profile_note); - saveProgress = (ProgressBar) findViewById(R.id.edit_profile_save_progress); + ImageButton headerButton = findViewById(R.id.edit_profile_header); + headerPreview = findViewById(R.id.edit_profile_header_preview); + headerProgress = findViewById(R.id.edit_profile_header_progress); + avatarButton = findViewById(R.id.edit_profile_avatar); + avatarPreview = findViewById(R.id.edit_profile_avatar_preview); + avatarProgress = findViewById(R.id.edit_profile_avatar_progress); + displayNameEditText = findViewById(R.id.edit_profile_display_name); + noteEditText = findViewById(R.id.edit_profile_note); + saveProgress = findViewById(R.id.edit_profile_save_progress); - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); + Toolbar toolbar = findViewById(R.id.toolbar); setSupportActionBar(toolbar); ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { @@ -171,8 +171,8 @@ public class EditProfileActivity extends BaseActivity { priorDisplayName = me.getDisplayName(); priorNote = me.note.toString(); CircularImageView avatar = - (CircularImageView) findViewById(R.id.edit_profile_avatar_preview); - ImageView header = (ImageView) findViewById(R.id.edit_profile_header_preview); + findViewById(R.id.edit_profile_avatar_preview); + ImageView header = findViewById(R.id.edit_profile_header_preview); displayNameEditText.setText(priorDisplayName); noteEditText.setText(priorNote); diff --git a/app/src/main/java/com/keylesspalace/tusky/FavouritesActivity.java b/app/src/main/java/com/keylesspalace/tusky/FavouritesActivity.java index 88918c35..470cfa2f 100644 --- a/app/src/main/java/com/keylesspalace/tusky/FavouritesActivity.java +++ b/app/src/main/java/com/keylesspalace/tusky/FavouritesActivity.java @@ -31,7 +31,7 @@ public class FavouritesActivity extends BaseActivity { super.onCreate(savedInstanceState); setContentView(R.layout.activity_favourites); - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); + Toolbar toolbar = findViewById(R.id.toolbar); setSupportActionBar(toolbar); ActionBar bar = getSupportActionBar(); if (bar != null) { diff --git a/app/src/main/java/com/keylesspalace/tusky/LoginActivity.java b/app/src/main/java/com/keylesspalace/tusky/LoginActivity.java index e8fb6472..91ed0750 100644 --- a/app/src/main/java/com/keylesspalace/tusky/LoginActivity.java +++ b/app/src/main/java/com/keylesspalace/tusky/LoginActivity.java @@ -73,11 +73,11 @@ public class LoginActivity extends AppCompatActivity { setContentView(R.layout.activity_login); - input = (LinearLayout) findViewById(R.id.login_input); - loading = (LinearLayout) findViewById(R.id.login_loading); - editText = (EditText) findViewById(R.id.edit_text_domain); - Button button = (Button) findViewById(R.id.button_login); - TextView whatsAnInstance = (TextView) findViewById(R.id.whats_an_instance); + input = findViewById(R.id.login_input); + loading = findViewById(R.id.login_loading); + editText = findViewById(R.id.edit_text_domain); + Button button = findViewById(R.id.button_login); + TextView whatsAnInstance = findViewById(R.id.whats_an_instance); if (savedInstanceState != null) { domain = savedInstanceState.getString("domain"); @@ -114,7 +114,7 @@ public class LoginActivity extends AppCompatActivity { } }) .show(); - TextView textView = (TextView) dialog.findViewById(android.R.id.message); + TextView textView = dialog.findViewById(android.R.id.message); textView.setMovementMethod(LinkMovementMethod.getInstance()); } }); diff --git a/app/src/main/java/com/keylesspalace/tusky/MainActivity.java b/app/src/main/java/com/keylesspalace/tusky/MainActivity.java index 7a3a64d5..2eebba34 100644 --- a/app/src/main/java/com/keylesspalace/tusky/MainActivity.java +++ b/app/src/main/java/com/keylesspalace/tusky/MainActivity.java @@ -78,7 +78,7 @@ public class MainActivity extends BaseActivity implements ActionButtonActivity { private static final long DRAWER_ITEM_FOLLOW_REQUESTS = 8; private static final long DRAWER_ITEM_SAVED_TOOT = 9; - protected static int COMPOSE_RESULT = 1; + private static int COMPOSE_RESULT = 1; private FloatingActionButton composeButton; private String loggedInAccountId; @@ -101,10 +101,10 @@ public class MainActivity extends BaseActivity implements ActionButtonActivity { } } - FloatingActionButton floatingBtn = (FloatingActionButton) findViewById(R.id.floating_btn); - ImageButton drawerToggle = (ImageButton) findViewById(R.id.drawer_toggle); - TabLayout tabLayout = (TabLayout) findViewById(R.id.tab_layout); - viewPager = (ViewPager) findViewById(R.id.pager); + FloatingActionButton floatingBtn = findViewById(R.id.floating_btn); + ImageButton drawerToggle = findViewById(R.id.drawer_toggle); + TabLayout tabLayout = findViewById(R.id.tab_layout); + viewPager = findViewById(R.id.pager); floatingBtn.setOnClickListener(new View.OnClickListener() { @Override diff --git a/app/src/main/java/com/keylesspalace/tusky/ReportActivity.java b/app/src/main/java/com/keylesspalace/tusky/ReportActivity.java index 3ef117ca..b6332ea1 100644 --- a/app/src/main/java/com/keylesspalace/tusky/ReportActivity.java +++ b/app/src/main/java/com/keylesspalace/tusky/ReportActivity.java @@ -65,7 +65,7 @@ public class ReportActivity extends BaseActivity { String statusId = intent.getStringExtra("status_id"); String statusContent = intent.getStringExtra("status_content"); - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); + Toolbar toolbar = findViewById(R.id.toolbar); setSupportActionBar(toolbar); ActionBar bar = getSupportActionBar(); if (bar != null) { @@ -77,7 +77,7 @@ public class ReportActivity extends BaseActivity { } anyView = toolbar; - final RecyclerView recyclerView = (RecyclerView) findViewById(R.id.report_recycler_view); + final RecyclerView recyclerView = findViewById(R.id.report_recycler_view); recyclerView.setHasFixedSize(true); LinearLayoutManager layoutManager = new LinearLayoutManager(this); recyclerView.setLayoutManager(layoutManager); @@ -95,7 +95,7 @@ public class ReportActivity extends BaseActivity { HtmlUtils.fromHtml(statusContent), true); adapter.addItem(reportStatus); - comment = (EditText) findViewById(R.id.report_comment); + comment = findViewById(R.id.report_comment); reportAlreadyInFlight = false; diff --git a/app/src/main/java/com/keylesspalace/tusky/SavedTootActivity.java b/app/src/main/java/com/keylesspalace/tusky/SavedTootActivity.java index 3e83074a..6826660b 100644 --- a/app/src/main/java/com/keylesspalace/tusky/SavedTootActivity.java +++ b/app/src/main/java/com/keylesspalace/tusky/SavedTootActivity.java @@ -41,7 +41,7 @@ import java.util.ArrayList; import java.util.List; public class SavedTootActivity extends BaseActivity implements SavedTootAdapter.SavedTootAction { - public static final String TAG = "SavedTootActivity"; // logging tag + private static final String TAG = "SavedTootActivity"; // logging tag // dao private static TootDao tootDao = TuskyApplication.getDB().tootDao(); @@ -55,7 +55,7 @@ public class SavedTootActivity extends BaseActivity implements SavedTootAdapter. super.onCreate(savedInstanceState); setContentView(R.layout.activity_saved_toot); - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); + Toolbar toolbar = findViewById(R.id.toolbar); setSupportActionBar(toolbar); ActionBar bar = getSupportActionBar(); if (bar != null) { @@ -64,8 +64,8 @@ public class SavedTootActivity extends BaseActivity implements SavedTootAdapter. bar.setDisplayShowHomeEnabled(true); } - RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recycler_view); - noContent = (TextView) findViewById(R.id.no_content); + RecyclerView recyclerView = findViewById(R.id.recycler_view); + noContent = findViewById(R.id.no_content); recyclerView.setHasFixedSize(true); LinearLayoutManager layoutManager = new LinearLayoutManager(this); recyclerView.setLayoutManager(layoutManager); @@ -98,7 +98,7 @@ public class SavedTootActivity extends BaseActivity implements SavedTootAdapter. return super.onOptionsItemSelected(item); } - public void getAllToot() { + private void getAllToot() { new AsyncTask>() { @Override protected List doInBackground(Void... params) { diff --git a/app/src/main/java/com/keylesspalace/tusky/SearchActivity.java b/app/src/main/java/com/keylesspalace/tusky/SearchActivity.java index 156baf02..112189fe 100644 --- a/app/src/main/java/com/keylesspalace/tusky/SearchActivity.java +++ b/app/src/main/java/com/keylesspalace/tusky/SearchActivity.java @@ -55,10 +55,10 @@ public class SearchActivity extends BaseActivity implements SearchView.OnQueryTe super.onCreate(savedInstanceState); setContentView(R.layout.activity_search); - progressBar = (ProgressBar) findViewById(R.id.progress_bar); - messageNoResults = (TextView) findViewById(R.id.message_no_results); + progressBar = findViewById(R.id.progress_bar); + messageNoResults = findViewById(R.id.message_no_results); - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); + Toolbar toolbar = findViewById(R.id.toolbar); setSupportActionBar(toolbar); ActionBar bar = getSupportActionBar(); if (bar != null) { @@ -67,7 +67,7 @@ public class SearchActivity extends BaseActivity implements SearchView.OnQueryTe bar.setDisplayShowTitleEnabled(false); } - RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recycler_view); + RecyclerView recyclerView = findViewById(R.id.recycler_view); recyclerView.setHasFixedSize(true); recyclerView.setLayoutManager(new LinearLayoutManager(this)); adapter = new SearchResultsAdapter(this); diff --git a/app/src/main/java/com/keylesspalace/tusky/ViewMediaActivity.java b/app/src/main/java/com/keylesspalace/tusky/ViewMediaActivity.java index 813581b8..1493545b 100644 --- a/app/src/main/java/com/keylesspalace/tusky/ViewMediaActivity.java +++ b/app/src/main/java/com/keylesspalace/tusky/ViewMediaActivity.java @@ -67,8 +67,8 @@ public class ViewMediaActivity extends BaseActivity implements ViewMediaFragment supportPostponeEnterTransition(); // Obtain the views. - toolbar = (Toolbar) findViewById(R.id.toolbar); - viewPager = (ImageViewPager) findViewById(R.id.view_pager); + toolbar = findViewById(R.id.toolbar); + viewPager = findViewById(R.id.view_pager); anyView = toolbar; // Gather the parameters. diff --git a/app/src/main/java/com/keylesspalace/tusky/ViewTagActivity.java b/app/src/main/java/com/keylesspalace/tusky/ViewTagActivity.java index 1bed66af..dfbc6170 100644 --- a/app/src/main/java/com/keylesspalace/tusky/ViewTagActivity.java +++ b/app/src/main/java/com/keylesspalace/tusky/ViewTagActivity.java @@ -33,7 +33,7 @@ public class ViewTagActivity extends BaseActivity { String hashtag = getIntent().getStringExtra("hashtag"); - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); + Toolbar toolbar = findViewById(R.id.toolbar); setSupportActionBar(toolbar); ActionBar bar = getSupportActionBar(); diff --git a/app/src/main/java/com/keylesspalace/tusky/ViewThreadActivity.java b/app/src/main/java/com/keylesspalace/tusky/ViewThreadActivity.java index 9bda022a..231ec574 100644 --- a/app/src/main/java/com/keylesspalace/tusky/ViewThreadActivity.java +++ b/app/src/main/java/com/keylesspalace/tusky/ViewThreadActivity.java @@ -33,7 +33,7 @@ public class ViewThreadActivity extends BaseActivity { super.onCreate(savedInstanceState); setContentView(R.layout.activity_view_thread); - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); + Toolbar toolbar = findViewById(R.id.toolbar); setSupportActionBar(toolbar); ActionBar bar = getSupportActionBar(); if (bar != null) { diff --git a/app/src/main/java/com/keylesspalace/tusky/ViewVideoActivity.java b/app/src/main/java/com/keylesspalace/tusky/ViewVideoActivity.java index 7a7b33ed..539995a5 100644 --- a/app/src/main/java/com/keylesspalace/tusky/ViewVideoActivity.java +++ b/app/src/main/java/com/keylesspalace/tusky/ViewVideoActivity.java @@ -42,10 +42,10 @@ public class ViewVideoActivity extends BaseActivity { super.onCreate(savedInstanceState); setContentView(R.layout.activity_view_video); - final ProgressBar progressBar = (ProgressBar) findViewById(R.id.video_progress); - VideoView videoView = (VideoView) findViewById(R.id.video_player); + final ProgressBar progressBar = findViewById(R.id.video_progress); + VideoView videoView = findViewById(R.id.video_player); - toolbar = (Toolbar) findViewById(R.id.toolbar); + toolbar = findViewById(R.id.toolbar); setSupportActionBar(toolbar); ActionBar bar = getSupportActionBar(); if (bar != null) { diff --git a/app/src/main/java/com/keylesspalace/tusky/adapter/AccountViewHolder.java b/app/src/main/java/com/keylesspalace/tusky/adapter/AccountViewHolder.java index 4262f905..bf3b4a4d 100644 --- a/app/src/main/java/com/keylesspalace/tusky/adapter/AccountViewHolder.java +++ b/app/src/main/java/com/keylesspalace/tusky/adapter/AccountViewHolder.java @@ -22,9 +22,9 @@ class AccountViewHolder extends RecyclerView.ViewHolder { AccountViewHolder(View itemView) { super(itemView); container = itemView.findViewById(R.id.account_container); - username = (TextView) itemView.findViewById(R.id.account_username); - displayName = (TextView) itemView.findViewById(R.id.account_display_name); - avatar = (CircularImageView) itemView.findViewById(R.id.account_avatar); + username = itemView.findViewById(R.id.account_username); + displayName = itemView.findViewById(R.id.account_display_name); + avatar = itemView.findViewById(R.id.account_avatar); } void setupWithAccount(Account account) { diff --git a/app/src/main/java/com/keylesspalace/tusky/adapter/BlocksAdapter.java b/app/src/main/java/com/keylesspalace/tusky/adapter/BlocksAdapter.java index c1153d1d..395ef435 100644 --- a/app/src/main/java/com/keylesspalace/tusky/adapter/BlocksAdapter.java +++ b/app/src/main/java/com/keylesspalace/tusky/adapter/BlocksAdapter.java @@ -83,10 +83,10 @@ public class BlocksAdapter extends AccountAdapter { BlockedUserViewHolder(View itemView) { super(itemView); - avatar = (CircularImageView) itemView.findViewById(R.id.blocked_user_avatar); - username = (TextView) itemView.findViewById(R.id.blocked_user_username); - displayName = (TextView) itemView.findViewById(R.id.blocked_user_display_name); - unblock = (ImageButton) itemView.findViewById(R.id.blocked_user_unblock); + avatar = itemView.findViewById(R.id.blocked_user_avatar); + username = itemView.findViewById(R.id.blocked_user_username); + displayName = itemView.findViewById(R.id.blocked_user_display_name); + unblock = itemView.findViewById(R.id.blocked_user_unblock); } void setupWithAccount(Account account) { diff --git a/app/src/main/java/com/keylesspalace/tusky/adapter/FollowRequestsAdapter.java b/app/src/main/java/com/keylesspalace/tusky/adapter/FollowRequestsAdapter.java index bd7efb45..4ba38b7e 100644 --- a/app/src/main/java/com/keylesspalace/tusky/adapter/FollowRequestsAdapter.java +++ b/app/src/main/java/com/keylesspalace/tusky/adapter/FollowRequestsAdapter.java @@ -84,11 +84,11 @@ public class FollowRequestsAdapter extends AccountAdapter { FollowRequestViewHolder(View itemView) { super(itemView); - avatar = (CircularImageView) itemView.findViewById(R.id.follow_request_avatar); - username = (TextView) itemView.findViewById(R.id.follow_request_username); - displayName = (TextView) itemView.findViewById(R.id.follow_request_display_name); - accept = (ImageButton) itemView.findViewById(R.id.follow_request_accept); - reject = (ImageButton) itemView.findViewById(R.id.follow_request_reject); + avatar = itemView.findViewById(R.id.follow_request_avatar); + username = itemView.findViewById(R.id.follow_request_username); + displayName = itemView.findViewById(R.id.follow_request_display_name); + accept = itemView.findViewById(R.id.follow_request_accept); + reject = itemView.findViewById(R.id.follow_request_reject); } void setupWithAccount(Account account) { diff --git a/app/src/main/java/com/keylesspalace/tusky/adapter/FooterViewHolder.java b/app/src/main/java/com/keylesspalace/tusky/adapter/FooterViewHolder.java index 04ecf972..a93ee4de 100644 --- a/app/src/main/java/com/keylesspalace/tusky/adapter/FooterViewHolder.java +++ b/app/src/main/java/com/keylesspalace/tusky/adapter/FooterViewHolder.java @@ -39,8 +39,8 @@ public class FooterViewHolder extends RecyclerView.ViewHolder { FooterViewHolder(View itemView) { super(itemView); container = itemView.findViewById(R.id.footer_container); - progressBar = (ProgressBar) itemView.findViewById(R.id.footer_progress_bar); - endMessage = (TextView) itemView.findViewById(R.id.footer_end_message); + progressBar = itemView.findViewById(R.id.footer_progress_bar); + endMessage = itemView.findViewById(R.id.footer_end_message); Drawable top = AppCompatResources.getDrawable(itemView.getContext(), R.drawable.elephant_friend); if (top != null) { diff --git a/app/src/main/java/com/keylesspalace/tusky/adapter/MutesAdapter.java b/app/src/main/java/com/keylesspalace/tusky/adapter/MutesAdapter.java index a9dfd93c..4b8012c6 100644 --- a/app/src/main/java/com/keylesspalace/tusky/adapter/MutesAdapter.java +++ b/app/src/main/java/com/keylesspalace/tusky/adapter/MutesAdapter.java @@ -68,10 +68,10 @@ public class MutesAdapter extends AccountAdapter { MutedUserViewHolder(View itemView) { super(itemView); - avatar = (CircularImageView) itemView.findViewById(R.id.muted_user_avatar); - username = (TextView) itemView.findViewById(R.id.muted_user_username); - displayName = (TextView) itemView.findViewById(R.id.muted_user_display_name); - unmute = (ImageButton) itemView.findViewById(R.id.muted_user_unmute); + avatar = itemView.findViewById(R.id.muted_user_avatar); + username = itemView.findViewById(R.id.muted_user_username); + displayName = itemView.findViewById(R.id.muted_user_display_name); + unmute = itemView.findViewById(R.id.muted_user_unmute); } void setupWithAccount(Account account) { diff --git a/app/src/main/java/com/keylesspalace/tusky/adapter/NotificationsAdapter.java b/app/src/main/java/com/keylesspalace/tusky/adapter/NotificationsAdapter.java index 1f34057f..31a77a4f 100644 --- a/app/src/main/java/com/keylesspalace/tusky/adapter/NotificationsAdapter.java +++ b/app/src/main/java/com/keylesspalace/tusky/adapter/NotificationsAdapter.java @@ -200,10 +200,10 @@ public class NotificationsAdapter extends RecyclerView.Adapter { FollowViewHolder(View itemView) { super(itemView); - message = (TextView) itemView.findViewById(R.id.notification_text); - usernameView = (TextView) itemView.findViewById(R.id.notification_username); - displayNameView = (TextView) itemView.findViewById(R.id.notification_display_name); - avatar = (ImageView) itemView.findViewById(R.id.notification_avatar); + message = itemView.findViewById(R.id.notification_text); + usernameView = itemView.findViewById(R.id.notification_username); + displayNameView = itemView.findViewById(R.id.notification_display_name); + avatar = itemView.findViewById(R.id.notification_avatar); } void setMessage(String displayName, String username, String avatarUrl) { @@ -247,13 +247,12 @@ public class NotificationsAdapter extends RecyclerView.Adapter { StatusNotificationViewHolder(View itemView) { super(itemView); - message = (TextView) itemView.findViewById(R.id.notification_text); - icon = (ImageView) itemView.findViewById(R.id.notification_icon); - statusContent = (TextView) itemView.findViewById(R.id.notification_content); - container = (ViewGroup) itemView.findViewById(R.id.notification_container); - statusAvatar = (ImageView) itemView.findViewById(R.id.notification_status_avatar); - notificationAvatar = (ImageView) - itemView.findViewById(R.id.notification_notification_avatar); + message = itemView.findViewById(R.id.notification_text); + icon = itemView.findViewById(R.id.notification_icon); + statusContent = itemView.findViewById(R.id.notification_content); + container = itemView.findViewById(R.id.notification_container); + statusAvatar = itemView.findViewById(R.id.notification_status_avatar); + notificationAvatar = itemView.findViewById(R.id.notification_notification_avatar); int darkerFilter = Color.rgb(123, 123, 123); statusAvatar.setColorFilter(darkerFilter, PorterDuff.Mode.MULTIPLY); notificationAvatar.setColorFilter(darkerFilter, PorterDuff.Mode.MULTIPLY); diff --git a/app/src/main/java/com/keylesspalace/tusky/adapter/ReportAdapter.java b/app/src/main/java/com/keylesspalace/tusky/adapter/ReportAdapter.java index 50e07369..4602ee33 100644 --- a/app/src/main/java/com/keylesspalace/tusky/adapter/ReportAdapter.java +++ b/app/src/main/java/com/keylesspalace/tusky/adapter/ReportAdapter.java @@ -120,8 +120,8 @@ public class ReportAdapter extends RecyclerView.Adapter { ReportStatusViewHolder(View view) { super(view); - content = (TextView) view.findViewById(R.id.report_status_content); - checkBox = (CheckBox) view.findViewById(R.id.report_status_check_box); + content = view.findViewById(R.id.report_status_content); + checkBox = view.findViewById(R.id.report_status_check_box); } void setupWithStatus(final ReportStatus status) { diff --git a/app/src/main/java/com/keylesspalace/tusky/adapter/SavedTootAdapter.java b/app/src/main/java/com/keylesspalace/tusky/adapter/SavedTootAdapter.java index 12a55467..9e439b3e 100644 --- a/app/src/main/java/com/keylesspalace/tusky/adapter/SavedTootAdapter.java +++ b/app/src/main/java/com/keylesspalace/tusky/adapter/SavedTootAdapter.java @@ -80,7 +80,7 @@ public class SavedTootAdapter extends RecyclerView.Adapter { return toot; } - public TootEntity getItem(int position) { + private TootEntity getItem(int position) { if (position >= 0 && position < list.size()) { return list.get(position); } @@ -111,8 +111,8 @@ public class SavedTootAdapter extends RecyclerView.Adapter { TootViewHolder(View view) { super(view); this.view = view; - this.content = (TextView) view.findViewById(R.id.content); - this.suppr = (ImageButton) view.findViewById(R.id.suppr); + this.content = view.findViewById(R.id.content); + this.suppr = view.findViewById(R.id.suppr); } void bind(final int position, final TootEntity item) { diff --git a/app/src/main/java/com/keylesspalace/tusky/adapter/SearchResultsAdapter.java b/app/src/main/java/com/keylesspalace/tusky/adapter/SearchResultsAdapter.java index 25f44e18..eb7baea2 100644 --- a/app/src/main/java/com/keylesspalace/tusky/adapter/SearchResultsAdapter.java +++ b/app/src/main/java/com/keylesspalace/tusky/adapter/SearchResultsAdapter.java @@ -109,7 +109,7 @@ public class SearchResultsAdapter extends RecyclerView.Adapter { HashtagViewHolder(View itemView) { super(itemView); - hashtag = (TextView) itemView.findViewById(R.id.hashtag); + hashtag = itemView.findViewById(R.id.hashtag); } void setup(final String tag, final LinkListener listener) { diff --git a/app/src/main/java/com/keylesspalace/tusky/adapter/StatusBaseViewHolder.java b/app/src/main/java/com/keylesspalace/tusky/adapter/StatusBaseViewHolder.java index b0c992fc..7962a506 100644 --- a/app/src/main/java/com/keylesspalace/tusky/adapter/StatusBaseViewHolder.java +++ b/app/src/main/java/com/keylesspalace/tusky/adapter/StatusBaseViewHolder.java @@ -60,30 +60,30 @@ class StatusBaseViewHolder extends RecyclerView.ViewHolder { StatusBaseViewHolder(View itemView) { super(itemView); container = itemView.findViewById(R.id.status_container); - displayName = (TextView) itemView.findViewById(R.id.status_display_name); - username = (TextView) itemView.findViewById(R.id.status_username); - timestamp = (TextView) itemView.findViewById(R.id.status_timestamp); - content = (TextView) itemView.findViewById(R.id.status_content); - avatar = (ImageView) itemView.findViewById(R.id.status_avatar); - replyButton = (ImageButton) itemView.findViewById(R.id.status_reply); - reblogButton = (SparkButton) itemView.findViewById(R.id.status_reblog); - favouriteButton = (SparkButton) itemView.findViewById(R.id.status_favourite); - moreButton = (ImageButton) itemView.findViewById(R.id.status_more); + displayName = itemView.findViewById(R.id.status_display_name); + username = itemView.findViewById(R.id.status_username); + timestamp = itemView.findViewById(R.id.status_timestamp); + content = itemView.findViewById(R.id.status_content); + avatar = itemView.findViewById(R.id.status_avatar); + replyButton = itemView.findViewById(R.id.status_reply); + reblogButton = itemView.findViewById(R.id.status_reblog); + favouriteButton = itemView.findViewById(R.id.status_favourite); + moreButton = itemView.findViewById(R.id.status_more); reblogged = false; favourited = false; - mediaPreview0 = (ImageView) itemView.findViewById(R.id.status_media_preview_0); - mediaPreview1 = (ImageView) itemView.findViewById(R.id.status_media_preview_1); - mediaPreview2 = (ImageView) itemView.findViewById(R.id.status_media_preview_2); - mediaPreview3 = (ImageView) itemView.findViewById(R.id.status_media_preview_3); + mediaPreview0 = itemView.findViewById(R.id.status_media_preview_0); + mediaPreview1 = itemView.findViewById(R.id.status_media_preview_1); + mediaPreview2 = itemView.findViewById(R.id.status_media_preview_2); + mediaPreview3 = itemView.findViewById(R.id.status_media_preview_3); sensitiveMediaWarning = itemView.findViewById(R.id.status_sensitive_media_warning); sensitiveMediaShow = itemView.findViewById(R.id.status_sensitive_media_button); videoIndicator = itemView.findViewById(R.id.status_video_indicator); - mediaLabel = (TextView) itemView.findViewById(R.id.status_media_label); + mediaLabel = itemView.findViewById(R.id.status_media_label); contentWarningBar = itemView.findViewById(R.id.status_content_warning_bar); contentWarningDescription = - (TextView) itemView.findViewById(R.id.status_content_warning_description); + itemView.findViewById(R.id.status_content_warning_description); contentWarningButton = - (ToggleButton) itemView.findViewById(R.id.status_content_warning_button); + itemView.findViewById(R.id.status_content_warning_button); } private void setDisplayName(String name) { diff --git a/app/src/main/java/com/keylesspalace/tusky/adapter/StatusDetailedViewHolder.java b/app/src/main/java/com/keylesspalace/tusky/adapter/StatusDetailedViewHolder.java index 457cc1a2..d264361a 100644 --- a/app/src/main/java/com/keylesspalace/tusky/adapter/StatusDetailedViewHolder.java +++ b/app/src/main/java/com/keylesspalace/tusky/adapter/StatusDetailedViewHolder.java @@ -26,9 +26,9 @@ class StatusDetailedViewHolder extends StatusBaseViewHolder { StatusDetailedViewHolder(View view) { super(view); - reblogs = (TextView) view.findViewById(R.id.status_reblogs); - favourites = (TextView) view.findViewById(R.id.status_favourites); - application = (TextView) view.findViewById(R.id.status_application); + reblogs = view.findViewById(R.id.status_reblogs); + favourites = view.findViewById(R.id.status_favourites); + application = view.findViewById(R.id.status_application); } @Override diff --git a/app/src/main/java/com/keylesspalace/tusky/adapter/StatusViewHolder.java b/app/src/main/java/com/keylesspalace/tusky/adapter/StatusViewHolder.java index 4a2ca4c5..7992eeb5 100644 --- a/app/src/main/java/com/keylesspalace/tusky/adapter/StatusViewHolder.java +++ b/app/src/main/java/com/keylesspalace/tusky/adapter/StatusViewHolder.java @@ -36,9 +36,9 @@ public class StatusViewHolder extends StatusBaseViewHolder { StatusViewHolder(View itemView) { super(itemView); - avatarReblog = (ImageView) itemView.findViewById(R.id.status_avatar_reblog); + avatarReblog = itemView.findViewById(R.id.status_avatar_reblog); rebloggedBar = itemView.findViewById(R.id.status_reblogged_bar); - rebloggedByDisplayName = (TextView) itemView.findViewById(R.id.status_reblogged); + rebloggedByDisplayName = itemView.findViewById(R.id.status_reblogged); } @Override diff --git a/app/src/main/java/com/keylesspalace/tusky/fragment/AccountListFragment.java b/app/src/main/java/com/keylesspalace/tusky/fragment/AccountListFragment.java index a3f81c0d..a428e028 100644 --- a/app/src/main/java/com/keylesspalace/tusky/fragment/AccountListFragment.java +++ b/app/src/main/java/com/keylesspalace/tusky/fragment/AccountListFragment.java @@ -117,7 +117,7 @@ public class AccountListFragment extends BaseFragment implements AccountActionLi View rootView = inflater.inflate(R.layout.fragment_account_list, container, false); Context context = getContext(); - recyclerView = (RecyclerView) rootView.findViewById(R.id.recycler_view); + recyclerView = rootView.findViewById(R.id.recycler_view); recyclerView.setHasFixedSize(true); layoutManager = new LinearLayoutManager(context); recyclerView.setLayoutManager(layoutManager); @@ -153,7 +153,7 @@ public class AccountListFragment extends BaseFragment implements AccountActionLi BaseActivity activity = (BaseActivity) getActivity(); if (jumpToTopAllowed()) { - TabLayout layout = (TabLayout) activity.findViewById(R.id.tab_layout); + TabLayout layout = activity.findViewById(R.id.tab_layout); onTabSelectedListener = new TabLayout.OnTabSelectedListener() { @Override public void onTabSelected(TabLayout.Tab tab) {} @@ -226,7 +226,7 @@ public class AccountListFragment extends BaseFragment implements AccountActionLi @Override public void onDestroyView() { if (jumpToTopAllowed()) { - TabLayout tabLayout = (TabLayout) getActivity().findViewById(R.id.tab_layout); + TabLayout tabLayout = getActivity().findViewById(R.id.tab_layout); tabLayout.removeOnTabSelectedListener(onTabSelectedListener); } super.onDestroyView(); diff --git a/app/src/main/java/com/keylesspalace/tusky/fragment/ComposeOptionsFragment.java b/app/src/main/java/com/keylesspalace/tusky/fragment/ComposeOptionsFragment.java index 42ee7a7b..2c2f28b1 100644 --- a/app/src/main/java/com/keylesspalace/tusky/fragment/ComposeOptionsFragment.java +++ b/app/src/main/java/com/keylesspalace/tusky/fragment/ComposeOptionsFragment.java @@ -71,7 +71,7 @@ public class ComposeOptionsFragment extends BottomSheetDialogFragment { String statusVisibility = arguments.getString("visibility"); boolean statusHideText = arguments.getBoolean("hideText"); - radio = (RadioGroup) rootView.findViewById(R.id.radio_visibility); + radio = rootView.findViewById(R.id.radio_visibility); int radioCheckedId = R.id.radio_public; if (statusVisibility != null) { switch (statusVisibility) { @@ -83,16 +83,16 @@ public class ComposeOptionsFragment extends BottomSheetDialogFragment { } radio.check(radioCheckedId); - RadioButton publicButton = (RadioButton) rootView.findViewById(R.id.radio_public); - RadioButton unlistedButton = (RadioButton) rootView.findViewById(R.id.radio_unlisted); - RadioButton privateButton = (RadioButton) rootView.findViewById(R.id.radio_private); - RadioButton directButton = (RadioButton) rootView.findViewById(R.id.radio_direct); + RadioButton publicButton = rootView.findViewById(R.id.radio_public); + RadioButton unlistedButton = rootView.findViewById(R.id.radio_unlisted); + RadioButton privateButton = rootView.findViewById(R.id.radio_private); + RadioButton directButton = rootView.findViewById(R.id.radio_direct); setRadioButtonDrawable(getContext(), publicButton, R.drawable.ic_public_24dp); setRadioButtonDrawable(getContext(), unlistedButton, R.drawable.ic_lock_open_24dp); setRadioButtonDrawable(getContext(), privateButton, R.drawable.ic_lock_outline_24dp); setRadioButtonDrawable(getContext(), directButton, R.drawable.ic_email_24dp); - hideText = (CheckBox) rootView.findViewById(R.id.compose_hide_text); + hideText = rootView.findViewById(R.id.compose_hide_text); hideText.setChecked(statusHideText); return rootView; diff --git a/app/src/main/java/com/keylesspalace/tusky/fragment/NotificationsFragment.java b/app/src/main/java/com/keylesspalace/tusky/fragment/NotificationsFragment.java index f4de5665..bc9f1db1 100644 --- a/app/src/main/java/com/keylesspalace/tusky/fragment/NotificationsFragment.java +++ b/app/src/main/java/com/keylesspalace/tusky/fragment/NotificationsFragment.java @@ -109,10 +109,10 @@ public class NotificationsFragment extends SFragment implements // Setup the SwipeRefreshLayout. Context context = getContext(); - swipeRefreshLayout = (SwipeRefreshLayout) rootView.findViewById(R.id.swipe_refresh_layout); + swipeRefreshLayout = rootView.findViewById(R.id.swipe_refresh_layout); swipeRefreshLayout.setOnRefreshListener(this); // Setup the RecyclerView. - recyclerView = (RecyclerView) rootView.findViewById(R.id.recycler_view); + recyclerView = rootView.findViewById(R.id.recycler_view); recyclerView.setHasFixedSize(true); layoutManager = new LinearLayoutManager(context); recyclerView.setLayoutManager(layoutManager); @@ -152,7 +152,7 @@ public class NotificationsFragment extends SFragment implements MainActivity activity = (MainActivity) getActivity(); // MainActivity's layout is guaranteed to be inflated until onCreate returns. - TabLayout layout = (TabLayout) activity.findViewById(R.id.tab_layout); + TabLayout layout = activity.findViewById(R.id.tab_layout); onTabSelectedListener = new TabLayout.OnTabSelectedListener() { @Override public void onTabSelected(TabLayout.Tab tab) { @@ -208,7 +208,7 @@ public class NotificationsFragment extends SFragment implements @Override public void onDestroyView() { - TabLayout tabLayout = (TabLayout) getActivity().findViewById(R.id.tab_layout); + TabLayout tabLayout = getActivity().findViewById(R.id.tab_layout); tabLayout.removeOnTabSelectedListener(onTabSelectedListener); LocalBroadcastManager.getInstance(getContext()) diff --git a/app/src/main/java/com/keylesspalace/tusky/fragment/TimelineFragment.java b/app/src/main/java/com/keylesspalace/tusky/fragment/TimelineFragment.java index 723fa0ef..d5d6da60 100644 --- a/app/src/main/java/com/keylesspalace/tusky/fragment/TimelineFragment.java +++ b/app/src/main/java/com/keylesspalace/tusky/fragment/TimelineFragment.java @@ -134,10 +134,10 @@ public class TimelineFragment extends SFragment implements // Setup the SwipeRefreshLayout. Context context = getContext(); - swipeRefreshLayout = (SwipeRefreshLayout) rootView.findViewById(R.id.swipe_refresh_layout); + swipeRefreshLayout = rootView.findViewById(R.id.swipe_refresh_layout); swipeRefreshLayout.setOnRefreshListener(this); // Setup the RecyclerView. - recyclerView = (RecyclerView) rootView.findViewById(R.id.recycler_view); + recyclerView = rootView.findViewById(R.id.recycler_view); recyclerView.setHasFixedSize(true); layoutManager = new LinearLayoutManager(context); recyclerView.setLayoutManager(layoutManager); @@ -175,7 +175,7 @@ public class TimelineFragment extends SFragment implements super.onActivityCreated(savedInstanceState); if (jumpToTopAllowed()) { - TabLayout layout = (TabLayout) getActivity().findViewById(R.id.tab_layout); + TabLayout layout = getActivity().findViewById(R.id.tab_layout); onTabSelectedListener = new TabLayout.OnTabSelectedListener() { @Override public void onTabSelected(TabLayout.Tab tab) { @@ -241,7 +241,7 @@ public class TimelineFragment extends SFragment implements @Override public void onDestroyView() { if (jumpToTopAllowed()) { - TabLayout tabLayout = (TabLayout) getActivity().findViewById(R.id.tab_layout); + TabLayout tabLayout = getActivity().findViewById(R.id.tab_layout); tabLayout.removeOnTabSelectedListener(onTabSelectedListener); } LocalBroadcastManager.getInstance(getContext()).unregisterReceiver(timelineReceiver); diff --git a/app/src/main/java/com/keylesspalace/tusky/fragment/ViewMediaFragment.java b/app/src/main/java/com/keylesspalace/tusky/fragment/ViewMediaFragment.java index d92b3337..6fc6f036 100644 --- a/app/src/main/java/com/keylesspalace/tusky/fragment/ViewMediaFragment.java +++ b/app/src/main/java/com/keylesspalace/tusky/fragment/ViewMediaFragment.java @@ -42,8 +42,8 @@ public class ViewMediaFragment extends BaseFragment { private PhotoViewAttacher attacher; private PhotoActionsListener photoActionsListener; - View rootView; - PhotoView photoView; + private View rootView; + private PhotoView photoView; private static final String ARG_START_POSTPONED_TRANSITION = "startPostponedTransition"; @@ -67,7 +67,7 @@ public class ViewMediaFragment extends BaseFragment { public View onCreateView(LayoutInflater inflater, final ViewGroup container, Bundle savedInstanceState) { rootView = inflater.inflate(R.layout.fragment_view_media, container, false); - photoView = (PhotoView) rootView.findViewById(R.id.view_media_image); + photoView = rootView.findViewById(R.id.view_media_image); final Bundle arguments = getArguments(); final String url = arguments.getString("url"); diff --git a/app/src/main/java/com/keylesspalace/tusky/fragment/ViewThreadFragment.java b/app/src/main/java/com/keylesspalace/tusky/fragment/ViewThreadFragment.java index 83dc6504..5501c882 100644 --- a/app/src/main/java/com/keylesspalace/tusky/fragment/ViewThreadFragment.java +++ b/app/src/main/java/com/keylesspalace/tusky/fragment/ViewThreadFragment.java @@ -64,7 +64,7 @@ public class ViewThreadFragment extends SFragment implements private String thisThreadsStatusId; private TimelineReceiver timelineReceiver; - int statusIndex = 0; + private int statusIndex = 0; private final PairedList statuses = new PairedList<>(ViewDataUtils.statusMapper()); @@ -84,10 +84,10 @@ public class ViewThreadFragment extends SFragment implements View rootView = inflater.inflate(R.layout.fragment_view_thread, container, false); Context context = getContext(); - swipeRefreshLayout = (SwipeRefreshLayout) rootView.findViewById(R.id.swipe_refresh_layout); + swipeRefreshLayout = rootView.findViewById(R.id.swipe_refresh_layout); swipeRefreshLayout.setOnRefreshListener(this); - recyclerView = (RecyclerView) rootView.findViewById(R.id.recycler_view); + recyclerView = rootView.findViewById(R.id.recycler_view); recyclerView.setHasFixedSize(true); LinearLayoutManager layoutManager = new LinearLayoutManager(context); recyclerView.setLayoutManager(layoutManager); @@ -335,7 +335,7 @@ public class ViewThreadFragment extends SFragment implements } } - public int setStatus(Status status) { + private int setStatus(Status status) { if (statuses.size() > 0 && statusIndex < statuses.size() && statuses.get(statusIndex).equals(status)) { @@ -350,7 +350,7 @@ public class ViewThreadFragment extends SFragment implements return i; } - public void setContext(List ancestors, List descendants) { + private void setContext(List ancestors, List descendants) { Status mainStatus = null; // In case of refresh, remove old ancestors and descendants first. We'll remove all blindly, diff --git a/app/src/main/java/com/keylesspalace/tusky/interfaces/StatusActionListener.java b/app/src/main/java/com/keylesspalace/tusky/interfaces/StatusActionListener.java index fc6a7dcb..47b27d52 100644 --- a/app/src/main/java/com/keylesspalace/tusky/interfaces/StatusActionListener.java +++ b/app/src/main/java/com/keylesspalace/tusky/interfaces/StatusActionListener.java @@ -17,7 +17,6 @@ package com.keylesspalace.tusky.interfaces; import android.view.View; -import com.keylesspalace.tusky.adapter.StatusViewHolder; import com.keylesspalace.tusky.entity.Status; public interface StatusActionListener extends LinkListener { diff --git a/app/src/main/java/com/keylesspalace/tusky/pager/AccountPagerAdapter.java b/app/src/main/java/com/keylesspalace/tusky/pager/AccountPagerAdapter.java index ddc87252..0929c167 100644 --- a/app/src/main/java/com/keylesspalace/tusky/pager/AccountPagerAdapter.java +++ b/app/src/main/java/com/keylesspalace/tusky/pager/AccountPagerAdapter.java @@ -73,7 +73,7 @@ public class AccountPagerAdapter extends FragmentPagerAdapter { public View getTabView(int position, ViewGroup root) { View view = LayoutInflater.from(context).inflate(R.layout.tab_account, root, false); - TextView title = (TextView) view.findViewById(R.id.title); + TextView title = view.findViewById(R.id.title); title.setText(pageTitles[position]); return view; } diff --git a/app/src/main/java/com/keylesspalace/tusky/pager/ImagePagerAdapter.java b/app/src/main/java/com/keylesspalace/tusky/pager/ImagePagerAdapter.java index 9f9511cb..274f04ec 100644 --- a/app/src/main/java/com/keylesspalace/tusky/pager/ImagePagerAdapter.java +++ b/app/src/main/java/com/keylesspalace/tusky/pager/ImagePagerAdapter.java @@ -10,13 +10,11 @@ import java.util.Locale; public class ImagePagerAdapter extends FragmentPagerAdapter { private String[] urls; - private FragmentManager fragmentManager; private int initialPosition; public ImagePagerAdapter(FragmentManager fragmentManager, String[] urls, int initialPosition) { super(fragmentManager); this.urls = urls; - this.fragmentManager = fragmentManager; this.initialPosition = initialPosition; } diff --git a/app/src/main/java/com/keylesspalace/tusky/util/CustomTabsHelper.java b/app/src/main/java/com/keylesspalace/tusky/util/CustomTabsHelper.java index f5add047..0e494ff0 100644 --- a/app/src/main/java/com/keylesspalace/tusky/util/CustomTabsHelper.java +++ b/app/src/main/java/com/keylesspalace/tusky/util/CustomTabsHelper.java @@ -17,10 +17,10 @@ import java.util.List; public class CustomTabsHelper { private static final String TAG = "CustomTabsHelper"; - static final String STABLE_PACKAGE = "com.android.chrome"; - static final String BETA_PACKAGE = "com.chrome.beta"; - static final String DEV_PACKAGE = "com.chrome.dev"; - static final String LOCAL_PACKAGE = "com.google.android.apps.chrome"; + private static final String STABLE_PACKAGE = "com.android.chrome"; + private static final String BETA_PACKAGE = "com.chrome.beta"; + private static final String DEV_PACKAGE = "com.chrome.dev"; + private static final String LOCAL_PACKAGE = "com.google.android.apps.chrome"; private static final String EXTRA_CUSTOM_TABS_KEEP_ALIVE = "android.support.customtabs.extra.KEEP_ALIVE"; private static final String ACTION_CUSTOM_TABS_CONNECTION = diff --git a/app/src/main/java/com/keylesspalace/tusky/util/ParserUtils.java b/app/src/main/java/com/keylesspalace/tusky/util/ParserUtils.java index b0072ee9..60dee7db 100644 --- a/app/src/main/java/com/keylesspalace/tusky/util/ParserUtils.java +++ b/app/src/main/java/com/keylesspalace/tusky/util/ParserUtils.java @@ -30,7 +30,7 @@ public class ParserUtils { } // ComposeActivity : EditText inside the onTextChanged - public String getPastedURLText(Context context) { + public void getPastedURLText(Context context) { ClipboardManager clipboard = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE); String pasteData; if (clipboard.hasPrimaryClip()) { @@ -47,7 +47,6 @@ public class ParserUtils { } } } - return null; } public void putInClipboardManager(Context context, String string) { diff --git a/app/src/main/java/com/keylesspalace/tusky/view/EditTextTyped.java b/app/src/main/java/com/keylesspalace/tusky/view/EditTextTyped.java index 0cf73eef..a6ad6be7 100644 --- a/app/src/main/java/com/keylesspalace/tusky/view/EditTextTyped.java +++ b/app/src/main/java/com/keylesspalace/tusky/view/EditTextTyped.java @@ -27,8 +27,8 @@ import com.keylesspalace.tusky.util.Assert; public class EditTextTyped extends AppCompatMultiAutoCompleteTextView { - InputConnectionCompat.OnCommitContentListener onCommitContentListener; - String[] mimeTypes; + private InputConnectionCompat.OnCommitContentListener onCommitContentListener; + private String[] mimeTypes; private OnPasteListener onPasteListener; public EditTextTyped(Context context) { diff --git a/app/src/main/res/anim/zoom_in.xml b/app/src/main/res/anim/zoom_in.xml deleted file mode 100644 index e607a315..00000000 --- a/app/src/main/res/anim/zoom_in.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/anim/zoom_out.xml b/app/src/main/res/anim/zoom_out.xml deleted file mode 100644 index ab81c679..00000000 --- a/app/src/main/res/anim/zoom_out.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_block_24dp.xml b/app/src/main/res/drawable/ic_block_24dp.xml deleted file mode 100644 index 7a184d9d..00000000 --- a/app/src/main/res/drawable/ic_block_24dp.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_camera_24dp.xml b/app/src/main/res/drawable/ic_camera_24dp.xml deleted file mode 100644 index dfccca42..00000000 --- a/app/src/main/res/drawable/ic_camera_24dp.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - diff --git a/app/src/main/res/drawable/ic_settings_24dp.xml b/app/src/main/res/drawable/ic_settings_24dp.xml deleted file mode 100644 index 4c81fb46..00000000 --- a/app/src/main/res/drawable/ic_settings_24dp.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_visibility_24dp.xml b/app/src/main/res/drawable/ic_visibility_24dp.xml deleted file mode 100644 index bf3a04cb..00000000 --- a/app/src/main/res/drawable/ic_visibility_24dp.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/layout/fragment_view_gif.xml b/app/src/main/res/layout/fragment_view_gif.xml deleted file mode 100644 index 3a783484..00000000 --- a/app/src/main/res/layout/fragment_view_gif.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/item_account.xml b/app/src/main/res/layout/item_account.xml index 4df215b9..c08b9e7f 100644 --- a/app/src/main/res/layout/item_account.xml +++ b/app/src/main/res/layout/item_account.xml @@ -1,48 +1,49 @@ + android:paddingLeft="16dp" + android:paddingRight="16dp"> + android:layout_toRightOf="@id/account_avatar" + android:gravity="center_vertical" + android:orientation="vertical"> - - + + + android:textSize="14sp" + tools:text="\@username" /> diff --git a/app/src/main/res/layout/item_status_notification.xml b/app/src/main/res/layout/item_status_notification.xml index 7e4997cc..dd7dd707 100644 --- a/app/src/main/res/layout/item_status_notification.xml +++ b/app/src/main/res/layout/item_status_notification.xml @@ -1,14 +1,13 @@ - - + + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:id="@+id/notification_container" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical" + android:paddingLeft="16dp" + android:paddingRight="16dp"> + app:srcCompat="@drawable/ic_repeat_24dp" /> + android:textColor="?android:textColorSecondary" + tools:text="Someone favourited your status" /> @@ -52,7 +51,7 @@ android:paddingRight="0dp" android:paddingStart="58dp" android:textColor="?android:textColorTertiary" - tools:text="Example status here"/> + tools:text="Example status here" /> + tools:src="@drawable/avatar_default" /> + tools:visibility="visible" /> \ No newline at end of file