Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix lint warnings and improve code quality #1162

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
9 changes: 5 additions & 4 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
android:name="android.permission.MANAGE_EXTERNAL_STORAGE"
tools:ignore="scopedStorage" />

<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera"
android:required="false" />
<uses-feature
android:name="android.hardware.camera.autofocus"
android:required="false" />
Expand All @@ -27,7 +28,8 @@
android:requestLegacyExternalStorage="true"
android:supportsRtl="true"
android:theme="@style/AppThemeWhite"
tools:ignore="GoogleAppIndexingWarning,RtlEnabled">
tools:ignore="GoogleAppIndexingWarning,RtlEnabled"
android:dataExtractionRules="@xml/data_extraction_rules">
<activity
android:name=".activity.SplashActivity"
android:exported="true"
Expand All @@ -44,8 +46,7 @@
android:theme="@style/Base.Theme.AppCompat" />
<activity
android:name=".activity.MainActivity"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:screenOrientation="fullSensor"
android:windowSoftInputMode="adjustPan"
android:exported="false">
<intent-filter>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import android.widget.ImageView;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;

import com.google.android.material.appbar.MaterialToolbar;
Expand Down Expand Up @@ -41,7 +42,7 @@ public class CropImageActivity extends AppCompatActivity {
private CropImageView mCropImageView;

@Override
public void onCreate(Bundle savedInstanceState) {
public void onCreate(@NonNull Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_crop_image_activity);
ButterKnife.bind(this);
Expand Down Expand Up @@ -138,7 +139,7 @@ public boolean onCreateOptionsMenu(Menu menu) {
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
if (item.getItemId() == android.R.id.home) {
setResult(Activity.RESULT_CANCELED);
finish();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import android.view.Menu;
import android.view.MenuItem;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
Expand Down Expand Up @@ -65,7 +66,7 @@ public boolean onCreateOptionsMenu(Menu menu) {
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
onBackPressed();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,15 @@ public class ImageEditor extends AppCompatActivity implements OnFilterItemClicke
private boolean mDoodleSelected = false;
private PhotoEditor mPhotoEditor;

public static Intent getStartIntent(Context context, ArrayList<String> uris) {
@NonNull
public static Intent getStartIntent(@NonNull Context context, @NonNull ArrayList<String> uris) {
Intent intent = new Intent(context, ImageEditor.class);
intent.putExtra(IMAGE_EDITOR_KEY, uris);
return intent;
}

@Override
protected void onCreate(Bundle savedInstanceState) {
protected void onCreate(@NonNull Bundle savedInstanceState) {

ThemeUtils.getInstance().setThemeApp(this);

Expand Down Expand Up @@ -236,7 +237,7 @@ private void initRecyclerView() {
* @param position - position of item clicked
*/
@Override
public void onItemClick(View view, int position) {
public void onItemClick(@NonNull View view, int position) {
//setting mClicked true when none filter is selected otherwise false
mClicked = position == 0;
// Brush effect is in second position
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import android.content.Intent;
import android.os.Bundle;

import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.viewpager.widget.ViewPager;

Expand All @@ -27,14 +28,15 @@ public class ImagesPreviewActivity extends AppCompatActivity {
* @param uris - extra images uri
* @return - start intent
*/
public static Intent getStartIntent(Context context, ArrayList<String> uris) {
@NonNull
public static Intent getStartIntent(@NonNull Context context, @NonNull ArrayList<String> uris) {
Intent intent = new Intent(context, ImagesPreviewActivity.class);
intent.putExtra(PREVIEW_IMAGES, uris);
return intent;
}

@Override
protected void onCreate(Bundle savedInstanceState) {
protected void onCreate(@NonNull Bundle savedInstanceState) {
ThemeUtils.getInstance().setThemeApp(this);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_preview_images);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public class MainActivity extends AppCompatActivity
private FragmentManagement mFragmentManagement;

@Override
protected void onCreate(Bundle savedInstanceState) {
protected void onCreate(@NonNull Bundle savedInstanceState) {
ThemeUtils.getInstance().setThemeApp(this);
super.onCreate(savedInstanceState);

Expand Down Expand Up @@ -145,7 +145,7 @@ public boolean onCreateOptionsMenu(Menu menu) {
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
if (item.getItemId() == R.id.menu_favourites_item) {
setTitle(R.string.favourites);
mFragmentManagement.favouritesFragmentOption();
Expand Down Expand Up @@ -375,7 +375,7 @@ public void onNeutralButtonClick() {
*
* @param imageUris - ArrayList of image uri's in temp directory
*/
public void convertImagesToPdf(ArrayList<Uri> imageUris) {
public void convertImagesToPdf(@NonNull ArrayList<Uri> imageUris) {
Fragment fragment = new ImageToPdfFragment();
Bundle bundle = new Bundle();
bundle.putParcelableArrayList(getString(R.string.bundleKey), imageUris);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import android.content.Intent;
import android.os.Bundle;

import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
Expand Down Expand Up @@ -36,14 +37,15 @@ public class PreviewActivity extends AppCompatActivity implements PreviewImageOp
private PreviewAdapter mPreviewAdapter;
private ViewPager mViewPager;

public static Intent getStartIntent(Context context, ArrayList<String> uris) {
@NonNull
public static Intent getStartIntent(@NonNull Context context, @NonNull ArrayList<String> uris) {
Intent intent = new Intent(context, PreviewActivity.class);
intent.putExtra(PREVIEW_IMAGES, uris);
return intent;
}

@Override
protected void onCreate(Bundle savedInstanceState) {
protected void onCreate(@NonNull Bundle savedInstanceState) {

ThemeUtils.getInstance().setThemeApp(this);
super.onCreate(savedInstanceState);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import android.preference.PreferenceManager;
import android.view.MenuItem;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
Expand Down Expand Up @@ -41,7 +42,8 @@ public class RearrangeImages extends AppCompatActivity implements RearrangeImage
private RearrangeImagesAdapter mRearrangeImagesAdapter;
private SharedPreferences mSharedPreferences;

public static Intent getStartIntent(Context context, ArrayList<String> uris) {
@NonNull
public static Intent getStartIntent(@NonNull Context context, @NonNull ArrayList<String> uris) {
Intent intent = new Intent(context, RearrangeImages.class);
intent.putExtra(PREVIEW_IMAGES, uris);
return intent;
Expand Down Expand Up @@ -122,7 +124,7 @@ public void onBackPressed() {
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
if (item.getItemId() == android.R.id.home) {
passUris();
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import android.view.View;
import android.widget.Button;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
Expand All @@ -36,6 +37,7 @@

public class RearrangePdfPages extends AppCompatActivity implements RearrangePdfAdapter.OnClickListener {

@NonNull
public static ArrayList<Bitmap> mImages;
@BindView(R.id.recyclerView)
RecyclerView mRecyclerView;
Expand All @@ -45,7 +47,8 @@ public class RearrangePdfPages extends AppCompatActivity implements RearrangePdf
private SharedPreferences mSharedPreferences;
private ArrayList<Integer> mSequence, mInitialSequence;

public static Intent getStartIntent(Context context) {
@NonNull
public static Intent getStartIntent(@NonNull Context context) {
return new Intent(context, RearrangePdfPages.class);
}

Expand Down Expand Up @@ -155,7 +158,7 @@ public void onBackPressed() {
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
if (item.getItemId() == android.R.id.home) {
passUris();
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
import android.content.Intent;
import android.os.Bundle;

import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;

public class SplashActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
protected void onCreate(@NonNull Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
startActivity(new Intent(SplashActivity.this, MainActivity.class));
finish();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,13 @@

public class WelcomeActivity extends AppCompatActivity {

@NonNull
@BindView(R.id.view_pager)
public ViewPager mViewPager;
@NonNull
@BindView(R.id.layoutDots)
public LinearLayout mDotsLayout;
@NonNull
@BindView(R.id.btn_skip)
public Button mBtnSkip;

Expand All @@ -51,7 +54,7 @@ public void onPageScrollStateChanged(int arg0) {
};

@Override
protected void onCreate(Bundle savedInstanceState) {
protected void onCreate(@NonNull Bundle savedInstanceState) {
ThemeUtils.getInstance().setThemeApp(this);
super.onCreate(savedInstanceState);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ public class BrushItemAdapter extends RecyclerView.Adapter<BrushItemAdapter.Brus
private final OnItemClickListener mOnItemClickListener;
private final List<BrushItem> mBrushItems;

public BrushItemAdapter(Context context,
OnItemClickListener onItemClickListener,
List<BrushItem> brushItems) {
public BrushItemAdapter(@NonNull Context context,
@NonNull OnItemClickListener onItemClickListener,
@NonNull List<BrushItem> brushItems) {
mBrushItems = brushItems;
mOnItemClickListener = onItemClickListener;
mContext = context;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ public class EnhancementOptionsAdapter
private final OnItemClickListener mOnItemClickListener;
private final List<EnhancementOptionsEntity> mEnhancementOptionsEntityList;

public EnhancementOptionsAdapter(OnItemClickListener mOnItemClickListener,
List<EnhancementOptionsEntity> mEnhancementOptionsEntityList) {
public EnhancementOptionsAdapter(@NonNull OnItemClickListener mOnItemClickListener,
@NonNull List<EnhancementOptionsEntity> mEnhancementOptionsEntityList) {
this.mOnItemClickListener = mOnItemClickListener;
this.mEnhancementOptionsEntityList = mEnhancementOptionsEntityList;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ public class ExtractImagesAdapter extends RecyclerView.Adapter<ExtractImagesAdap
private final Activity mContext;
private final OnFileItemClickedListener mOnClickListener;

public ExtractImagesAdapter(Activity mContext, ArrayList<String> mFilePaths,
OnFileItemClickedListener mOnClickListener) {
public ExtractImagesAdapter(@NonNull Activity mContext, @NonNull ArrayList<String> mFilePaths,
@NonNull OnFileItemClickedListener mOnClickListener) {
this.mContext = mContext;
this.mFilePaths = mFilePaths;
this.mOnClickListener = mOnClickListener;
Expand Down Expand Up @@ -55,7 +55,7 @@ public int getItemCount() {
}

public interface OnFileItemClickedListener {
void onFileItemClick(String path);
void onFileItemClick(@NonNull String path);
}

public class ViewMergeFilesHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class FAQAdapter extends RecyclerView.Adapter<FAQAdapter.FAQViewHolder> {
private final List<FAQItem> mFaqs;
private final OnItemClickListener mOnItemClickListener;

public FAQAdapter(List<FAQItem> faqs, OnItemClickListener mOnItemClickListener) {
public FAQAdapter(@NonNull List<FAQItem> faqs, @NonNull OnItemClickListener mOnItemClickListener) {
this.mFaqs = faqs;
this.mOnItemClickListener = mOnItemClickListener;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ public class FilesListAdapter extends RecyclerView.Adapter<FilesListAdapter.View
private final Activity mContext;
private final OnFileItemClickedListener mOnClickListener;

public FilesListAdapter(Activity mContext, ArrayList<String> mFilePaths,
OnFileItemClickedListener mOnClickListener) {
public FilesListAdapter(@NonNull Activity mContext, @NonNull ArrayList<String> mFilePaths,
@NonNull OnFileItemClickedListener mOnClickListener) {
this.mContext = mContext;
this.mFilePaths = mFilePaths;
this.mOnClickListener = mOnClickListener;
Expand All @@ -50,7 +50,7 @@ public int getItemCount() {
}

public interface OnFileItemClickedListener {
void onFileItemClick(String path);
void onFileItemClick(@NonNull String path);
}

public class ViewMergeFilesHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class HistoryAdapter extends RecyclerView.Adapter<HistoryAdapter.ViewHist
private final OnClickListener mOnClickListener;
private final HashMap<String, Integer> mIconsOperationList;

public HistoryAdapter(Activity mActivity, List<History> mHistoryList, OnClickListener mOnClickListener) {
public HistoryAdapter(@NonNull Activity mActivity, @NonNull List<History> mHistoryList, @NonNull OnClickListener mOnClickListener) {
this.mHistoryList = mHistoryList;
this.mActivity = mActivity;
this.mOnClickListener = mOnClickListener;
Expand Down Expand Up @@ -88,7 +88,7 @@ public int getItemCount() {
}

public interface OnClickListener {
void onItemClick(String path);
void onItemClick(@NonNull String path);
}

public class ViewHistoryHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ public class ImageFiltersAdapter extends RecyclerView.Adapter<ImageFiltersAdapte
private final OnFilterItemClickedListener mOnFilterItemClickedListener;
private final Context mContext;

public ImageFiltersAdapter(ArrayList<FilterItem> filterItems, Context context,
OnFilterItemClickedListener listener) {
public ImageFiltersAdapter(@NonNull ArrayList<FilterItem> filterItems, @NonNull Context context,
@NonNull OnFilterItemClickedListener listener) {
mFilterItem = filterItems;
mContext = context;
mOnFilterItemClickedListener = listener;
Expand Down
Loading