diff --git a/Clover/app/src/main/java/org/floens/chan/ui/activity/StartActivity.java b/Clover/app/src/main/java/org/floens/chan/ui/activity/StartActivity.java index d8cf8e44..6ebd4a9d 100644 --- a/Clover/app/src/main/java/org/floens/chan/ui/activity/StartActivity.java +++ b/Clover/app/src/main/java/org/floens/chan/ui/activity/StartActivity.java @@ -113,7 +113,7 @@ public class StartActivity extends AppCompatActivity implements NfcAdapter.Creat runtimePermissionsHelper = new RuntimePermissionsHelper(this); versionHandler = new VersionHandler(this, runtimePermissionsHelper); - contentView = (ViewGroup) findViewById(android.R.id.content); + contentView = findViewById(android.R.id.content); // Setup base controllers, and decide if to use the split layout for tablets drawerController = new DrawerController(this); diff --git a/Clover/app/src/main/java/org/floens/chan/ui/adapter/DrawerAdapter.java b/Clover/app/src/main/java/org/floens/chan/ui/adapter/DrawerAdapter.java index f112e4da..af9052d9 100644 --- a/Clover/app/src/main/java/org/floens/chan/ui/adapter/DrawerAdapter.java +++ b/Clover/app/src/main/java/org/floens/chan/ui/adapter/DrawerAdapter.java @@ -307,11 +307,11 @@ public class DrawerAdapter extends RecyclerView.Adapter private PinViewHolder(View itemView) { super(itemView); - image = (ThumbnailView) itemView.findViewById(R.id.thumb); + image = itemView.findViewById(R.id.thumb); image.setCircular(true); - textView = (TextView) itemView.findViewById(R.id.text); + textView = itemView.findViewById(R.id.text); textView.setTypeface(ROBOTO_MEDIUM); - watchCountText = (TextView) itemView.findViewById(R.id.watch_count); + watchCountText = itemView.findViewById(R.id.watch_count); watchCountText.setTypeface(ROBOTO_MEDIUM); setRoundItemBackground(watchCountText); @@ -357,9 +357,9 @@ public class DrawerAdapter extends RecyclerView.Adapter private HeaderHolder(View itemView) { super(itemView); - text = (TextView) itemView.findViewById(R.id.text); + text = itemView.findViewById(R.id.text); text.setTypeface(ROBOTO_MEDIUM); - clear = (ImageView) itemView.findViewById(R.id.clear); + clear = itemView.findViewById(R.id.clear); setRoundItemBackground(clear); clear.setOnClickListener(new View.OnClickListener() { @Override @@ -374,7 +374,7 @@ public class DrawerAdapter extends RecyclerView.Adapter return true; } }); - settings = (ImageView) itemView.findViewById(R.id.settings); + settings = itemView.findViewById(R.id.settings); setRoundItemBackground(settings); settings.setOnClickListener(new View.OnClickListener() { @Override @@ -391,8 +391,8 @@ public class DrawerAdapter extends RecyclerView.Adapter private LinkHolder(View itemView) { super(itemView); - image = (ImageView) itemView.findViewById(R.id.image); - text = (TextView) itemView.findViewById(R.id.text); + image = itemView.findViewById(R.id.image); + text = itemView.findViewById(R.id.text); text.setTypeface(ROBOTO_MEDIUM); itemView.setOnClickListener(new View.OnClickListener() { @@ -416,7 +416,7 @@ public class DrawerAdapter extends RecyclerView.Adapter private BoardInputHolder(View itemView) { super(itemView); - input = (EditText) itemView.findViewById(R.id.input); + input = itemView.findViewById(R.id.input); } } diff --git a/Clover/app/src/main/java/org/floens/chan/ui/adapter/FilesAdapter.java b/Clover/app/src/main/java/org/floens/chan/ui/adapter/FilesAdapter.java index 2d1de87e..9d4695ed 100644 --- a/Clover/app/src/main/java/org/floens/chan/ui/adapter/FilesAdapter.java +++ b/Clover/app/src/main/java/org/floens/chan/ui/adapter/FilesAdapter.java @@ -127,8 +127,8 @@ public class FilesAdapter extends RecyclerView.Adapter public FileViewHolder(View itemView) { super(itemView); - image = (ImageView) itemView.findViewById(R.id.image); - text = (TextView) itemView.findViewById(R.id.text); + image = itemView.findViewById(R.id.image); + text = itemView.findViewById(R.id.text); itemView.setOnClickListener(this); } diff --git a/Clover/app/src/main/java/org/floens/chan/ui/captcha/LegacyCaptchaLayout.java b/Clover/app/src/main/java/org/floens/chan/ui/captcha/LegacyCaptchaLayout.java index 393125c5..cfc308dd 100644 --- a/Clover/app/src/main/java/org/floens/chan/ui/captcha/LegacyCaptchaLayout.java +++ b/Clover/app/src/main/java/org/floens/chan/ui/captcha/LegacyCaptchaLayout.java @@ -73,10 +73,10 @@ public class LegacyCaptchaLayout extends LinearLayout implements AuthenticationL protected void onFinishInflate() { super.onFinishInflate(); - image = (FixedRatioThumbnailView) findViewById(R.id.image); + image = findViewById(R.id.image); image.setRatio(300f / 57f); image.setOnClickListener(this); - input = (EditText) findViewById(R.id.input); + input = findViewById(R.id.input); input.setOnEditorActionListener(new TextView.OnEditorActionListener() { @Override public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { @@ -88,7 +88,7 @@ public class LegacyCaptchaLayout extends LinearLayout implements AuthenticationL return false; } }); - submit = (ImageView) findViewById(R.id.submit); + submit = findViewById(R.id.submit); theme().sendDrawable.apply(submit); setRoundItemBackground(submit); submit.setOnClickListener(this); diff --git a/Clover/app/src/main/java/org/floens/chan/ui/cell/AlbumViewCell.java b/Clover/app/src/main/java/org/floens/chan/ui/cell/AlbumViewCell.java index f7d6eb35..af61511c 100644 --- a/Clover/app/src/main/java/org/floens/chan/ui/cell/AlbumViewCell.java +++ b/Clover/app/src/main/java/org/floens/chan/ui/cell/AlbumViewCell.java @@ -52,8 +52,8 @@ public class AlbumViewCell extends FrameLayout { @Override protected void onFinishInflate() { super.onFinishInflate(); - thumbnailView = (PostImageThumbnailView) findViewById(R.id.thumbnail_view); - text = (TextView) findViewById(R.id.text); + thumbnailView = findViewById(R.id.thumbnail_view); + text = findViewById(R.id.text); } public void setPostImage(PostImage postImage) { diff --git a/Clover/app/src/main/java/org/floens/chan/ui/cell/CardPostCell.java b/Clover/app/src/main/java/org/floens/chan/ui/cell/CardPostCell.java index 8d2ddebd..4ea3c67f 100644 --- a/Clover/app/src/main/java/org/floens/chan/ui/cell/CardPostCell.java +++ b/Clover/app/src/main/java/org/floens/chan/ui/cell/CardPostCell.java @@ -76,15 +76,15 @@ public class CardPostCell extends CardView implements PostCellInterface, View.On protected void onFinishInflate() { super.onFinishInflate(); - content = (FixedRatioLinearLayout) findViewById(R.id.card_content); + content = findViewById(R.id.card_content); content.setRatio(9f / 16f); - thumbnailView = (PostImageThumbnailView) findViewById(R.id.thumbnail); + thumbnailView = findViewById(R.id.thumbnail); thumbnailView.setRatio(16f / 9f); thumbnailView.setOnClickListener(this); - title = (TextView) findViewById(R.id.title); - comment = (FastTextView) findViewById(R.id.comment); - replies = (TextView) findViewById(R.id.replies); - options = (ImageView) findViewById(R.id.options); + title = findViewById(R.id.title); + comment = findViewById(R.id.comment); + replies = findViewById(R.id.replies); + options = findViewById(R.id.options); setRoundItemBackground(options); filterMatchColor = findViewById(R.id.filter_match_color); diff --git a/Clover/app/src/main/java/org/floens/chan/ui/cell/PostStubCell.java b/Clover/app/src/main/java/org/floens/chan/ui/cell/PostStubCell.java index 12de32d8..d33db648 100644 --- a/Clover/app/src/main/java/org/floens/chan/ui/cell/PostStubCell.java +++ b/Clover/app/src/main/java/org/floens/chan/ui/cell/PostStubCell.java @@ -72,8 +72,8 @@ public class PostStubCell extends RelativeLayout implements PostCellInterface, V protected void onFinishInflate() { super.onFinishInflate(); - title = (TextView) findViewById(R.id.title); - options = (ImageView) findViewById(R.id.options); + title = findViewById(R.id.title); + options = findViewById(R.id.options); setRoundItemBackground(options); divider = findViewById(R.id.divider); diff --git a/Clover/app/src/main/java/org/floens/chan/ui/cell/ThreadStatusCell.java b/Clover/app/src/main/java/org/floens/chan/ui/cell/ThreadStatusCell.java index 6ec8309b..f6ec7234 100644 --- a/Clover/app/src/main/java/org/floens/chan/ui/cell/ThreadStatusCell.java +++ b/Clover/app/src/main/java/org/floens/chan/ui/cell/ThreadStatusCell.java @@ -70,7 +70,7 @@ public class ThreadStatusCell extends LinearLayout implements View.OnClickListen @Override protected void onFinishInflate() { super.onFinishInflate(); - text = (TextView) findViewById(R.id.text); + text = findViewById(R.id.text); text.setTypeface(ROBOTO_MEDIUM); setOnClickListener(this); diff --git a/Clover/app/src/main/java/org/floens/chan/ui/controller/AdvancedSettingsController.java b/Clover/app/src/main/java/org/floens/chan/ui/controller/AdvancedSettingsController.java index 7ebd2373..d2fa8ecb 100644 --- a/Clover/app/src/main/java/org/floens/chan/ui/controller/AdvancedSettingsController.java +++ b/Clover/app/src/main/java/org/floens/chan/ui/controller/AdvancedSettingsController.java @@ -53,7 +53,7 @@ public class AdvancedSettingsController extends SettingsController { navigation.setTitle(R.string.settings_screen_advanced); view = inflateRes(R.layout.settings_layout); - content = (LinearLayout) view.findViewById(R.id.scrollview_content); + content = view.findViewById(R.id.scrollview_content); populatePreferences(); diff --git a/Clover/app/src/main/java/org/floens/chan/ui/controller/AlbumDownloadController.java b/Clover/app/src/main/java/org/floens/chan/ui/controller/AlbumDownloadController.java index 5c998e99..a2ff2709 100644 --- a/Clover/app/src/main/java/org/floens/chan/ui/controller/AlbumDownloadController.java +++ b/Clover/app/src/main/java/org/floens/chan/ui/controller/AlbumDownloadController.java @@ -82,10 +82,10 @@ public class AlbumDownloadController extends Controller implements ToolbarMenuIt navigation.menu = new ToolbarMenu(context); navigation.menu.addItem(new ToolbarMenuItem(context, this, CHECK_ALL, R.drawable.ic_select_all_white_24dp)); - download = (FloatingActionButton) view.findViewById(R.id.download); + download = view.findViewById(R.id.download); download.setOnClickListener(this); theme().applyFabColor(download); - recyclerView = (GridRecyclerView) view.findViewById(R.id.recycler_view); + recyclerView = view.findViewById(R.id.recycler_view); recyclerView.setHasFixedSize(true); gridLayoutManager = new GridLayoutManager(context, 3); recyclerView.setLayoutManager(gridLayoutManager); @@ -233,8 +233,8 @@ public class AlbumDownloadController extends Controller implements ToolbarMenuIt public AlbumDownloadCell(View itemView) { super(itemView); itemView.getLayoutParams().height = recyclerView.getRealSpanWidth(); - checkbox = (ImageView) itemView.findViewById(R.id.checkbox); - thumbnailView = (PostImageThumbnailView) itemView.findViewById(R.id.thumbnail_view); + checkbox = itemView.findViewById(R.id.checkbox); + thumbnailView = itemView.findViewById(R.id.thumbnail_view); itemView.setOnClickListener(this); } diff --git a/Clover/app/src/main/java/org/floens/chan/ui/controller/AlbumViewController.java b/Clover/app/src/main/java/org/floens/chan/ui/controller/AlbumViewController.java index 2943ad2f..09fff978 100644 --- a/Clover/app/src/main/java/org/floens/chan/ui/controller/AlbumViewController.java +++ b/Clover/app/src/main/java/org/floens/chan/ui/controller/AlbumViewController.java @@ -68,7 +68,7 @@ public class AlbumViewController extends Controller implements ImageViewerContro items.add(new FloatingMenuItem(SAVE_ALBUM_ID, R.string.action_download_album)); navigation.createOverflow(context, this, items); - recyclerView = (GridRecyclerView) view.findViewById(R.id.recycler_view); + recyclerView = view.findViewById(R.id.recycler_view); recyclerView.setHasFixedSize(true); gridLayoutManager = new GridLayoutManager(context, 3); recyclerView.setLayoutManager(gridLayoutManager); @@ -199,7 +199,7 @@ public class AlbumViewController extends Controller implements ImageViewerContro public AlbumItemCellHolder(View itemView) { super(itemView); cell = (AlbumViewCell) itemView; - thumbnailView = (PostImageThumbnailView) itemView.findViewById(R.id.thumbnail_view); + thumbnailView = itemView.findViewById(R.id.thumbnail_view); thumbnailView.setOnClickListener(this); } diff --git a/Clover/app/src/main/java/org/floens/chan/ui/controller/DrawerController.java b/Clover/app/src/main/java/org/floens/chan/ui/controller/DrawerController.java index 512518a7..9307ecc2 100644 --- a/Clover/app/src/main/java/org/floens/chan/ui/controller/DrawerController.java +++ b/Clover/app/src/main/java/org/floens/chan/ui/controller/DrawerController.java @@ -78,16 +78,16 @@ public class DrawerController extends Controller implements DrawerAdapter.Callba EventBus.getDefault().register(this); view = inflateRes(R.layout.controller_navigation_drawer); - container = (FrameLayout) view.findViewById(R.id.container); - drawerLayout = (DrawerLayout) view.findViewById(R.id.drawer_layout); + container = view.findViewById(R.id.container); + drawerLayout = view.findViewById(R.id.drawer_layout); drawerLayout.setDrawerShadow(R.drawable.drawer_shadow, Gravity.LEFT); - drawer = (LinearLayout) view.findViewById(R.id.drawer); - recyclerView = (RecyclerView) view.findViewById(R.id.drawer_recycler_view); + drawer = view.findViewById(R.id.drawer); + recyclerView = view.findViewById(R.id.drawer_recycler_view); recyclerView.setHasFixedSize(true); recyclerView.setLayoutManager(new LinearLayoutManager(context)); - settings = (LinearLayout) view.findViewById(R.id.settings); + settings = view.findViewById(R.id.settings); settings.setOnClickListener(this); - theme().settingsDrawable.apply((ImageView) settings.findViewById(R.id.image)); + theme().settingsDrawable.apply(settings.findViewById(R.id.image)); ((TextView) settings.findViewById(R.id.text)).setTypeface(ROBOTO_MEDIUM); drawerAdapter = new DrawerAdapter(this); diff --git a/Clover/app/src/main/java/org/floens/chan/ui/controller/FiltersController.java b/Clover/app/src/main/java/org/floens/chan/ui/controller/FiltersController.java index 77e481c7..c2d14914 100644 --- a/Clover/app/src/main/java/org/floens/chan/ui/controller/FiltersController.java +++ b/Clover/app/src/main/java/org/floens/chan/ui/controller/FiltersController.java @@ -114,11 +114,11 @@ public class FiltersController extends Controller implements ToolbarMenuItem.Too view = inflateRes(R.layout.controller_filters); - recyclerView = (RecyclerView) view.findViewById(R.id.recycler_view); + recyclerView = view.findViewById(R.id.recycler_view); recyclerView.setHasFixedSize(true); recyclerView.setLayoutManager(new LinearLayoutManager(context)); - add = (FloatingActionButton) view.findViewById(R.id.add); + add = view.findViewById(R.id.add); add.setOnClickListener(this); theme().applyFabColor(add); @@ -272,9 +272,9 @@ public class FiltersController extends Controller implements ToolbarMenuItem.Too public FilterCell(View itemView) { super(itemView); - text = (TextView) itemView.findViewById(R.id.text); - subtext = (TextView) itemView.findViewById(R.id.subtext); - delete = (ImageView) itemView.findViewById(R.id.delete); + text = itemView.findViewById(R.id.text); + subtext = itemView.findViewById(R.id.subtext); + delete = itemView.findViewById(R.id.delete); theme().clearDrawable.apply(delete); diff --git a/Clover/app/src/main/java/org/floens/chan/ui/controller/HistoryController.java b/Clover/app/src/main/java/org/floens/chan/ui/controller/HistoryController.java index 1c771c76..801bfdf0 100644 --- a/Clover/app/src/main/java/org/floens/chan/ui/controller/HistoryController.java +++ b/Clover/app/src/main/java/org/floens/chan/ui/controller/HistoryController.java @@ -102,8 +102,8 @@ public class HistoryController extends Controller implements CompoundButton.OnCh navigation.rightView = historyEnabledSwitch; view = inflateRes(R.layout.controller_history); - crossfade = (CrossfadeView) view.findViewById(R.id.crossfade); - recyclerView = (RecyclerView) view.findViewById(R.id.recycler_view); + crossfade = view.findViewById(R.id.crossfade); + recyclerView = view.findViewById(R.id.recycler_view); recyclerView.setHasFixedSize(true); recyclerView.setLayoutManager(new LinearLayoutManager(context)); @@ -265,11 +265,11 @@ public class HistoryController extends Controller implements CompoundButton.OnCh public HistoryCell(View itemView) { super(itemView); - thumbnail = (ThumbnailView) itemView.findViewById(R.id.thumbnail); + thumbnail = itemView.findViewById(R.id.thumbnail); thumbnail.setCircular(true); - text = (TextView) itemView.findViewById(R.id.text); - subtext = (TextView) itemView.findViewById(R.id.subtext); - delete = (ImageView) itemView.findViewById(R.id.delete); + text = itemView.findViewById(R.id.text); + subtext = itemView.findViewById(R.id.subtext); + delete = itemView.findViewById(R.id.delete); theme().clearDrawable.apply(delete); diff --git a/Clover/app/src/main/java/org/floens/chan/ui/controller/ImageViewerController.java b/Clover/app/src/main/java/org/floens/chan/ui/controller/ImageViewerController.java index 180bc70d..68684ce7 100644 --- a/Clover/app/src/main/java/org/floens/chan/ui/controller/ImageViewerController.java +++ b/Clover/app/src/main/java/org/floens/chan/ui/controller/ImageViewerController.java @@ -139,10 +139,10 @@ public class ImageViewerController extends Controller implements ImageViewerPres overflowMenuItem = navigation.createOverflow(context, this, items); view = inflateRes(R.layout.controller_image_viewer); - previewImage = (TransitionImageView) view.findViewById(R.id.preview_image); - pager = (OptionalSwipeViewPager) view.findViewById(R.id.pager); + previewImage = view.findViewById(R.id.preview_image); + pager = view.findViewById(R.id.pager); pager.addOnPageChangeListener(presenter); - loadingBar = (LoadingBar) view.findViewById(R.id.loading_bar); + loadingBar = view.findViewById(R.id.loading_bar); // Sanity check if (parentController.view.getWindowToken() == null) { @@ -317,7 +317,7 @@ public class ImageViewerController extends Controller implements ImageViewerPres } else { @SuppressLint("InflateParams") View notice = LayoutInflater.from(context).inflate(R.layout.dialog_video_error, null); - final CheckBox dontShowAgain = (CheckBox) notice.findViewById(R.id.checkbox); + final CheckBox dontShowAgain = notice.findViewById(R.id.checkbox); new AlertDialog.Builder(context) .setTitle(R.string.video_playback_warning_title) diff --git a/Clover/app/src/main/java/org/floens/chan/ui/controller/ImageViewerNavigationController.java b/Clover/app/src/main/java/org/floens/chan/ui/controller/ImageViewerNavigationController.java index 6af88890..2a2cd50b 100644 --- a/Clover/app/src/main/java/org/floens/chan/ui/controller/ImageViewerNavigationController.java +++ b/Clover/app/src/main/java/org/floens/chan/ui/controller/ImageViewerNavigationController.java @@ -43,7 +43,7 @@ public class ImageViewerNavigationController extends ToolbarNavigationController NavigationControllerContainerLayout nav = (NavigationControllerContainerLayout) container; nav.setNavigationController(this); nav.setSwipeEnabled(false); - toolbar = (Toolbar) view.findViewById(R.id.toolbar); + toolbar = view.findViewById(R.id.toolbar); toolbar.setCallback(this); } diff --git a/Clover/app/src/main/java/org/floens/chan/ui/controller/MainSettingsController.java b/Clover/app/src/main/java/org/floens/chan/ui/controller/MainSettingsController.java index e928dfdb..b4ea505c 100644 --- a/Clover/app/src/main/java/org/floens/chan/ui/controller/MainSettingsController.java +++ b/Clover/app/src/main/java/org/floens/chan/ui/controller/MainSettingsController.java @@ -24,12 +24,10 @@ import android.net.Uri; import android.text.TextUtils; import android.view.View; import android.widget.ImageView; -import android.widget.LinearLayout; import android.widget.Toast; import org.floens.chan.R; import org.floens.chan.core.database.DatabaseManager; -import org.floens.chan.core.manager.BoardManager; import org.floens.chan.core.settings.ChanSettings; import org.floens.chan.ui.activity.StartActivity; import org.floens.chan.ui.helper.HintPopup; @@ -81,9 +79,6 @@ public class MainSettingsController extends SettingsController implements Toolba @Inject DatabaseManager databaseManager; - @Inject - BoardManager boardManager; - public MainSettingsController(Context context) { super(context); } @@ -102,7 +97,7 @@ public class MainSettingsController extends SettingsController implements Toolba )); view = inflateRes(R.layout.settings_layout); - content = (LinearLayout) view.findViewById(R.id.scrollview_content); + content = view.findViewById(R.id.scrollview_content); previousLayoutMode = ChanSettings.layoutMode.get(); diff --git a/Clover/app/src/main/java/org/floens/chan/ui/controller/PopupController.java b/Clover/app/src/main/java/org/floens/chan/ui/controller/PopupController.java index 7873929b..d19f9b34 100644 --- a/Clover/app/src/main/java/org/floens/chan/ui/controller/PopupController.java +++ b/Clover/app/src/main/java/org/floens/chan/ui/controller/PopupController.java @@ -38,9 +38,9 @@ public class PopupController extends Controller implements View.OnClickListener super.onCreate(); view = inflateRes(R.layout.layout_controller_popup); - topView = (FrameLayout) view.findViewById(R.id.top_view); + topView = view.findViewById(R.id.top_view); topView.setOnClickListener(this); - container = (FrameLayout) view.findViewById(R.id.container); + container = view.findViewById(R.id.container); } public void setChildController(NavigationController childController) { diff --git a/Clover/app/src/main/java/org/floens/chan/ui/controller/PostRepliesController.java b/Clover/app/src/main/java/org/floens/chan/ui/controller/PostRepliesController.java index dcc8495e..d26e603a 100644 --- a/Clover/app/src/main/java/org/floens/chan/ui/controller/PostRepliesController.java +++ b/Clover/app/src/main/java/org/floens/chan/ui/controller/PostRepliesController.java @@ -81,7 +81,7 @@ public class PostRepliesController extends Controller { } }); - loadView = (LoadView) view.findViewById(R.id.loadview); + loadView = view.findViewById(R.id.loadview); if (Build.VERSION.SDK_INT >= 21) { statusBarColorPrevious = getWindow().getStatusBarColor(); @@ -143,7 +143,7 @@ public class PostRepliesController extends Controller { dataView = inflateRes(R.layout.layout_post_replies); } - listView = (ListView) dataView.findViewById(R.id.post_list); + listView = dataView.findViewById(R.id.post_list); listView.setDivider(null); listView.setDividerHeight(0); @@ -166,8 +166,8 @@ public class PostRepliesController extends Controller { Drawable backDrawable = theme().backDrawable.makeDrawable(context); Drawable doneDrawable = theme().doneDrawable.makeDrawable(context); - TextView repliesBackText = ((TextView) dataView.findViewById(R.id.replies_back_icon)); - TextView repliesCloseText = ((TextView) dataView.findViewById(R.id.replies_close_icon)); + TextView repliesBackText = dataView.findViewById(R.id.replies_back_icon); + TextView repliesCloseText = dataView.findViewById(R.id.replies_close_icon); repliesBackText.setCompoundDrawablesWithIntrinsicBounds(backDrawable, null, null, null); repliesCloseText.setCompoundDrawablesWithIntrinsicBounds(doneDrawable, null, null, null); if (theme().isLightTheme) { diff --git a/Clover/app/src/main/java/org/floens/chan/ui/controller/SaveLocationController.java b/Clover/app/src/main/java/org/floens/chan/ui/controller/SaveLocationController.java index 3b7f9deb..70e48c4e 100644 --- a/Clover/app/src/main/java/org/floens/chan/ui/controller/SaveLocationController.java +++ b/Clover/app/src/main/java/org/floens/chan/ui/controller/SaveLocationController.java @@ -59,9 +59,9 @@ public class SaveLocationController extends Controller implements FileWatcher.Fi navigation.setTitle(R.string.save_location_screen); view = inflateRes(R.layout.controller_save_location); - filesLayout = (FilesLayout) view.findViewById(R.id.files_layout); + filesLayout = view.findViewById(R.id.files_layout); filesLayout.setCallback(this); - setButton = (FloatingActionButton) view.findViewById(R.id.set_button); + setButton = view.findViewById(R.id.set_button); setButton.setOnClickListener(this); File saveLocation = new File(ChanSettings.saveLocation.get()); diff --git a/Clover/app/src/main/java/org/floens/chan/ui/controller/StyledToolbarNavigationController.java b/Clover/app/src/main/java/org/floens/chan/ui/controller/StyledToolbarNavigationController.java index a03ec711..21b5df69 100644 --- a/Clover/app/src/main/java/org/floens/chan/ui/controller/StyledToolbarNavigationController.java +++ b/Clover/app/src/main/java/org/floens/chan/ui/controller/StyledToolbarNavigationController.java @@ -41,7 +41,7 @@ public class StyledToolbarNavigationController extends ToolbarNavigationControll NavigationControllerContainerLayout nav = (NavigationControllerContainerLayout) container; nav.setNavigationController(this); nav.setSwipeEnabled(ChanSettings.controllerSwipeable.get()); - toolbar = (Toolbar) view.findViewById(R.id.toolbar); + toolbar = view.findViewById(R.id.toolbar); toolbar.setBackgroundColor(ThemeHelper.getInstance().getTheme().primaryColor.color); toolbar.setCallback(this); } diff --git a/Clover/app/src/main/java/org/floens/chan/ui/controller/ThemeSettingsController.java b/Clover/app/src/main/java/org/floens/chan/ui/controller/ThemeSettingsController.java index 1aa5987d..82695d50 100644 --- a/Clover/app/src/main/java/org/floens/chan/ui/controller/ThemeSettingsController.java +++ b/Clover/app/src/main/java/org/floens/chan/ui/controller/ThemeSettingsController.java @@ -153,11 +153,11 @@ public class ThemeSettingsController extends Controller implements View.OnClickL themeHelper = ThemeHelper.getInstance(); themes = themeHelper.getThemes(); - pager = (ViewPager) view.findViewById(R.id.pager); - done = (FloatingActionButton) view.findViewById(R.id.add); + pager = view.findViewById(R.id.pager); + done = view.findViewById(R.id.add); done.setOnClickListener(this); - textView = (TextView) view.findViewById(R.id.text); + textView = view.findViewById(R.id.text); SpannableString changeAccentColor = new SpannableString(getString(R.string.setting_theme_accent)); changeAccentColor.setSpan(new ClickableSpan() { diff --git a/Clover/app/src/main/java/org/floens/chan/ui/controller/ThreadSlideController.java b/Clover/app/src/main/java/org/floens/chan/ui/controller/ThreadSlideController.java index 3fffbd91..f2bd515b 100644 --- a/Clover/app/src/main/java/org/floens/chan/ui/controller/ThreadSlideController.java +++ b/Clover/app/src/main/java/org/floens/chan/ui/controller/ThreadSlideController.java @@ -61,7 +61,7 @@ public class ThreadSlideController extends Controller implements DoubleNavigatio view = inflateRes(R.layout.controller_thread_slide); - slidingPaneLayout = (ThreadSlidingPaneLayout) view.findViewById(R.id.sliding_pane_layout); + slidingPaneLayout = view.findViewById(R.id.sliding_pane_layout); slidingPaneLayout.setThreadSlideController(this); slidingPaneLayout.setPanelSlideListener(this); slidingPaneLayout.setParallaxDistance(dp(100)); diff --git a/Clover/app/src/main/java/org/floens/chan/ui/controller/WatchSettingsController.java b/Clover/app/src/main/java/org/floens/chan/ui/controller/WatchSettingsController.java index c16a6cc7..b9bc0b01 100644 --- a/Clover/app/src/main/java/org/floens/chan/ui/controller/WatchSettingsController.java +++ b/Clover/app/src/main/java/org/floens/chan/ui/controller/WatchSettingsController.java @@ -55,8 +55,8 @@ public class WatchSettingsController extends SettingsController implements Compo navigation.setTitle(R.string.settings_screen_watch); view = inflateRes(R.layout.controller_watch); - content = (LinearLayout) view.findViewById(R.id.scrollview_content); - crossfadeView = (CrossfadeView) view.findViewById(R.id.crossfade); + content = view.findViewById(R.id.scrollview_content); + crossfadeView = view.findViewById(R.id.crossfade); crossfadeView.toggle(enabled, false); diff --git a/Clover/app/src/main/java/org/floens/chan/ui/layout/BoardAddLayout.java b/Clover/app/src/main/java/org/floens/chan/ui/layout/BoardAddLayout.java index c73ac3f3..d2ac8385 100644 --- a/Clover/app/src/main/java/org/floens/chan/ui/layout/BoardAddLayout.java +++ b/Clover/app/src/main/java/org/floens/chan/ui/layout/BoardAddLayout.java @@ -66,7 +66,7 @@ public class BoardAddLayout extends LinearLayout implements SearchLayout.SearchL // View binding search = findViewById(R.id.search); suggestionsRecycler = findViewById(R.id.suggestions); - checkAllButton = (Button) findViewById(R.id.select_all); + checkAllButton = findViewById(R.id.select_all); // Adapters suggestionsAdapter = new SuggestionsAdapter(); diff --git a/Clover/app/src/main/java/org/floens/chan/ui/layout/FilesLayout.java b/Clover/app/src/main/java/org/floens/chan/ui/layout/FilesLayout.java index 52a39471..33c89d9b 100644 --- a/Clover/app/src/main/java/org/floens/chan/ui/layout/FilesLayout.java +++ b/Clover/app/src/main/java/org/floens/chan/ui/layout/FilesLayout.java @@ -69,11 +69,11 @@ public class FilesLayout extends LinearLayout implements FilesAdapter.Callback, @Override protected void onFinishInflate() { super.onFinishInflate(); - backLayout = (ViewGroup) findViewById(R.id.back_layout); - backImage = (ImageView) backLayout.findViewById(R.id.back_image); + backLayout = findViewById(R.id.back_layout); + backImage = backLayout.findViewById(R.id.back_image); backImage.setImageDrawable(DrawableCompat.wrap(backImage.getDrawable())); - backText = (TextView) backLayout.findViewById(R.id.back_text); - recyclerView = (RecyclerView) findViewById(R.id.recycler); + backText = backLayout.findViewById(R.id.back_text); + recyclerView = findViewById(R.id.recycler); backLayout.setOnClickListener(this); } diff --git a/Clover/app/src/main/java/org/floens/chan/ui/layout/FilterLayout.java b/Clover/app/src/main/java/org/floens/chan/ui/layout/FilterLayout.java index 8ee3dbce..7af21f53 100644 --- a/Clover/app/src/main/java/org/floens/chan/ui/layout/FilterLayout.java +++ b/Clover/app/src/main/java/org/floens/chan/ui/layout/FilterLayout.java @@ -104,10 +104,10 @@ public class FilterLayout extends LinearLayout implements View.OnClickListener { super.onFinishInflate(); inject(this); - typeText = (TextView) findViewById(R.id.type); - boardsSelector = (TextView) findViewById(R.id.boards); - actionText = (TextView) findViewById(R.id.action); - pattern = (TextView) findViewById(R.id.pattern); + typeText = findViewById(R.id.type); + boardsSelector = findViewById(R.id.boards); + actionText = findViewById(R.id.action); + pattern = findViewById(R.id.pattern); pattern.addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { @@ -124,7 +124,7 @@ public class FilterLayout extends LinearLayout implements View.OnClickListener { public void afterTextChanged(Editable s) { } }); - patternPreview = (TextView) findViewById(R.id.pattern_preview); + patternPreview = findViewById(R.id.pattern_preview); patternPreview.addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { @@ -139,12 +139,12 @@ public class FilterLayout extends LinearLayout implements View.OnClickListener { public void afterTextChanged(Editable s) { } }); - patternPreviewStatus = (TextView) findViewById(R.id.pattern_preview_status); - enabled = (CheckBox) findViewById(R.id.enabled); - help = (ImageView) findViewById(R.id.help); + patternPreviewStatus = findViewById(R.id.pattern_preview_status); + enabled = findViewById(R.id.enabled); + help = findViewById(R.id.help); theme().helpDrawable.apply(help); help.setOnClickListener(this); - colorContainer = (LinearLayout) findViewById(R.id.color_container); + colorContainer = findViewById(R.id.color_container); colorContainer.setOnClickListener(this); colorPreview = findViewById(R.id.color_preview); diff --git a/Clover/app/src/main/java/org/floens/chan/ui/layout/SelectLayout.java b/Clover/app/src/main/java/org/floens/chan/ui/layout/SelectLayout.java index ecb03616..043b8ec9 100644 --- a/Clover/app/src/main/java/org/floens/chan/ui/layout/SelectLayout.java +++ b/Clover/app/src/main/java/org/floens/chan/ui/layout/SelectLayout.java @@ -70,17 +70,17 @@ public class SelectLayout extends LinearLayout implements SearchLayout.Search protected void onFinishInflate() { super.onFinishInflate(); - searchLayout = (SearchLayout) findViewById(R.id.search_layout); + searchLayout = findViewById(R.id.search_layout); searchLayout.setCallback(this); searchLayout.setHint(getString(R.string.search_hint)); searchLayout.setTextColor(getAttrColor(getContext(), R.attr.text_color_primary)); searchLayout.setHintColor(getAttrColor(getContext(), R.attr.text_color_hint)); searchLayout.setClearButtonImage(R.drawable.ic_clear_black_24dp); - checkAllButton = (Button) findViewById(R.id.select_all); + checkAllButton = findViewById(R.id.select_all); checkAllButton.setOnClickListener(this); - recyclerView = (RecyclerView) findViewById(R.id.recycler_view); + recyclerView = findViewById(R.id.recycler_view); recyclerView.setHasFixedSize(true); recyclerView.setLayoutManager(new LinearLayoutManager(getContext())); } @@ -213,9 +213,9 @@ public class SelectLayout extends LinearLayout implements SearchLayout.Search public BoardSelectViewHolder(View itemView) { super(itemView); - checkBox = (CheckBox) itemView.findViewById(R.id.checkbox); - text = (TextView) itemView.findViewById(R.id.text); - description = (TextView) itemView.findViewById(R.id.description); + checkBox = itemView.findViewById(R.id.checkbox); + text = itemView.findViewById(R.id.text); + description = itemView.findViewById(R.id.description); checkBox.setOnCheckedChangeListener(this); diff --git a/Clover/app/src/main/java/org/floens/chan/ui/layout/ThreadSlidingPaneLayout.java b/Clover/app/src/main/java/org/floens/chan/ui/layout/ThreadSlidingPaneLayout.java index 00ab2c09..e487823d 100644 --- a/Clover/app/src/main/java/org/floens/chan/ui/layout/ThreadSlidingPaneLayout.java +++ b/Clover/app/src/main/java/org/floens/chan/ui/layout/ThreadSlidingPaneLayout.java @@ -51,8 +51,8 @@ public class ThreadSlidingPaneLayout extends SlidingPaneLayout { @Override protected void onFinishInflate() { super.onFinishInflate(); - leftPane = (ViewGroup) findViewById(R.id.left_pane); - rightPane = (ViewGroup) findViewById(R.id.right_pane); + leftPane = findViewById(R.id.left_pane); + rightPane = findViewById(R.id.right_pane); } @Override diff --git a/Clover/app/src/main/java/org/floens/chan/ui/settings/BooleanSettingView.java b/Clover/app/src/main/java/org/floens/chan/ui/settings/BooleanSettingView.java index 4ef76075..0931e0e6 100644 --- a/Clover/app/src/main/java/org/floens/chan/ui/settings/BooleanSettingView.java +++ b/Clover/app/src/main/java/org/floens/chan/ui/settings/BooleanSettingView.java @@ -46,7 +46,7 @@ public class BooleanSettingView extends SettingView implements View.OnClickListe view.setOnClickListener(this); - switcher = (SwitchCompat) view.findViewById(R.id.switcher); + switcher = view.findViewById(R.id.switcher); switcher.setOnCheckedChangeListener(this); switcher.setChecked(setting.get()); diff --git a/Clover/app/src/main/java/org/floens/chan/ui/settings/SettingsController.java b/Clover/app/src/main/java/org/floens/chan/ui/settings/SettingsController.java index 012c5564..1fef6eef 100644 --- a/Clover/app/src/main/java/org/floens/chan/ui/settings/SettingsController.java +++ b/Clover/app/src/main/java/org/floens/chan/ui/settings/SettingsController.java @@ -156,7 +156,7 @@ public class SettingsController extends Controller implements AndroidUtils.OnMea private void setDescriptionText(View view, String topText, String bottomText) { ((TextView) view.findViewById(R.id.top)).setText(topText); - final TextView bottom = ((TextView) view.findViewById(R.id.bottom)); + final TextView bottom = view.findViewById(R.id.bottom); if (bottom != null) { bottom.setText(bottomText); bottom.setVisibility(bottomText == null ? View.GONE : View.VISIBLE); diff --git a/Clover/app/src/main/java/org/floens/chan/ui/toolbar/Toolbar.java b/Clover/app/src/main/java/org/floens/chan/ui/toolbar/Toolbar.java index 8f0badc0..987b5400 100644 --- a/Clover/app/src/main/java/org/floens/chan/ui/toolbar/Toolbar.java +++ b/Clover/app/src/main/java/org/floens/chan/ui/toolbar/Toolbar.java @@ -284,13 +284,13 @@ public class Toolbar extends LinearLayout implements View.OnClickListener { public void updateTitle(NavigationItem navigationItem) { LinearLayout view = navigationItem == fromItem ? fromView : (navigationItem == toItem ? toView : null); if (view != null) { - TextView titleView = (TextView) view.findViewById(R.id.title); + TextView titleView = view.findViewById(R.id.title); if (titleView != null) { titleView.setText(navigationItem.title); } if (!TextUtils.isEmpty(navigationItem.subtitle)) { - TextView subtitleView = (TextView) view.findViewById(R.id.subtitle); + TextView subtitleView = view.findViewById(R.id.subtitle); if (subtitleView != null) { subtitleView.setText(navigationItem.subtitle); } @@ -470,9 +470,9 @@ public class Toolbar extends LinearLayout implements View.OnClickListener { LinearLayout menu = (LinearLayout) LayoutInflater.from(getContext()).inflate(R.layout.toolbar_menu, null); menu.setGravity(Gravity.CENTER_VERTICAL); - FrameLayout titleContainer = (FrameLayout) menu.findViewById(R.id.title_container); + FrameLayout titleContainer = menu.findViewById(R.id.title_container); - final TextView titleView = (TextView) menu.findViewById(R.id.title); + final TextView titleView = menu.findViewById(R.id.title); titleView.setTypeface(AndroidUtils.ROBOTO_MEDIUM); titleView.setText(item.title); titleView.setTextColor(0xffffffff); @@ -491,7 +491,7 @@ public class Toolbar extends LinearLayout implements View.OnClickListener { }); } - TextView subtitleView = (TextView) menu.findViewById(R.id.subtitle); + TextView subtitleView = menu.findViewById(R.id.subtitle); if (!TextUtils.isEmpty(item.subtitle)) { ViewGroup.LayoutParams titleParams = titleView.getLayoutParams(); titleParams.height = ViewGroup.LayoutParams.WRAP_CONTENT;