Skip to content

Commit

Permalink
Merge pull request #1399 from RajaVamsi11/ObsoluteSDKCheck
Browse files Browse the repository at this point in the history
refactor: removed Obsolete SDK_INT Version Checks
  • Loading branch information
AbhilashG97 authored Jun 16, 2020
2 parents 9d13711 + 8d5f725 commit 3059892
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
* Created by nellyk on 1/22/2016.
*/

import android.os.Build;
import android.os.Bundle;
import androidx.fragment.app.FragmentTransaction;
import androidx.core.content.res.ResourcesCompat;
Expand Down Expand Up @@ -298,8 +297,7 @@ public void onPrepareOptionsMenu(Menu menu) {
ResourcesCompat.getDrawable(getResources(),
R.drawable.ic_add_white_24dp, null));

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB)
menuItemAddNewDocument.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
menuItemAddNewDocument.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
super.onPrepareOptionsMenu(menu);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
package com.mifos.mifosxdroid.online.collectionsheet;


import android.os.Build;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import android.util.Log;
Expand Down Expand Up @@ -125,28 +124,22 @@ public void onPrepareOptionsMenu(Menu menu) {
// mItemSearch.setIcon(new IconDrawable(getActivity(), MaterialIcons.md_search)
// .colorRes(Color.WHITE)
// .actionBarSize());
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
mItemSearch.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);
}
mItemSearch.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);


MenuItem mItemRefresh = menu.add(Menu.NONE, MENU_ITEM_REFRESH, Menu.NONE, getString(R
.string.refresh));
mItemRefresh.setIcon(new IconDrawable(getActivity(), MaterialIcons.md_refresh)
.colorRes(R.color.white)
.actionBarSize());
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
mItemRefresh.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
}
mItemRefresh.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);

MenuItem mItemSave = menu.add(Menu.NONE, MENU_ITEM_SAVE, Menu.NONE, getString(R.string
.save));
mItemSave.setIcon(new IconDrawable(getActivity(), MaterialIcons.md_save)
.colorRes(R.color.white)
.actionBarSize());
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
mItemSave.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
}
mItemSave.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);


super.onPrepareOptionsMenu(menu);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import android.content.Intent;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import androidx.annotation.NonNull;
Expand Down Expand Up @@ -342,8 +341,7 @@ public void onPrepareOptionsMenu(Menu menu) {
.setIcon(ContextCompat
.getDrawable(getActivity(), R.drawable.ic_add_white_24dp));

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB)
menuItemAddNewDocument.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
menuItemAddNewDocument.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
super.onPrepareOptionsMenu(menu);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
*/

import android.content.Context;
import android.os.Build;
import android.os.Bundle;
import androidx.fragment.app.FragmentTransaction;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
Expand Down Expand Up @@ -239,8 +238,7 @@ public void onPrepareOptionsMenu(Menu menu) {
menuItemAddNewLoanCharge.setIcon(getResources().getDrawable(R.drawable
.ic_add_white_24dp));

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB)
menuItemAddNewLoanCharge.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
menuItemAddNewLoanCharge.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
super.onPrepareOptionsMenu(menu);
}

Expand Down

0 comments on commit 3059892

Please sign in to comment.