cleanup code, remove some unneeded files

This commit is contained in:
Conny Duck 2017-10-18 00:20:26 +02:00
parent 07edebdfcf
commit f2f3be37b3
47 changed files with 189 additions and 286 deletions

View File

@ -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) {

View File

@ -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) {

View File

@ -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);

View File

@ -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);

View File

@ -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) {

View File

@ -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());
}
});

View File

@ -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

View File

@ -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;

View File

@ -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<Void, Void, List<TootEntity>>() {
@Override
protected List<TootEntity> doInBackground(Void... params) {

View File

@ -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);

View File

@ -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.

View File

@ -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();

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {

View File

@ -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);

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {

View File

@ -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

View File

@ -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

View File

@ -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();

View File

@ -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;

View File

@ -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())

View File

@ -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);

View File

@ -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");

View File

@ -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<Status, StatusViewData> 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<Status> ancestors, List<Status> descendants) {
private void setContext(List<Status> ancestors, List<Status> descendants) {
Status mainStatus = null;
// In case of refresh, remove old ancestors and descendants first. We'll remove all blindly,

View File

@ -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 {

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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 =

View File

@ -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) {

View File

@ -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) {

View File

@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<scale
android:interpolator="@android:anim/linear_interpolator"
android:fromXScale=".1"
android:toXScale="1"
android:fromYScale=".1"
android:toYScale="1"
android:pivotX="50%"
android:pivotY="50%"
android:duration="200"
android:fillAfter="true">
</scale>
<alpha
android:interpolator="@android:anim/linear_interpolator"
android:fromAlpha="0"
android:toAlpha="1"
android:duration="300" />
</set>

View File

@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<scale
android:interpolator="@android:anim/linear_interpolator"
android:fromXScale="1"
android:toXScale=".1"
android:fromYScale="1"
android:toYScale=".1"
android:pivotX="50%"
android:pivotY="50%"
android:duration="200"
android:fillAfter="true">
</scale>
<alpha
android:interpolator="@android:anim/linear_interpolator"
android:fromAlpha="1"
android:toAlpha="0"
android:duration="300" />
</set>

View File

@ -1,9 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="@color/toolbar_icon_dark"
android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM4,12c0,-4.42 3.58,-8 8,-8 1.85,0 3.55,0.63 4.9,1.69L5.69,16.9C4.63,15.55 4,13.85 4,12zM12,20c-1.85,0 -3.55,-0.63 -4.9,-1.69L18.31,7.1C19.37,8.45 20,10.15 20,12c0,4.42 -3.58,8 -8,8z"/>
</vector>

View File

@ -1,12 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="@color/toolbar_icon_dark"
android:pathData="M12,12m-3.2,0a3.2,3.2 0,1 1,6.4 0a3.2,3.2 0,1 1,-6.4 0"/>
<path
android:fillColor="@color/toolbar_icon_dark"
android:pathData="M9,2L7.17,4L4,4c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2L22,6c0,-1.1 -0.9,-2 -2,-2h-3.17L15,2L9,2zM12,17c-2.76,0 -5,-2.24 -5,-5s2.24,-5 5,-5 5,2.24 5,5 -2.24,5 -5,5z"/>
</vector>

View File

@ -1,9 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="@color/toolbar_icon_dark"
android:pathData="M19.43,12.98c0.04,-0.32 0.07,-0.64 0.07,-0.98s-0.03,-0.66 -0.07,-0.98l2.11,-1.65c0.19,-0.15 0.24,-0.42 0.12,-0.64l-2,-3.46c-0.12,-0.22 -0.39,-0.3 -0.61,-0.22l-2.49,1c-0.52,-0.4 -1.08,-0.73 -1.69,-0.98l-0.38,-2.65C14.46,2.18 14.25,2 14,2h-4c-0.25,0 -0.46,0.18 -0.49,0.42l-0.38,2.65c-0.61,0.25 -1.17,0.59 -1.69,0.98l-2.49,-1c-0.23,-0.09 -0.49,0 -0.61,0.22l-2,3.46c-0.13,0.22 -0.07,0.49 0.12,0.64l2.11,1.65c-0.04,0.32 -0.07,0.65 -0.07,0.98s0.03,0.66 0.07,0.98l-2.11,1.65c-0.19,0.15 -0.24,0.42 -0.12,0.64l2,3.46c0.12,0.22 0.39,0.3 0.61,0.22l2.49,-1c0.52,0.4 1.08,0.73 1.69,0.98l0.38,2.65c0.03,0.24 0.24,0.42 0.49,0.42h4c0.25,0 0.46,-0.18 0.49,-0.42l0.38,-2.65c0.61,-0.25 1.17,-0.59 1.69,-0.98l2.49,1c0.23,0.09 0.49,0 0.61,-0.22l2,-3.46c0.12,-0.22 0.07,-0.49 -0.12,-0.64l-2.11,-1.65zM12,15.5c-1.93,0 -3.5,-1.57 -3.5,-3.5s1.57,-3.5 3.5,-3.5 3.5,1.57 3.5,3.5 -1.57,3.5 -3.5,3.5z"/>
</vector>

View File

@ -1,9 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="@color/toolbar_icon_dark"
android:pathData="M12,4.5C7,4.5 2.73,7.61 1,12c1.73,4.39 6,7.5 11,7.5s9.27,-3.11 11,-7.5c-1.73,-4.39 -6,-7.5 -11,-7.5zM12,17c-2.76,0 -5,-2.24 -5,-5s2.24,-5 5,-5 5,2.24 5,5 -2.24,5 -5,5zM12,9c-1.66,0 -3,1.34 -3,3s1.34,3 3,3 3,-1.34 3,-3 -1.34,-3 -3,-3z"/>
</vector>

View File

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#60000000">
<WebView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/gif_view"
android:layout_centerInParent="true" />
</RelativeLayout>

View File

@ -1,48 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/account_container"
android:layout_width="match_parent"
android:layout_height="72dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:gravity="center_vertical"
android:id="@+id/account_container">
android:paddingLeft="16dp"
android:paddingRight="16dp">
<com.pkmmte.view.CircularImageView
android:id="@+id/account_avatar"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_centerVertical="true"
android:id="@+id/account_avatar"
android:layout_marginEnd="24dp"
android:layout_marginRight="24dp" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center_vertical"
android:layout_toEndOf="@id/account_avatar"
android:layout_toRightOf="@id/account_avatar">
android:layout_toRightOf="@id/account_avatar"
android:gravity="center_vertical"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/account_display_name"
android:text="Display name"
android:maxLines="1"
android:ellipsize="end"
android:textSize="16sp"
android:textColor="?android:textColorPrimary"
android:textStyle="normal|bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="\@username"
android:maxLines="1"
android:ellipsize="end"
android:textSize="14sp"
android:maxLines="1"
android:textColor="?android:textColorPrimary"
android:textSize="16sp"
android:textStyle="normal|bold"
tools:text="Display name" />
<TextView
android:id="@+id/account_username"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="1"
android:textColor="?android:textColorSecondary"
android:id="@+id/account_username" />
android:textSize="14sp"
tools:text="\@username" />
</LinearLayout>

View File

@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--This applies only to favourite and reblog notifications.-->
<?xml version="1.0" encoding="utf-8"?><!--This applies only to favourite and reblog notifications.-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
@ -25,7 +24,7 @@
android:paddingLeft="24dp"
android:paddingRight="10dp"
android:paddingStart="24dp"
app:srcCompat="@drawable/ic_repeat_24dp"/>
app:srcCompat="@drawable/ic_repeat_24dp" />
<TextView
android:id="@+id/notification_text"
@ -36,8 +35,8 @@
android:layout_toRightOf="@id/notification_icon"
android:ellipsize="end"
android:maxLines="1"
android:text="Someone favourited your status"
android:textColor="?android:textColorSecondary"/>
android:textColor="?android:textColorSecondary"
tools:text="Someone favourited your status" />
</RelativeLayout>
@ -52,7 +51,7 @@
android:paddingRight="0dp"
android:paddingStart="58dp"
android:textColor="?android:textColorTertiary"
tools:text="Example status here"/>
tools:text="Example status here" />
<ImageView
android:id="@+id/notification_status_avatar"
@ -68,7 +67,7 @@
android:paddingRight="12dp"
android:scaleType="fitCenter"
tools:ignore="RtlHardcoded,RtlSymmetry"
tools:src="@drawable/avatar_default"/>
tools:src="@drawable/avatar_default" />
<ImageView
android:id="@+id/notification_notification_avatar"
@ -79,6 +78,6 @@
android:layout_alignRight="@id/notification_status_avatar"
android:visibility="gone"
tools:src="@color/accent"
tools:visibility="visible"/>
tools:visibility="visible" />
</RelativeLayout>