diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 3a0477a42..d4ecac4bd 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -9,7 +9,8 @@ android:name="android.permission.MANAGE_EXTERNAL_STORAGE" tools:ignore="scopedStorage" /> - + @@ -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"> diff --git a/app/src/main/java/swati4star/createpdf/activity/CropImageActivity.java b/app/src/main/java/swati4star/createpdf/activity/CropImageActivity.java index 5728e7396..d044e2717 100644 --- a/app/src/main/java/swati4star/createpdf/activity/CropImageActivity.java +++ b/app/src/main/java/swati4star/createpdf/activity/CropImageActivity.java @@ -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; @@ -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); @@ -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(); diff --git a/app/src/main/java/swati4star/createpdf/activity/FavouritesActivity.java b/app/src/main/java/swati4star/createpdf/activity/FavouritesActivity.java index 538b835ec..4061f6367 100644 --- a/app/src/main/java/swati4star/createpdf/activity/FavouritesActivity.java +++ b/app/src/main/java/swati4star/createpdf/activity/FavouritesActivity.java @@ -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; @@ -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(); diff --git a/app/src/main/java/swati4star/createpdf/activity/ImageEditor.java b/app/src/main/java/swati4star/createpdf/activity/ImageEditor.java index 9e77f6c12..60bb9aff0 100644 --- a/app/src/main/java/swati4star/createpdf/activity/ImageEditor.java +++ b/app/src/main/java/swati4star/createpdf/activity/ImageEditor.java @@ -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 uris) { + @NonNull + public static Intent getStartIntent(@NonNull Context context, @NonNull ArrayList 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); @@ -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 diff --git a/app/src/main/java/swati4star/createpdf/activity/ImagesPreviewActivity.java b/app/src/main/java/swati4star/createpdf/activity/ImagesPreviewActivity.java index 3142dec94..31e9d65aa 100644 --- a/app/src/main/java/swati4star/createpdf/activity/ImagesPreviewActivity.java +++ b/app/src/main/java/swati4star/createpdf/activity/ImagesPreviewActivity.java @@ -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; @@ -27,14 +28,15 @@ public class ImagesPreviewActivity extends AppCompatActivity { * @param uris - extra images uri * @return - start intent */ - public static Intent getStartIntent(Context context, ArrayList uris) { + @NonNull + public static Intent getStartIntent(@NonNull Context context, @NonNull ArrayList 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); diff --git a/app/src/main/java/swati4star/createpdf/activity/MainActivity.java b/app/src/main/java/swati4star/createpdf/activity/MainActivity.java index 078bf25cc..026c15d92 100644 --- a/app/src/main/java/swati4star/createpdf/activity/MainActivity.java +++ b/app/src/main/java/swati4star/createpdf/activity/MainActivity.java @@ -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); @@ -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(); @@ -375,7 +375,7 @@ public void onNeutralButtonClick() { * * @param imageUris - ArrayList of image uri's in temp directory */ - public void convertImagesToPdf(ArrayList imageUris) { + public void convertImagesToPdf(@NonNull ArrayList imageUris) { Fragment fragment = new ImageToPdfFragment(); Bundle bundle = new Bundle(); bundle.putParcelableArrayList(getString(R.string.bundleKey), imageUris); diff --git a/app/src/main/java/swati4star/createpdf/activity/PreviewActivity.java b/app/src/main/java/swati4star/createpdf/activity/PreviewActivity.java index af8f01bfa..749917a37 100644 --- a/app/src/main/java/swati4star/createpdf/activity/PreviewActivity.java +++ b/app/src/main/java/swati4star/createpdf/activity/PreviewActivity.java @@ -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; @@ -36,14 +37,15 @@ public class PreviewActivity extends AppCompatActivity implements PreviewImageOp private PreviewAdapter mPreviewAdapter; private ViewPager mViewPager; - public static Intent getStartIntent(Context context, ArrayList uris) { + @NonNull + public static Intent getStartIntent(@NonNull Context context, @NonNull ArrayList 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); diff --git a/app/src/main/java/swati4star/createpdf/activity/RearrangeImages.java b/app/src/main/java/swati4star/createpdf/activity/RearrangeImages.java index 031fe72ca..62e2c8075 100644 --- a/app/src/main/java/swati4star/createpdf/activity/RearrangeImages.java +++ b/app/src/main/java/swati4star/createpdf/activity/RearrangeImages.java @@ -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; @@ -41,7 +42,8 @@ public class RearrangeImages extends AppCompatActivity implements RearrangeImage private RearrangeImagesAdapter mRearrangeImagesAdapter; private SharedPreferences mSharedPreferences; - public static Intent getStartIntent(Context context, ArrayList uris) { + @NonNull + public static Intent getStartIntent(@NonNull Context context, @NonNull ArrayList uris) { Intent intent = new Intent(context, RearrangeImages.class); intent.putExtra(PREVIEW_IMAGES, uris); return intent; @@ -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; diff --git a/app/src/main/java/swati4star/createpdf/activity/RearrangePdfPages.java b/app/src/main/java/swati4star/createpdf/activity/RearrangePdfPages.java index 6b2e5c2f3..8e65051c4 100644 --- a/app/src/main/java/swati4star/createpdf/activity/RearrangePdfPages.java +++ b/app/src/main/java/swati4star/createpdf/activity/RearrangePdfPages.java @@ -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; @@ -36,6 +37,7 @@ public class RearrangePdfPages extends AppCompatActivity implements RearrangePdfAdapter.OnClickListener { + @NonNull public static ArrayList mImages; @BindView(R.id.recyclerView) RecyclerView mRecyclerView; @@ -45,7 +47,8 @@ public class RearrangePdfPages extends AppCompatActivity implements RearrangePdf private SharedPreferences mSharedPreferences; private ArrayList mSequence, mInitialSequence; - public static Intent getStartIntent(Context context) { + @NonNull + public static Intent getStartIntent(@NonNull Context context) { return new Intent(context, RearrangePdfPages.class); } @@ -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; diff --git a/app/src/main/java/swati4star/createpdf/activity/SplashActivity.java b/app/src/main/java/swati4star/createpdf/activity/SplashActivity.java index 1ac03e471..5562ad79d 100644 --- a/app/src/main/java/swati4star/createpdf/activity/SplashActivity.java +++ b/app/src/main/java/swati4star/createpdf/activity/SplashActivity.java @@ -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(); diff --git a/app/src/main/java/swati4star/createpdf/activity/WelcomeActivity.java b/app/src/main/java/swati4star/createpdf/activity/WelcomeActivity.java index a2db924ac..89cfffcf7 100644 --- a/app/src/main/java/swati4star/createpdf/activity/WelcomeActivity.java +++ b/app/src/main/java/swati4star/createpdf/activity/WelcomeActivity.java @@ -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; @@ -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); diff --git a/app/src/main/java/swati4star/createpdf/adapter/BrushItemAdapter.java b/app/src/main/java/swati4star/createpdf/adapter/BrushItemAdapter.java index 2ee7dd7b7..05497c4d8 100644 --- a/app/src/main/java/swati4star/createpdf/adapter/BrushItemAdapter.java +++ b/app/src/main/java/swati4star/createpdf/adapter/BrushItemAdapter.java @@ -23,9 +23,9 @@ public class BrushItemAdapter extends RecyclerView.Adapter mBrushItems; - public BrushItemAdapter(Context context, - OnItemClickListener onItemClickListener, - List brushItems) { + public BrushItemAdapter(@NonNull Context context, + @NonNull OnItemClickListener onItemClickListener, + @NonNull List brushItems) { mBrushItems = brushItems; mOnItemClickListener = onItemClickListener; mContext = context; diff --git a/app/src/main/java/swati4star/createpdf/adapter/EnhancementOptionsAdapter.java b/app/src/main/java/swati4star/createpdf/adapter/EnhancementOptionsAdapter.java index adaf01893..5b83fbede 100644 --- a/app/src/main/java/swati4star/createpdf/adapter/EnhancementOptionsAdapter.java +++ b/app/src/main/java/swati4star/createpdf/adapter/EnhancementOptionsAdapter.java @@ -25,8 +25,8 @@ public class EnhancementOptionsAdapter private final OnItemClickListener mOnItemClickListener; private final List mEnhancementOptionsEntityList; - public EnhancementOptionsAdapter(OnItemClickListener mOnItemClickListener, - List mEnhancementOptionsEntityList) { + public EnhancementOptionsAdapter(@NonNull OnItemClickListener mOnItemClickListener, + @NonNull List mEnhancementOptionsEntityList) { this.mOnItemClickListener = mOnItemClickListener; this.mEnhancementOptionsEntityList = mEnhancementOptionsEntityList; } diff --git a/app/src/main/java/swati4star/createpdf/adapter/ExtractImagesAdapter.java b/app/src/main/java/swati4star/createpdf/adapter/ExtractImagesAdapter.java index 0088d1b35..96f2f77c6 100644 --- a/app/src/main/java/swati4star/createpdf/adapter/ExtractImagesAdapter.java +++ b/app/src/main/java/swati4star/createpdf/adapter/ExtractImagesAdapter.java @@ -26,8 +26,8 @@ public class ExtractImagesAdapter extends RecyclerView.Adapter mFilePaths, - OnFileItemClickedListener mOnClickListener) { + public ExtractImagesAdapter(@NonNull Activity mContext, @NonNull ArrayList mFilePaths, + @NonNull OnFileItemClickedListener mOnClickListener) { this.mContext = mContext; this.mFilePaths = mFilePaths; this.mOnClickListener = mOnClickListener; @@ -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 { diff --git a/app/src/main/java/swati4star/createpdf/adapter/FAQAdapter.java b/app/src/main/java/swati4star/createpdf/adapter/FAQAdapter.java index 4b866d719..0fe10780f 100644 --- a/app/src/main/java/swati4star/createpdf/adapter/FAQAdapter.java +++ b/app/src/main/java/swati4star/createpdf/adapter/FAQAdapter.java @@ -22,7 +22,7 @@ public class FAQAdapter extends RecyclerView.Adapter { private final List mFaqs; private final OnItemClickListener mOnItemClickListener; - public FAQAdapter(List faqs, OnItemClickListener mOnItemClickListener) { + public FAQAdapter(@NonNull List faqs, @NonNull OnItemClickListener mOnItemClickListener) { this.mFaqs = faqs; this.mOnItemClickListener = mOnItemClickListener; } diff --git a/app/src/main/java/swati4star/createpdf/adapter/FilesListAdapter.java b/app/src/main/java/swati4star/createpdf/adapter/FilesListAdapter.java index 3cfceee5a..22e728b71 100644 --- a/app/src/main/java/swati4star/createpdf/adapter/FilesListAdapter.java +++ b/app/src/main/java/swati4star/createpdf/adapter/FilesListAdapter.java @@ -23,8 +23,8 @@ public class FilesListAdapter extends RecyclerView.Adapter mFilePaths, - OnFileItemClickedListener mOnClickListener) { + public FilesListAdapter(@NonNull Activity mContext, @NonNull ArrayList mFilePaths, + @NonNull OnFileItemClickedListener mOnClickListener) { this.mContext = mContext; this.mFilePaths = mFilePaths; this.mOnClickListener = mOnClickListener; @@ -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 { diff --git a/app/src/main/java/swati4star/createpdf/adapter/HistoryAdapter.java b/app/src/main/java/swati4star/createpdf/adapter/HistoryAdapter.java index ec2bb2d79..5053f9332 100644 --- a/app/src/main/java/swati4star/createpdf/adapter/HistoryAdapter.java +++ b/app/src/main/java/swati4star/createpdf/adapter/HistoryAdapter.java @@ -26,7 +26,7 @@ public class HistoryAdapter extends RecyclerView.Adapter mIconsOperationList; - public HistoryAdapter(Activity mActivity, List mHistoryList, OnClickListener mOnClickListener) { + public HistoryAdapter(@NonNull Activity mActivity, @NonNull List mHistoryList, @NonNull OnClickListener mOnClickListener) { this.mHistoryList = mHistoryList; this.mActivity = mActivity; this.mOnClickListener = mOnClickListener; @@ -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 { diff --git a/app/src/main/java/swati4star/createpdf/adapter/ImageFiltersAdapter.java b/app/src/main/java/swati4star/createpdf/adapter/ImageFiltersAdapter.java index f8fb58f0a..a6e38e352 100644 --- a/app/src/main/java/swati4star/createpdf/adapter/ImageFiltersAdapter.java +++ b/app/src/main/java/swati4star/createpdf/adapter/ImageFiltersAdapter.java @@ -27,8 +27,8 @@ public class ImageFiltersAdapter extends RecyclerView.Adapter filterItems, Context context, - OnFilterItemClickedListener listener) { + public ImageFiltersAdapter(@NonNull ArrayList filterItems, @NonNull Context context, + @NonNull OnFilterItemClickedListener listener) { mFilterItem = filterItems; mContext = context; mOnFilterItemClickedListener = listener; diff --git a/app/src/main/java/swati4star/createpdf/adapter/MergeFilesAdapter.java b/app/src/main/java/swati4star/createpdf/adapter/MergeFilesAdapter.java index 273539d8a..89e053716 100644 --- a/app/src/main/java/swati4star/createpdf/adapter/MergeFilesAdapter.java +++ b/app/src/main/java/swati4star/createpdf/adapter/MergeFilesAdapter.java @@ -28,8 +28,8 @@ public class MergeFilesAdapter extends RecyclerView.Adapter mFilePaths, - boolean mIsMergeFragment, OnClickListener mOnClickListener) { + public MergeFilesAdapter(@NonNull Activity mContext, @NonNull ArrayList mFilePaths, + boolean mIsMergeFragment, @NonNull OnClickListener mOnClickListener) { this.mContext = mContext; this.mFilePaths = mFilePaths; this.mOnClickListener = mOnClickListener; @@ -59,7 +59,7 @@ public int getItemCount() { } public interface OnClickListener { - void onItemClick(String path); + void onItemClick(@NonNull String path); } public class ViewMergeFilesHolder extends RecyclerView.ViewHolder implements View.OnClickListener { diff --git a/app/src/main/java/swati4star/createpdf/adapter/MergeSelectedFilesAdapter.java b/app/src/main/java/swati4star/createpdf/adapter/MergeSelectedFilesAdapter.java index a8212bd98..03966a0a5 100644 --- a/app/src/main/java/swati4star/createpdf/adapter/MergeSelectedFilesAdapter.java +++ b/app/src/main/java/swati4star/createpdf/adapter/MergeSelectedFilesAdapter.java @@ -24,8 +24,8 @@ public class MergeSelectedFilesAdapter extends private final Activity mContext; private final OnFileItemClickListener mOnClickListener; - public MergeSelectedFilesAdapter(Activity mContext, ArrayList mFilePaths, - OnFileItemClickListener mOnClickListener) { + public MergeSelectedFilesAdapter(@NonNull Activity mContext, @NonNull ArrayList mFilePaths, + @NonNull OnFileItemClickListener mOnClickListener) { this.mContext = mContext; this.mFilePaths = mFilePaths; this.mOnClickListener = mOnClickListener; @@ -50,9 +50,9 @@ public int getItemCount() { } public interface OnFileItemClickListener { - void viewFile(String path); + void viewFile(@NonNull String path); - void removeFile(String path); + void removeFile(@NonNull String path); void moveUp(int position); diff --git a/app/src/main/java/swati4star/createpdf/adapter/PreviewAdapter.java b/app/src/main/java/swati4star/createpdf/adapter/PreviewAdapter.java index 69051703c..0260e9648 100644 --- a/app/src/main/java/swati4star/createpdf/adapter/PreviewAdapter.java +++ b/app/src/main/java/swati4star/createpdf/adapter/PreviewAdapter.java @@ -23,7 +23,7 @@ public class PreviewAdapter extends PagerAdapter { private final ArrayList mPreviewItems; private final LayoutInflater mInflater; - public PreviewAdapter(Context context, ArrayList previewItems) { + public PreviewAdapter(@NonNull Context context, @NonNull ArrayList previewItems) { mContext = context; mPreviewItems = previewItems; mInflater = LayoutInflater.from(context); @@ -59,13 +59,14 @@ public boolean isViewFromObject(@NonNull View view, @NonNull Object object) { return view == object; } + @NonNull @Override public CharSequence getPageTitle(int position) { return String.format(mContext.getResources().getString(R.string.showing_image), position + 1, mPreviewItems.size()); } - public void setData(ArrayList images) { + public void setData(@NonNull ArrayList images) { mPreviewItems.clear(); mPreviewItems.addAll(images); } diff --git a/app/src/main/java/swati4star/createpdf/adapter/PreviewImageOptionsAdapter.java b/app/src/main/java/swati4star/createpdf/adapter/PreviewImageOptionsAdapter.java index 1619a3738..3407f4990 100644 --- a/app/src/main/java/swati4star/createpdf/adapter/PreviewImageOptionsAdapter.java +++ b/app/src/main/java/swati4star/createpdf/adapter/PreviewImageOptionsAdapter.java @@ -21,8 +21,8 @@ public class PreviewImageOptionsAdapter extends RecyclerView.Adapter optionItems, Context context) { + public PreviewImageOptionsAdapter(@NonNull OnItemClickListener onItemClickListener, + @NonNull ArrayList optionItems, @NonNull Context context) { mOnItemClickListener = onItemClickListener; mOptions = optionItems; mContext = context; diff --git a/app/src/main/java/swati4star/createpdf/adapter/RearrangeImagesAdapter.java b/app/src/main/java/swati4star/createpdf/adapter/RearrangeImagesAdapter.java index 0d06eb509..2fe34ec02 100644 --- a/app/src/main/java/swati4star/createpdf/adapter/RearrangeImagesAdapter.java +++ b/app/src/main/java/swati4star/createpdf/adapter/RearrangeImagesAdapter.java @@ -26,8 +26,8 @@ public class RearrangeImagesAdapter extends RecyclerView.Adapter mImagesUri; - public RearrangeImagesAdapter(OnClickListener onClickListener, - ArrayList uris, Context context) { + public RearrangeImagesAdapter(@NonNull OnClickListener onClickListener, + @NonNull ArrayList uris, @NonNull Context context) { mOnClickListener = onClickListener; mImagesUri = uris; mContext = context; @@ -64,7 +64,7 @@ public int getItemCount() { return mImagesUri.size(); } - public void positionChanged(ArrayList images) { + public void positionChanged(@NonNull ArrayList images) { mImagesUri = images; notifyDataSetChanged(); } diff --git a/app/src/main/java/swati4star/createpdf/adapter/RearrangePdfAdapter.java b/app/src/main/java/swati4star/createpdf/adapter/RearrangePdfAdapter.java index f7e2329f4..82bed551f 100644 --- a/app/src/main/java/swati4star/createpdf/adapter/RearrangePdfAdapter.java +++ b/app/src/main/java/swati4star/createpdf/adapter/RearrangePdfAdapter.java @@ -24,8 +24,8 @@ public class RearrangePdfAdapter extends RecyclerView.Adapter mBitmaps; - public RearrangePdfAdapter(OnClickListener onClickListener, - ArrayList uris, Context context) { + public RearrangePdfAdapter(@NonNull OnClickListener onClickListener, + @NonNull ArrayList uris, @NonNull Context context) { mOnClickListener = onClickListener; mBitmaps = uris; mContext = context; @@ -61,7 +61,7 @@ public int getItemCount() { return mBitmaps.size(); } - public void positionChanged(ArrayList images) { + public void positionChanged(@NonNull ArrayList images) { mBitmaps = images; notifyDataSetChanged(); } diff --git a/app/src/main/java/swati4star/createpdf/adapter/RecentListAdapter.java b/app/src/main/java/swati4star/createpdf/adapter/RecentListAdapter.java index 9082da46e..bedf8105f 100644 --- a/app/src/main/java/swati4star/createpdf/adapter/RecentListAdapter.java +++ b/app/src/main/java/swati4star/createpdf/adapter/RecentListAdapter.java @@ -25,7 +25,7 @@ public class RecentListAdapter extends RecyclerView.Adapter mKeys; private List> mValues; - public RecentListAdapter(View.OnClickListener listener) { + public RecentListAdapter(@NonNull View.OnClickListener listener) { this.mOnClickListener = listener; } @@ -36,7 +36,7 @@ public RecentListAdapter(View.OnClickListener listener) { * @param keys - list of all the feature viewId * @param recentList - list of the features */ - public void updateList(List keys, List> recentList) { + public void updateList(@NonNull List keys, @NonNull List> recentList) { this.mKeys = keys; this.mValues = recentList; } diff --git a/app/src/main/java/swati4star/createpdf/adapter/ViewFilesAdapter.java b/app/src/main/java/swati4star/createpdf/adapter/ViewFilesAdapter.java index 604d453d5..98c4cade4 100644 --- a/app/src/main/java/swati4star/createpdf/adapter/ViewFilesAdapter.java +++ b/app/src/main/java/swati4star/createpdf/adapter/ViewFilesAdapter.java @@ -77,10 +77,10 @@ public class ViewFilesAdapter extends RecyclerView.Adapter feedItems, - EmptyStateChangeListener emptyStateChangeListener, - ItemSelectedListener itemSelectedListener) { + public ViewFilesAdapter(@NonNull Activity activity, + @NonNull List feedItems, + @NonNull EmptyStateChangeListener emptyStateChangeListener, + @NonNull ItemSelectedListener itemSelectedListener) { this.mActivity = activity; this.mEmptyStateChangeListener = emptyStateChangeListener; this.mItemSelectedListener = itemSelectedListener; @@ -208,6 +208,7 @@ private void updateActionBarTitle() { * * @return paths of files */ + @NonNull public ArrayList getSelectedFilePath() { ArrayList filePathList = new ArrayList<>(); for (int position : mSelectedFiles) { @@ -232,7 +233,7 @@ public long getItemId(int position) { * * @param pdfFiles list containing {@link PDFFile} */ - public void setData(List pdfFiles) { + public void setData(@NonNull List pdfFiles) { mFileList = pdfFiles; notifyDataSetChanged(); } @@ -242,6 +243,7 @@ public void setData(List pdfFiles) { * * @return the Pdf Utils */ + @NonNull public PDFUtils getPDFUtils() { return mPDFUtils; } diff --git a/app/src/main/java/swati4star/createpdf/adapter/WhatsNewAdapter.java b/app/src/main/java/swati4star/createpdf/adapter/WhatsNewAdapter.java index 904ca1aff..c5a5f9958 100644 --- a/app/src/main/java/swati4star/createpdf/adapter/WhatsNewAdapter.java +++ b/app/src/main/java/swati4star/createpdf/adapter/WhatsNewAdapter.java @@ -24,7 +24,7 @@ public class WhatsNewAdapter extends RecyclerView.Adapter mWhatsNewsList; - public WhatsNewAdapter(Context context, ArrayList mWhatsNewsList) { + public WhatsNewAdapter(@NonNull Context context, @NonNull ArrayList mWhatsNewsList) { this.mContext = context; this.mWhatsNewsList = mWhatsNewsList; } diff --git a/app/src/main/java/swati4star/createpdf/database/AppDatabase.java b/app/src/main/java/swati4star/createpdf/database/AppDatabase.java index feea0821b..772cae002 100644 --- a/app/src/main/java/swati4star/createpdf/database/AppDatabase.java +++ b/app/src/main/java/swati4star/createpdf/database/AppDatabase.java @@ -2,6 +2,7 @@ import android.content.Context; +import androidx.annotation.NonNull; import androidx.room.Database; import androidx.room.Room; import androidx.room.RoomDatabase; @@ -13,7 +14,8 @@ public abstract class AppDatabase extends RoomDatabase { private static AppDatabase INSTANCE; - public static AppDatabase getDatabase(final Context context) { + @NonNull + public static AppDatabase getDatabase(final @NonNull Context context) { if (INSTANCE == null) { synchronized (AppDatabase.class) { if (INSTANCE == null) { @@ -26,5 +28,6 @@ public static AppDatabase getDatabase(final Context context) { return INSTANCE; } + @NonNull public abstract HistoryDao historyDao(); } \ No newline at end of file diff --git a/app/src/main/java/swati4star/createpdf/database/DatabaseHelper.java b/app/src/main/java/swati4star/createpdf/database/DatabaseHelper.java index cd9a3ccb5..f82357ab9 100644 --- a/app/src/main/java/swati4star/createpdf/database/DatabaseHelper.java +++ b/app/src/main/java/swati4star/createpdf/database/DatabaseHelper.java @@ -4,12 +4,14 @@ import android.content.Context; import android.os.AsyncTask; +import androidx.annotation.NonNull; + import java.util.Date; public class DatabaseHelper { private final Context mContext; - public DatabaseHelper(Context mContext) { + public DatabaseHelper(@NonNull Context mContext) { this.mContext = mContext; } @@ -19,7 +21,7 @@ public DatabaseHelper(Context mContext) { * @param filePath path of the file * @param operationType operation performed on file */ - public void insertRecord(String filePath, String operationType) { + public void insertRecord(@NonNull String filePath, @NonNull String operationType) { new Insert().execute(new History(filePath, new Date().toString(), operationType)); } diff --git a/app/src/main/java/swati4star/createpdf/database/History.java b/app/src/main/java/swati4star/createpdf/database/History.java index b8d91d499..e0f9d5a0a 100644 --- a/app/src/main/java/swati4star/createpdf/database/History.java +++ b/app/src/main/java/swati4star/createpdf/database/History.java @@ -1,5 +1,6 @@ package swati4star.createpdf.database; +import androidx.annotation.NonNull; import androidx.room.ColumnInfo; import androidx.room.Entity; import androidx.room.PrimaryKey; @@ -17,7 +18,7 @@ public class History { @ColumnInfo(name = "operation_type") private String mOperationType; - public History(String filePath, String date, String operationType) { + public History(@NonNull String filePath, @NonNull String date, @NonNull String operationType) { this.mFilePath = filePath; this.mDate = date; this.mOperationType = operationType; @@ -31,27 +32,30 @@ public void setId(int mId) { this.mId = mId; } + @NonNull public String getFilePath() { return mFilePath; } - public void setFilePath(String fileName) { + public void setFilePath(@NonNull String fileName) { this.mFilePath = fileName; } + @NonNull public String getDate() { return mDate; } - public void setDate(String date) { + public void setDate(@NonNull String date) { this.mDate = date; } + @NonNull public String getOperationType() { return mOperationType; } - public void setOperationType(String operationType) { + public void setOperationType(@NonNull String operationType) { this.mOperationType = operationType; } } diff --git a/app/src/main/java/swati4star/createpdf/database/HistoryDao.java b/app/src/main/java/swati4star/createpdf/database/HistoryDao.java index ba22d62cd..86319ad03 100644 --- a/app/src/main/java/swati4star/createpdf/database/HistoryDao.java +++ b/app/src/main/java/swati4star/createpdf/database/HistoryDao.java @@ -1,5 +1,6 @@ package swati4star.createpdf.database; +import androidx.annotation.NonNull; import androidx.room.Dao; import androidx.room.Insert; import androidx.room.Query; @@ -8,15 +9,17 @@ @Dao public interface HistoryDao { + @NonNull @Query("SELECT * FROM History order by mId desc") List getAllHistory(); @Insert - void insertAll(History... histories); + void insertAll(@NonNull History... histories); @Query("Delete from History") void deleteHistory(); + @NonNull @Query("select * from history where operation_type IN(:types) order by mId desc") - List getHistoryByOperationType(String[] types); + List getHistoryByOperationType(@NonNull String[] types); } \ No newline at end of file diff --git a/app/src/main/java/swati4star/createpdf/fragment/AboutUsFragment.java b/app/src/main/java/swati4star/createpdf/fragment/AboutUsFragment.java index 889364389..b1c4ab0b0 100644 --- a/app/src/main/java/swati4star/createpdf/fragment/AboutUsFragment.java +++ b/app/src/main/java/swati4star/createpdf/fragment/AboutUsFragment.java @@ -25,9 +25,10 @@ public class AboutUsFragment extends Fragment { private Activity mActivity; private FeedbackUtils mFeedbackUtils; + @NonNull @Override - public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, - Bundle savedInstanceState) { + public View onCreateView(@NonNull LayoutInflater inflater, @NonNull ViewGroup container, + @NonNull Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_about_us, container, false); ButterKnife.bind(this, rootView); try { @@ -90,7 +91,7 @@ void license() { } @Override - public void onAttach(Context context) { + public void onAttach(@NonNull Context context) { super.onAttach(context); mActivity = (Activity) context; } diff --git a/app/src/main/java/swati4star/createpdf/fragment/AddImagesFragment.java b/app/src/main/java/swati4star/createpdf/fragment/AddImagesFragment.java index b06eed739..520f1f618 100644 --- a/app/src/main/java/swati4star/createpdf/fragment/AddImagesFragment.java +++ b/app/src/main/java/swati4star/createpdf/fragment/AddImagesFragment.java @@ -83,9 +83,10 @@ public class AddImagesFragment extends Fragment implements BottomSheetPopulate, private String mOperation; private BottomSheetBehavior mSheetBehavior; + @NonNull @Override - public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, - Bundle savedInstanceState) { + public View onCreateView(@NonNull LayoutInflater inflater, @NonNull ViewGroup container, + @NonNull Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_add_images, container, false); ButterKnife.bind(this, rootView); mSheetBehavior = BottomSheetBehavior.from(layoutBottomSheet); @@ -120,7 +121,7 @@ public void showFileChooser() { * @param data Data of the image selected */ @Override - public void onActivityResult(int requestCode, int resultCode, Intent data) { + public void onActivityResult(int requestCode, int resultCode, @NonNull Intent data) { super.onActivityResult(requestCode, resultCode, data); if (resultCode != Activity.RESULT_OK || data == null) @@ -237,7 +238,7 @@ private void selectImages() { } @Override - public void onAttach(Context context) { + public void onAttach(@NonNull Context context) { super.onAttach(context); mActivity = (Activity) context; mMorphButtonUtility = new MorphButtonUtility(mActivity); @@ -247,7 +248,7 @@ public void onAttach(Context context) { } @Override - public void onItemClick(String path) { + public void onItemClick(@NonNull String path) { mSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED); setTextAndActivateButtons(path); } @@ -260,7 +261,7 @@ private void setTextAndActivateButtons(String path) { } @Override - public void onPopulate(ArrayList paths) { + public void onPopulate(@NonNull ArrayList paths) { CommonCodeUtils.getInstance().populateUtil(mActivity, paths, this, mLayout, mLottieProgress, mRecyclerViewFiles); } diff --git a/app/src/main/java/swati4star/createpdf/fragment/AddTextFragment.java b/app/src/main/java/swati4star/createpdf/fragment/AddTextFragment.java index c3817e27c..bac9ee31a 100644 --- a/app/src/main/java/swati4star/createpdf/fragment/AddTextFragment.java +++ b/app/src/main/java/swati4star/createpdf/fragment/AddTextFragment.java @@ -111,9 +111,10 @@ public class AddTextFragment extends Fragment implements MergeFilesAdapter.OnCli private EnhancementOptionsAdapter mTextEnhancementOptionsAdapter; private Font.FontFamily mFontFamily; + @NonNull @Override - public View onCreateView(LayoutInflater inflater, ViewGroup container, - Bundle savedInstanceState) { + public View onCreateView(@NonNull LayoutInflater inflater, @NonNull ViewGroup container, + @NonNull Bundle savedInstanceState) { // Inflate the layout for this fragment View rootView = inflater.inflate(R.layout.fragment_add_text, container, false); ButterKnife.bind(this, rootView); @@ -145,7 +146,7 @@ private void showEnhancementOptions() { } @Override - public void onAttach(Context context) { + public void onAttach(@NonNull Context context) { super.onAttach(context); mActivity = (Activity) context; mMorphButtonUtility = new MorphButtonUtility(mActivity); @@ -208,7 +209,7 @@ private void openPdfNameDialog_() { .show(); } - public void onActivityResult(int requestCode, int resultCode, Intent data) throws NullPointerException { + public void onActivityResult(int requestCode, int resultCode, @NonNull Intent data) throws NullPointerException { if (data == null || resultCode != RESULT_OK || data.getData() == null) return; if (requestCode == INTENT_REQUEST_PICK_PDF_FILE_CODE) { @@ -321,14 +322,14 @@ public void onRequestPermissionsResult(int requestCode, } @Override - public void onItemClick(String path) { + public void onItemClick(@NonNull String path) { mSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED); mPdfpath = path; StringUtils.getInstance().showSnackbar(mActivity, getResources().getString(R.string.snackbar_pdfselected)); } @Override - public void onPopulate(ArrayList paths) { + public void onPopulate(@NonNull ArrayList paths) { CommonCodeUtils.getInstance().populateUtil(mActivity, paths, this, mLayout, mLottieProgress, mRecyclerViewFiles); } diff --git a/app/src/main/java/swati4star/createpdf/fragment/ExceltoPdfFragment.java b/app/src/main/java/swati4star/createpdf/fragment/ExceltoPdfFragment.java index 8c8ec3c2d..d8ef86e6b 100644 --- a/app/src/main/java/swati4star/createpdf/fragment/ExceltoPdfFragment.java +++ b/app/src/main/java/swati4star/createpdf/fragment/ExceltoPdfFragment.java @@ -100,8 +100,9 @@ public class ExceltoPdfFragment extends Fragment implements MergeFilesAdapter.On private boolean mPasswordProtected = false; private String mPassword; + @NonNull @Override - public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + public View onCreateView(@NonNull LayoutInflater inflater, @NonNull ViewGroup container, @NonNull Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_excelto_pdf, container, false); mSharedPreferences = PreferenceManager.getDefaultSharedPreferences(mActivity); @@ -129,7 +130,7 @@ private void showEnhancementOptions() { } @Override - public void onAttach(Context context) { + public void onAttach(@NonNull Context context) { super.onAttach(context); mActivity = (Activity) context; mFileUtils = new FileUtils(mActivity); @@ -192,7 +193,7 @@ void openPdf() { } @Override - public void onActivityResult(int requestCode, int resultCode, Intent data) { + public void onActivityResult(int requestCode, int resultCode, @NonNull Intent data) { mButtonClicked = false; if (requestCode == mFileSelectCode) { if (resultCode == RESULT_OK) { @@ -258,7 +259,7 @@ public void onPDFCreationStarted() { } @Override - public void onPDFCreated(boolean success, String path) { + public void onPDFCreated(boolean success, @NonNull String path) { if (mMaterialDialog != null && mMaterialDialog.isShowing()) mMaterialDialog.dismiss(); if (!success) { @@ -347,7 +348,7 @@ private void setPasswordIcon(int drawable) { } @Override - public void onItemClick(String path) { + public void onItemClick(@NonNull String path) { mSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED); mExcelFileUri = Uri.parse("file://" + path); mRealPath = path; @@ -355,7 +356,7 @@ public void onItemClick(String path) { } @Override - public void onPopulate(ArrayList paths) { + public void onPopulate(@NonNull ArrayList paths) { CommonCodeUtils.getInstance().populateUtil(mActivity, paths, this, mLayout, mLottieProgress, mRecyclerViewFiles); } diff --git a/app/src/main/java/swati4star/createpdf/fragment/ExtractTextFragment.java b/app/src/main/java/swati4star/createpdf/fragment/ExtractTextFragment.java index 8bf3df6a5..1d53dd02c 100644 --- a/app/src/main/java/swati4star/createpdf/fragment/ExtractTextFragment.java +++ b/app/src/main/java/swati4star/createpdf/fragment/ExtractTextFragment.java @@ -87,9 +87,10 @@ public class ExtractTextFragment extends Fragment implements MergeFilesAdapter.O private boolean mButtonClicked = false; private String mFileName; + @NonNull @Override - public View onCreateView(LayoutInflater inflater, ViewGroup container, - Bundle savedInstanceState) { + public View onCreateView(@NonNull LayoutInflater inflater, @NonNull ViewGroup container, + @NonNull Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_extract_text, container, false); mSharedPreferences = PreferenceManager.getDefaultSharedPreferences(mActivity); @@ -105,7 +106,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, } @Override - public void onAttach(Context context) { + public void onAttach(@NonNull Context context) { super.onAttach(context); mActivity = (Activity) context; mFileUtils = new FileUtils(mActivity); @@ -136,7 +137,7 @@ public void selectPdfFile() { } @Override - public void onActivityResult(int requestCode, int resultCode, Intent data) { + public void onActivityResult(int requestCode, int resultCode, @NonNull Intent data) { mButtonClicked = false; if (requestCode == mFileSelectCode && resultCode == RESULT_OK) { mExcelFileUri = data.getData(); @@ -247,13 +248,13 @@ private void extractTextFromPdf(String inputName) { } @Override - public void onPopulate(ArrayList paths) { + public void onPopulate(@NonNull ArrayList paths) { CommonCodeUtils.getInstance().populateUtil(mActivity, paths, this, mLayout, mLottieProgress, mRecyclerViewFiles); } @Override - public void onItemClick(String path) { + public void onItemClick(@NonNull String path) { mSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED); mRealPath = path; mFileName = FileUtils.getFileName(path); diff --git a/app/src/main/java/swati4star/createpdf/fragment/FAQFragment.java b/app/src/main/java/swati4star/createpdf/fragment/FAQFragment.java index 414c876ab..a14b06aa3 100644 --- a/app/src/main/java/swati4star/createpdf/fragment/FAQFragment.java +++ b/app/src/main/java/swati4star/createpdf/fragment/FAQFragment.java @@ -8,6 +8,7 @@ import android.view.ViewGroup; import android.widget.SearchView; +import androidx.annotation.NonNull; import androidx.fragment.app.Fragment; import androidx.recyclerview.widget.RecyclerView; @@ -36,9 +37,10 @@ public FAQFragment() { // Required empty public constructor } + @NonNull @Override - public View onCreateView(LayoutInflater inflater, ViewGroup container, - Bundle savedInstanceState) { + public View onCreateView(@NonNull LayoutInflater inflater, @NonNull ViewGroup container, + @NonNull Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_faq, container, false); @@ -70,7 +72,7 @@ public boolean onQueryTextChange(String newQuery) { * @param text - This is the search text entered in the search box. * Simply filtering out the questions that contains the given search query. */ - public void filterFaq(String text) { + public void filterFaq(@NonNull String text) { mFaqs.clear(); if (text.isEmpty()) mFaqs.addAll(mFaqsCopy); diff --git a/app/src/main/java/swati4star/createpdf/fragment/FavouritesFragment.java b/app/src/main/java/swati4star/createpdf/fragment/FavouritesFragment.java index bee0edc5b..7c86a0280 100644 --- a/app/src/main/java/swati4star/createpdf/fragment/FavouritesFragment.java +++ b/app/src/main/java/swati4star/createpdf/fragment/FavouritesFragment.java @@ -46,6 +46,7 @@ import android.view.ViewGroup; import android.widget.TextView; +import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentManager; @@ -126,8 +127,8 @@ public class FavouritesFragment extends Fragment @Nullable @Override - public View onCreateView(LayoutInflater inflater, ViewGroup container, - Bundle savedInstanceState) { + public View onCreateView(@NonNull LayoutInflater inflater, @NonNull ViewGroup container, + @NonNull Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.favourites_fragment, container, false); ButterKnife.bind(this, rootView); @@ -182,7 +183,7 @@ public void onAddFavouriteButtonClicked() { } @Override - public void onPrepareOptionsMenu(Menu menu) { + public void onPrepareOptionsMenu(@NonNull Menu menu) { menu.findItem(R.id.menu_favourites_item).setVisible(false); super.onPrepareOptionsMenu(menu); } @@ -229,7 +230,7 @@ private void checkFavourites(SharedPreferences sharedPreferences) { } @Override - public void onAttach(Context context) { + public void onAttach(@NonNull Context context) { super.onAttach(context); mActivity = (Activity) context; } diff --git a/app/src/main/java/swati4star/createpdf/fragment/HistoryFragment.java b/app/src/main/java/swati4star/createpdf/fragment/HistoryFragment.java index 6833fa889..a36b0fe30 100644 --- a/app/src/main/java/swati4star/createpdf/fragment/HistoryFragment.java +++ b/app/src/main/java/swati4star/createpdf/fragment/HistoryFragment.java @@ -58,7 +58,7 @@ public class HistoryFragment extends Fragment implements HistoryAdapter.OnClickL private boolean[] mFilterOptionState; @Override - public void onAttach(Context context) { + public void onAttach(@NonNull Context context) { super.onAttach(context); mActivity = (Activity) context; } @@ -85,12 +85,12 @@ public View onCreateView(@NonNull LayoutInflater inflater, } @Override - public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { + public void onCreateOptionsMenu(@NonNull Menu menu, @NonNull MenuInflater inflater) { inflater.inflate(R.menu.menu_history_fragment, menu); } @Override - public boolean onOptionsItemSelected(MenuItem item) { + public boolean onOptionsItemSelected(@NonNull MenuItem item) { switch (item.getItemId()) { case R.id.actionDeleteHistory: deleteHistory(); @@ -148,7 +148,7 @@ public void loadHome() { } @Override - public void onItemClick(String path) { + public void onItemClick(@NonNull String path) { FileUtils fileUtils = new FileUtils(mActivity); File file = new File(path); if (file.exists()) { diff --git a/app/src/main/java/swati4star/createpdf/fragment/HomeFragment.java b/app/src/main/java/swati4star/createpdf/fragment/HomeFragment.java index cbc9b7c65..c95f91e94 100644 --- a/app/src/main/java/swati4star/createpdf/fragment/HomeFragment.java +++ b/app/src/main/java/swati4star/createpdf/fragment/HomeFragment.java @@ -103,9 +103,10 @@ public class HomeFragment extends Fragment implements View.OnClickListener { private Map mFragmentPositionMap; private RecentListAdapter mAdapter; + @NonNull @Override - public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, - Bundle savedInstanceState) { + public View onCreateView(@NonNull LayoutInflater inflater, @NonNull ViewGroup container, + @NonNull Bundle savedInstanceState) { View rootview = inflater.inflate(R.layout.fragment_home, container, false); ButterKnife.bind(this, rootview); mFragmentPositionMap = CommonCodeUtils.getInstance().fillNavigationItemsMap(true); @@ -165,7 +166,7 @@ public void onViewCreated( } @Override - public void onAttach(Context context) { + public void onAttach(@NonNull Context context) { super.onAttach(context); mActivity = (Activity) context; } diff --git a/app/src/main/java/swati4star/createpdf/fragment/ImageToPdfFragment.java b/app/src/main/java/swati4star/createpdf/fragment/ImageToPdfFragment.java index 3562d2073..ae588804c 100755 --- a/app/src/main/java/swati4star/createpdf/fragment/ImageToPdfFragment.java +++ b/app/src/main/java/swati4star/createpdf/fragment/ImageToPdfFragment.java @@ -102,6 +102,7 @@ public class ImageToPdfFragment extends Fragment implements OnItemClickListener, private static final int INTENT_REQUEST_REARRANGE_IMAGE = 12; private static final int INTENT_REQUEST_GET_IMAGES = 13; private static final ArrayList mUnarrangedImagesUri = new ArrayList<>(); + @NonNull public static ArrayList mImagesUri = new ArrayList<>(); @BindView(R.id.pdfCreate) MorphingButton mCreatePdf; @@ -132,13 +133,14 @@ public class ImageToPdfFragment extends Fragment implements OnItemClickListener, private boolean mShouldCropImages = false; @Override - public void onAttach(Context context) { + public void onAttach(@NonNull Context context) { super.onAttach(context); mActivity = (Activity) context; } + @NonNull @Override - public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + public View onCreateView(@NonNull LayoutInflater inflater, @NonNull ViewGroup container, @NonNull Bundle savedInstanceState) { View root = inflater.inflate(R.layout.fragment_images_to_pdf, container, false); ButterKnife.bind(this, root); @@ -288,7 +290,7 @@ public void onRequestPermissionsResult(int requestCode, * @param data Data of the image selected */ @Override - public void onActivityResult(int requestCode, int resultCode, Intent data) { + public void onActivityResult(int requestCode, int resultCode, @NonNull Intent data) { super.onActivityResult(requestCode, resultCode, data); mIsButtonAlreadyClicked = false; if (resultCode != Activity.RESULT_OK || data == null) @@ -702,7 +704,7 @@ public void onPDFCreationStarted() { } @Override - public void onPDFCreated(boolean success, String path) { + public void onPDFCreated(boolean success, @NonNull String path) { if (mMaterialDialog != null && mMaterialDialog.isShowing()) mMaterialDialog.dismiss(); diff --git a/app/src/main/java/swati4star/createpdf/fragment/InvertPdfFragment.java b/app/src/main/java/swati4star/createpdf/fragment/InvertPdfFragment.java index 22b7a80bd..83a0bfa4a 100644 --- a/app/src/main/java/swati4star/createpdf/fragment/InvertPdfFragment.java +++ b/app/src/main/java/swati4star/createpdf/fragment/InvertPdfFragment.java @@ -78,9 +78,10 @@ public class InvertPdfFragment extends Fragment implements MergeFilesAdapter.OnC private MaterialDialog mMaterialDialog; private BottomSheetBehavior mSheetBehavior; + @NonNull @Override - public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, - Bundle savedInstanceState) { + public View onCreateView(@NonNull LayoutInflater inflater, @NonNull ViewGroup container, + @NonNull Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_invert_pdf, container, false); ButterKnife.bind(this, rootView); mSheetBehavior = BottomSheetBehavior.from(layoutBottomSheet); @@ -107,7 +108,7 @@ public void showFileChooser() { INTENT_REQUEST_PICK_FILE_CODE); } - public void onActivityResult(int requestCode, int resultCode, Intent data) throws NullPointerException { + public void onActivityResult(int requestCode, int resultCode, @NonNull Intent data) throws NullPointerException { if (data == null || resultCode != RESULT_OK || data.getData() == null) return; if (requestCode == INTENT_REQUEST_PICK_FILE_CODE) { @@ -138,13 +139,13 @@ private void setTextAndActivateButtons(String path) { } @Override - public void onPopulate(ArrayList paths) { + public void onPopulate(@NonNull ArrayList paths) { CommonCodeUtils.getInstance().populateUtil(mActivity, paths, this, mLayout, mLottieProgress, mRecyclerViewFiles); } @Override - public void onAttach(Context context) { + public void onAttach(@NonNull Context context) { super.onAttach(context); mActivity = (Activity) context; mMorphButtonUtility = new MorphButtonUtility(mActivity); @@ -153,13 +154,13 @@ public void onAttach(Context context) { } @Override - public void onItemClick(String path) { + public void onItemClick(@NonNull String path) { mSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED); setTextAndActivateButtons(path); } @Override - public void onFileItemClick(String path) { + public void onFileItemClick(@NonNull String path) { mFileUtils.openFile(path, FileUtils.FileType.e_PDF); } @@ -175,7 +176,7 @@ public void onPDFCreationStarted() { } @Override - public void onPDFCreated(boolean isNewPdfCreated, String path) { + public void onPDFCreated(boolean isNewPdfCreated, @NonNull String path) { mMaterialDialog.dismiss(); if (!isNewPdfCreated) { StringUtils.getInstance().showSnackbar(mActivity, R.string.snackbar_invert_unsuccessful); diff --git a/app/src/main/java/swati4star/createpdf/fragment/MergeFilesFragment.java b/app/src/main/java/swati4star/createpdf/fragment/MergeFilesFragment.java index c08b73ce2..9545d7d06 100644 --- a/app/src/main/java/swati4star/createpdf/fragment/MergeFilesFragment.java +++ b/app/src/main/java/swati4star/createpdf/fragment/MergeFilesFragment.java @@ -109,9 +109,10 @@ public class MergeFilesFragment extends Fragment implements MergeFilesAdapter.On public MergeFilesFragment() { } + @NonNull @Override - public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, - Bundle savedInstanceState) { + public View onCreateView(@NonNull LayoutInflater inflater, @NonNull ViewGroup container, + @NonNull Bundle savedInstanceState) { View root = inflater.inflate(R.layout.fragment_merge_files, container, false); ButterKnife.bind(this, root); showEnhancementOptions(); @@ -253,7 +254,7 @@ void mergeFiles(final View view) { * get uri from data of intent and convert it to absolute path * add absolute path to mFilePaths list */ - public void onActivityResult(int requestCode, int resultCode, Intent data) { + public void onActivityResult(int requestCode, int resultCode, @NonNull Intent data) { if (data == null || resultCode != RESULT_OK || ( data.getData() == null && data.getClipData() == null ) ) return; if (requestCode == INTENT_REQUEST_PICK_FILE_CODE) { @@ -294,7 +295,7 @@ public void onSaveInstanceState(@NonNull Bundle outState) { } @Override - public void onAttach(Context context) { + public void onAttach(@NonNull Context context) { super.onAttach(context); mActivity = (Activity) context; mFileUtils = new FileUtils(mActivity); @@ -302,7 +303,7 @@ public void onAttach(Context context) { } @Override - public void onItemClick(String path) { + public void onItemClick(@NonNull String path) { if (mFilePaths.contains(path)) { mFilePaths.remove(path); StringUtils.getInstance().showSnackbar(mActivity, getString(R.string.pdf_removed_from_list)); @@ -323,7 +324,7 @@ public void onItemClick(String path) { * resets fragment to initial stage */ @Override - public void resetValues(boolean isPDFMerged, String path) { + public void resetValues(boolean isPDFMerged, @NonNull String path) { mMaterialDialog.dismiss(); if (isPDFMerged) { @@ -349,12 +350,12 @@ public void mergeStarted() { } @Override - public void viewFile(String path) { + public void viewFile(@NonNull String path) { mFileUtils.openFile(path, FileUtils.FileType.e_PDF); } @Override - public void removeFile(String path) { + public void removeFile(@NonNull String path) { mFilePaths.remove(path); mMergeSelectedFilesAdapter.notifyDataSetChanged(); StringUtils.getInstance().showSnackbar(mActivity, getString(R.string.pdf_removed_from_list)); @@ -384,7 +385,7 @@ private void setMorphingButtonState(Boolean enabled) { } @Override - public void onPopulate(ArrayList paths) { + public void onPopulate(@NonNull ArrayList paths) { CommonCodeUtils.getInstance().populateUtil(mActivity, paths, this, mLayout, mLottieProgress, mRecyclerViewFiles); } diff --git a/app/src/main/java/swati4star/createpdf/fragment/PdfToImageFragment.java b/app/src/main/java/swati4star/createpdf/fragment/PdfToImageFragment.java index 5709800b9..88e4de4de 100644 --- a/app/src/main/java/swati4star/createpdf/fragment/PdfToImageFragment.java +++ b/app/src/main/java/swati4star/createpdf/fragment/PdfToImageFragment.java @@ -102,9 +102,10 @@ public class PdfToImageFragment extends Fragment implements BottomSheetPopulate, * @param savedInstanceState bundle with saved data, if any * @return inflated view */ + @NonNull @Override - public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, - Bundle savedInstanceState) { + public View onCreateView(@NonNull LayoutInflater inflater, @NonNull ViewGroup container, + @NonNull Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_pdf_to_image, container, false); ButterKnife.bind(this, rootView); mOperation = getArguments().getString(BUNDLE_DATA); @@ -170,7 +171,7 @@ public void showFileChooser() { /** * receives intent response for selecting a pdf file */ - public void onActivityResult(int requestCode, int resultCode, Intent data) throws NullPointerException { + public void onActivityResult(int requestCode, int resultCode, @NonNull Intent data) throws NullPointerException { if (data == null || resultCode != RESULT_OK || data.getData() == null) return; if (requestCode == INTENT_REQUEST_PICK_FILE_CODE) { @@ -224,7 +225,7 @@ private void pdfToImage(String[] mInputPassword) { } @Override - public void onAttach(Context context) { + public void onAttach(@NonNull Context context) { super.onAttach(context); mActivity = (Activity) context; mMorphButtonUtility = new MorphButtonUtility(mActivity); @@ -240,7 +241,7 @@ public void onAttach(Context context) { * @param path path of the file on the device */ @Override - public void onItemClick(String path) { + public void onItemClick(@NonNull String path) { mUri = null; mSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED); setTextAndActivateButtons(path); @@ -271,7 +272,7 @@ private void setTextAndActivateButtons(String path) { * @param path path of the file on the device */ @Override - public void onFileItemClick(String path) { + public void onFileItemClick(@NonNull String path) { mFileUtils.openImage(path); } @@ -300,7 +301,7 @@ public void extractionStarted() { * @param outputFilePaths path for each generated image */ @Override - public void updateView(int imageCount, ArrayList outputFilePaths) { + public void updateView(int imageCount, @NonNull ArrayList outputFilePaths) { mMaterialDialog.dismiss(); resetView(); @@ -316,7 +317,7 @@ public void updateView(int imageCount, ArrayList outputFilePaths) { * @param paths paths for pdf files on the device */ @Override - public void onPopulate(ArrayList paths) { + public void onPopulate(@NonNull ArrayList paths) { CommonCodeUtils.getInstance().populateUtil(mActivity, paths, this, mLayout, mLottieProgress, mRecyclerViewFiles); } diff --git a/app/src/main/java/swati4star/createpdf/fragment/QrBarcodeScanFragment.java b/app/src/main/java/swati4star/createpdf/fragment/QrBarcodeScanFragment.java index 95d4235bc..808f5e1d4 100644 --- a/app/src/main/java/swati4star/createpdf/fragment/QrBarcodeScanFragment.java +++ b/app/src/main/java/swati4star/createpdf/fragment/QrBarcodeScanFragment.java @@ -76,9 +76,10 @@ public class QrBarcodeScanFragment extends Fragment implements View.OnClickListe private Font.FontFamily mFontFamily; private int mFontColor; + @NonNull @Override - public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, - Bundle savedInstanceState) { + public View onCreateView(@NonNull LayoutInflater inflater, @NonNull ViewGroup container, + @NonNull Bundle savedInstanceState) { View rootview = inflater.inflate(R.layout.fragment_qrcode_barcode, container, false); // Initialize variables mSharedPreferences = PreferenceManager.getDefaultSharedPreferences(mActivity); @@ -96,7 +97,7 @@ public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, } @Override - public void onActivityResult(int requestCode, int resultCode, Intent data) { + public void onActivityResult(int requestCode, int resultCode, @NonNull Intent data) { IntentResult result = IntentIntegrator.parseActivityResult(requestCode, resultCode, data); if (result == null || result.getContents() == null) StringUtils.getInstance().showSnackbar(mActivity, R.string.scan_cancelled); @@ -202,7 +203,7 @@ private void createPdf(String mFilename, Uri uri) { } @Override - public void onAttach(Context context) { + public void onAttach(@NonNull Context context) { super.onAttach(context); mActivity = (Activity) context; mFileUtils = new FileUtils(mActivity); @@ -230,7 +231,7 @@ public void onPDFCreationStarted() { } @Override - public void onPDFCreated(boolean success, String path) { + public void onPDFCreated(boolean success, @NonNull String path) { mMaterialDialog.dismiss(); if (!success) { StringUtils.getInstance().showSnackbar(mActivity, R.string.snackbar_folder_not_created); diff --git a/app/src/main/java/swati4star/createpdf/fragment/RemoveDuplicatePagesFragment.java b/app/src/main/java/swati4star/createpdf/fragment/RemoveDuplicatePagesFragment.java index b3f9886b5..a8697b4ba 100644 --- a/app/src/main/java/swati4star/createpdf/fragment/RemoveDuplicatePagesFragment.java +++ b/app/src/main/java/swati4star/createpdf/fragment/RemoveDuplicatePagesFragment.java @@ -79,8 +79,9 @@ public class RemoveDuplicatePagesFragment extends Fragment private BottomSheetUtils mBottomSheetUtils; private MaterialDialog mMaterialDialog; + @NonNull @Override - public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + public View onCreateView(@NonNull LayoutInflater inflater, @NonNull ViewGroup container, @NonNull Bundle savedInstanceState) { View rootview = inflater.inflate(R.layout.fragment_remove_duplicate_pages, container, false); ButterKnife.bind(this, rootview); mSheetBehavior = BottomSheetBehavior.from(layoutBottomSheet); @@ -109,7 +110,7 @@ public void showFileChooser() { // when accessing data.getData(). Added try-catch blocks to handle exceptions // in a better way(imo) to prevent app crashes. @Override - public void onActivityResult(int requestCode, int resultCode, Intent data) { + public void onActivityResult(int requestCode, int resultCode, @NonNull Intent data) { if (resultCode != RESULT_OK || data == null || data.getData() == null) { return; } @@ -143,12 +144,12 @@ private void setTextAndActivateButtons(String path) { } @Override - public void onPopulate(ArrayList paths) { + public void onPopulate(@NonNull ArrayList paths) { CommonCodeUtils.getInstance().populateUtil(mActivity, paths, this, mLayout, mLottieProgress, mRecyclerViewFiles); } @Override - public void onAttach(Context context) { + public void onAttach(@NonNull Context context) { super.onAttach(context); mActivity = (Activity) context; mMorphButtonUtility = new MorphButtonUtility(mActivity); @@ -157,13 +158,13 @@ public void onAttach(Context context) { } @Override - public void onItemClick(String path) { + public void onItemClick(@NonNull String path) { mSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED); setTextAndActivateButtons(path); } @Override - public void onFileItemClick(String path) { + public void onFileItemClick(@NonNull String path) { mFileUtils.openFile(path, FileUtils.FileType.e_PDF); } @@ -179,7 +180,7 @@ public void onPDFCreationStarted() { } @Override - public void onPDFCreated(boolean isNewPdfCreated, String path) { + public void onPDFCreated(boolean isNewPdfCreated, @NonNull String path) { mMaterialDialog.dismiss(); if (!isNewPdfCreated) { StringUtils.getInstance().showSnackbar(mActivity, R.string.snackbar_no_duplicate_pdf); diff --git a/app/src/main/java/swati4star/createpdf/fragment/RemovePagesFragment.java b/app/src/main/java/swati4star/createpdf/fragment/RemovePagesFragment.java index 0d4c2a942..3c2c817cf 100644 --- a/app/src/main/java/swati4star/createpdf/fragment/RemovePagesFragment.java +++ b/app/src/main/java/swati4star/createpdf/fragment/RemovePagesFragment.java @@ -104,9 +104,10 @@ public class RemovePagesFragment extends Fragment implements MergeFilesAdapter.O private BottomSheetBehavior mSheetBehavior; private Uri mUri; + @NonNull @Override - public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, - Bundle savedInstanceState) { + public View onCreateView(@NonNull LayoutInflater inflater, @NonNull ViewGroup container, + @NonNull Bundle savedInstanceState) { View rootview = inflater.inflate(R.layout.fragment_remove_pages, container, false); ButterKnife.bind(this, rootview); mSheetBehavior = BottomSheetBehavior.from(layoutBottomSheet); @@ -134,7 +135,7 @@ public void showFileChooser() { INTENT_REQUEST_PICKFILE_CODE); } - public void onActivityResult(int requestCode, int resultCode, Intent data) throws NullPointerException { + public void onActivityResult(int requestCode, int resultCode, @NonNull Intent data) throws NullPointerException { if (data == null || resultCode != RESULT_OK) return; if (requestCode == INTENT_REQUEST_PICKFILE_CODE) { @@ -252,7 +253,7 @@ private void resetValues() { } @Override - public void onAttach(Context context) { + public void onAttach(@NonNull Context context) { super.onAttach(context); mActivity = (Activity) context; mMorphButtonUtility = new MorphButtonUtility(mActivity); @@ -262,7 +263,7 @@ public void onAttach(Context context) { } @Override - public void onItemClick(String path) { + public void onItemClick(@NonNull String path) { mSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED); setTextAndActivateButtons(path); } @@ -287,7 +288,7 @@ public void pdfCompressionStarted() { } @Override - public void pdfCompressionEnded(String path, Boolean success) { + public void pdfCompressionEnded(@NonNull String path, @NonNull Boolean success) { mMaterialDialog.dismiss(); if (success && path != null && mPath != null) { StringUtils.getInstance().getSnackbarwithAction(mActivity, R.string.snackbar_pdfCreated) @@ -314,7 +315,7 @@ private void viewPdfButton(String path) { } @Override - public void onPopulate(ArrayList paths) { + public void onPopulate(@NonNull ArrayList paths) { CommonCodeUtils.getInstance().populateUtil(mActivity, paths, this, mLayout, mLottieProgress, mRecyclerViewFiles); } @@ -338,7 +339,7 @@ public void onPdfReorderStarted() { } @Override - public void onPdfReorderCompleted(List bitmaps) { + public void onPdfReorderCompleted(@NonNull List bitmaps) { mMaterialDialog.dismiss(); RearrangePdfPages.mImages = new ArrayList<>(bitmaps); bitmaps.clear(); //releasing memory diff --git a/app/src/main/java/swati4star/createpdf/fragment/SettingsFragment.java b/app/src/main/java/swati4star/createpdf/fragment/SettingsFragment.java index 6a6c55f9b..8ff4928fb 100644 --- a/app/src/main/java/swati4star/createpdf/fragment/SettingsFragment.java +++ b/app/src/main/java/swati4star/createpdf/fragment/SettingsFragment.java @@ -61,14 +61,15 @@ public SettingsFragment() { } @Override - public void onAttach(Context context) { + public void onAttach(@NonNull Context context) { super.onAttach(context); mActivity = (Activity) context; } + @NonNull @Override - public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, - Bundle savedInstanceState) { + public View onCreateView(@NonNull LayoutInflater inflater, @NonNull ViewGroup container, + @NonNull Bundle savedInstanceState) { // Inflate the layout for this fragment View root = inflater.inflate(R.layout.fragment_settings, container, false); ButterKnife.bind(this, root); @@ -86,7 +87,7 @@ public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, // } @Override - public void onActivityResult(int requestCode, int resultCode, Intent data) { + public void onActivityResult(int requestCode, int resultCode, @NonNull Intent data) { if (requestCode == MODIFY_STORAGE_LOCATION_CODE) { if (data.getExtras() != null) { String folderLocation = data.getExtras().getString("data") + "/"; diff --git a/app/src/main/java/swati4star/createpdf/fragment/SplitFilesFragment.java b/app/src/main/java/swati4star/createpdf/fragment/SplitFilesFragment.java index 4f6419f0e..030510453 100644 --- a/app/src/main/java/swati4star/createpdf/fragment/SplitFilesFragment.java +++ b/app/src/main/java/swati4star/createpdf/fragment/SplitFilesFragment.java @@ -85,9 +85,10 @@ public class SplitFilesFragment extends Fragment implements MergeFilesAdapter.On private BottomSheetUtils mBottomSheetUtils; private BottomSheetBehavior mSheetBehavior; + @NonNull @Override - public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, - Bundle savedInstanceState) { + public View onCreateView(@NonNull LayoutInflater inflater, @NonNull ViewGroup container, + @NonNull Bundle savedInstanceState) { View rootview = inflater.inflate(R.layout.fragment_split_files, container, false); ButterKnife.bind(this, rootview); mSheetBehavior = BottomSheetBehavior.from(layoutBottomSheet); @@ -114,7 +115,7 @@ public void showFileChooser() { INTENT_REQUEST_PICKFILE_CODE); } - public void onActivityResult(int requestCode, int resultCode, Intent data) throws NullPointerException { + public void onActivityResult(int requestCode, int resultCode, @NonNull Intent data) throws NullPointerException { if (data == null || resultCode != RESULT_OK || data.getData() == null) return; if (requestCode == INTENT_REQUEST_PICKFILE_CODE) { @@ -154,7 +155,7 @@ private void resetValues() { } @Override - public void onAttach(Context context) { + public void onAttach(@NonNull Context context) { super.onAttach(context); mActivity = (Activity) context; mMorphButtonUtility = new MorphButtonUtility(mActivity); @@ -164,7 +165,7 @@ public void onAttach(Context context) { } @Override - public void onItemClick(String path) { + public void onItemClick(@NonNull String path) { mSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED); setTextAndActivateButtons(path); } @@ -211,12 +212,12 @@ private String getDefaultSplitConfig(String mPath) { } @Override - public void onFileItemClick(String path) { + public void onFileItemClick(@NonNull String path) { mFileUtils.openFile(path, FileUtils.FileType.e_PDF); } @Override - public void onPopulate(ArrayList paths) { + public void onPopulate(@NonNull ArrayList paths) { CommonCodeUtils.getInstance().populateUtil(mActivity, paths, this, mLayout, mLottieProgress, mRecyclerViewFiles); } diff --git a/app/src/main/java/swati4star/createpdf/fragment/ViewFilesFragment.java b/app/src/main/java/swati4star/createpdf/fragment/ViewFilesFragment.java index 52700543d..88e9b26ad 100644 --- a/app/src/main/java/swati4star/createpdf/fragment/ViewFilesFragment.java +++ b/app/src/main/java/swati4star/createpdf/fragment/ViewFilesFragment.java @@ -59,6 +59,7 @@ public class ViewFilesFragment extends Fragment ItemSelectedListener { + @NonNull @BindView(R.id.getStarted) public Button getStarted; @BindView(R.id.filesRecyclerView) @@ -84,8 +85,9 @@ public class ViewFilesFragment extends Fragment private int mCountFiles = 0; private MergeHelper mMergeHelper; + @NonNull @Override - public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + public View onCreateView(@NonNull LayoutInflater inflater, @NonNull ViewGroup container, @NonNull Bundle savedInstanceState) { View root = inflater.inflate(R.layout.fragment_view_files, container, false); ButterKnife.bind(this, root); @@ -115,7 +117,7 @@ public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, } @Override - public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { + public void onCreateOptionsMenu(@NonNull Menu menu, @NonNull MenuInflater inflater) { super.onCreateOptionsMenu(menu, inflater); MenuItem menuItem; if (!mIsMergeRequired) { @@ -163,7 +165,7 @@ private void setDataForQueryChange(String s) { } @Override - public boolean onOptionsItemSelected(final MenuItem item) { + public boolean onOptionsItemSelected(final @NonNull MenuItem item) { switch (item.getItemId()) { case R.id.item_sort: displaySortDialog(); @@ -332,7 +334,7 @@ public void onRequestPermissionsResult(int requestCode, } @Override - public void onAttach(Context context) { + public void onAttach(@NonNull Context context) { super.onAttach(context); mActivity = (Activity) context; mDirectoryUtils = new DirectoryUtils(mActivity); @@ -345,7 +347,7 @@ public void onCreate(@Nullable Bundle savedInstanceState) { } @Override - public void isSelected(Boolean isSelected, int countFiles) { + public void isSelected(@NonNull Boolean isSelected, int countFiles) { mCountFiles = countFiles; updateToolbar(); } diff --git a/app/src/main/java/swati4star/createpdf/fragment/ZipToPdfFragment.java b/app/src/main/java/swati4star/createpdf/fragment/ZipToPdfFragment.java index 5fb0867c2..1be2d2bd0 100644 --- a/app/src/main/java/swati4star/createpdf/fragment/ZipToPdfFragment.java +++ b/app/src/main/java/swati4star/createpdf/fragment/ZipToPdfFragment.java @@ -68,7 +68,7 @@ private void chooseFile() { } - public void onActivityResult(int requestCode, int resultCode, Intent data) throws NullPointerException { + public void onActivityResult(int requestCode, int resultCode, @NonNull Intent data) throws NullPointerException { if (!ResultUtils.getInstance().checkResultValidity(resultCode, data)) return; diff --git a/app/src/main/java/swati4star/createpdf/fragment/texttopdf/FontColorEnhancer.java b/app/src/main/java/swati4star/createpdf/fragment/texttopdf/FontColorEnhancer.java index 1d5c26693..e119645eb 100644 --- a/app/src/main/java/swati4star/createpdf/fragment/texttopdf/FontColorEnhancer.java +++ b/app/src/main/java/swati4star/createpdf/fragment/texttopdf/FontColorEnhancer.java @@ -63,6 +63,7 @@ public void enhance() { materialDialog.show(); } + @NonNull @Override public EnhancementOptionsEntity getEnhancementOptionsEntity() { return mEnhancementOptionsEntity; diff --git a/app/src/main/java/swati4star/createpdf/fragment/texttopdf/FontFamilyEnhancer.java b/app/src/main/java/swati4star/createpdf/fragment/texttopdf/FontFamilyEnhancer.java index 0b8d257cb..ac00f50da 100644 --- a/app/src/main/java/swati4star/createpdf/fragment/texttopdf/FontFamilyEnhancer.java +++ b/app/src/main/java/swati4star/createpdf/fragment/texttopdf/FontFamilyEnhancer.java @@ -73,6 +73,7 @@ public void enhance() { materialDialog.show(); } + @NonNull @Override public EnhancementOptionsEntity getEnhancementOptionsEntity() { return mEnhancementOptionsEntity; diff --git a/app/src/main/java/swati4star/createpdf/fragment/texttopdf/FontSizeEnhancer.java b/app/src/main/java/swati4star/createpdf/fragment/texttopdf/FontSizeEnhancer.java index 49a79b1f2..a62ce1288 100644 --- a/app/src/main/java/swati4star/createpdf/fragment/texttopdf/FontSizeEnhancer.java +++ b/app/src/main/java/swati4star/createpdf/fragment/texttopdf/FontSizeEnhancer.java @@ -75,6 +75,7 @@ public void enhance() { .show(); } + @NonNull @Override public EnhancementOptionsEntity getEnhancementOptionsEntity() { return mEnhancementOptionsEntity; diff --git a/app/src/main/java/swati4star/createpdf/fragment/texttopdf/PageColorEnhancer.java b/app/src/main/java/swati4star/createpdf/fragment/texttopdf/PageColorEnhancer.java index a140a2758..02e9854da 100644 --- a/app/src/main/java/swati4star/createpdf/fragment/texttopdf/PageColorEnhancer.java +++ b/app/src/main/java/swati4star/createpdf/fragment/texttopdf/PageColorEnhancer.java @@ -63,6 +63,7 @@ public void enhance() { materialDialog.show(); } + @NonNull @Override public EnhancementOptionsEntity getEnhancementOptionsEntity() { return mEnhancementOptionsEntity; diff --git a/app/src/main/java/swati4star/createpdf/fragment/texttopdf/PageSizeEnhancer.java b/app/src/main/java/swati4star/createpdf/fragment/texttopdf/PageSizeEnhancer.java index 6ad21c228..efa1d1ff7 100644 --- a/app/src/main/java/swati4star/createpdf/fragment/texttopdf/PageSizeEnhancer.java +++ b/app/src/main/java/swati4star/createpdf/fragment/texttopdf/PageSizeEnhancer.java @@ -31,6 +31,7 @@ public void enhance() { mPageSizeUtils.showPageSizeDialog(false); } + @NonNull @Override public EnhancementOptionsEntity getEnhancementOptionsEntity() { return mEnhancementOptionsEntity; diff --git a/app/src/main/java/swati4star/createpdf/fragment/texttopdf/PasswordEnhancer.java b/app/src/main/java/swati4star/createpdf/fragment/texttopdf/PasswordEnhancer.java index 8da7751a7..44881daa6 100644 --- a/app/src/main/java/swati4star/createpdf/fragment/texttopdf/PasswordEnhancer.java +++ b/app/src/main/java/swati4star/createpdf/fragment/texttopdf/PasswordEnhancer.java @@ -83,6 +83,7 @@ public void onTextChanged(CharSequence s, int start, int before, int count) { positiveAction.setEnabled(false); } + @NonNull @Override public EnhancementOptionsEntity getEnhancementOptionsEntity() { return mEnhancementOptionsEntity; diff --git a/app/src/main/java/swati4star/createpdf/fragment/texttopdf/TextToPdfFragment.java b/app/src/main/java/swati4star/createpdf/fragment/texttopdf/TextToPdfFragment.java index 86725e3e0..a36c8ee06 100644 --- a/app/src/main/java/swati4star/createpdf/fragment/texttopdf/TextToPdfFragment.java +++ b/app/src/main/java/swati4star/createpdf/fragment/texttopdf/TextToPdfFragment.java @@ -71,9 +71,10 @@ public class TextToPdfFragment extends Fragment implements OnItemClickListener, private List mEnhancerList; private TextToPDFOptions.Builder mBuilder; + @NonNull @Override - public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, - Bundle savedInstanceState) { + public View onCreateView(@NonNull LayoutInflater inflater, @NonNull ViewGroup container, + @NonNull Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_text_to_pdf, container, false); mMorphButtonUtility = new MorphButtonUtility(mActivity); @@ -185,7 +186,7 @@ private void selectFile() { } @Override - public void onActivityResult(int requestCode, int resultCode, Intent data) { + public void onActivityResult(int requestCode, int resultCode, @NonNull Intent data) { mButtonClicked = 0; if (requestCode == mFileSelectCode) { if (resultCode == RESULT_OK) { @@ -214,7 +215,7 @@ else if (fileName.endsWith(Constants.docExtension)) } @Override - public void onAttach(Context context) { + public void onAttach(@NonNull Context context) { super.onAttach(context); if (context instanceof Activity) { mActivity = (Activity) context; diff --git a/app/src/main/java/swati4star/createpdf/interfaces/BottomSheetPopulate.java b/app/src/main/java/swati4star/createpdf/interfaces/BottomSheetPopulate.java index 0f9c3667a..abf83249b 100644 --- a/app/src/main/java/swati4star/createpdf/interfaces/BottomSheetPopulate.java +++ b/app/src/main/java/swati4star/createpdf/interfaces/BottomSheetPopulate.java @@ -1,7 +1,9 @@ package swati4star.createpdf.interfaces; +import androidx.annotation.NonNull; + import java.util.ArrayList; public interface BottomSheetPopulate { - void onPopulate(ArrayList paths); + void onPopulate(@NonNull ArrayList paths); } diff --git a/app/src/main/java/swati4star/createpdf/interfaces/Enhancer.java b/app/src/main/java/swati4star/createpdf/interfaces/Enhancer.java index 82f932012..bf5129b87 100644 --- a/app/src/main/java/swati4star/createpdf/interfaces/Enhancer.java +++ b/app/src/main/java/swati4star/createpdf/interfaces/Enhancer.java @@ -1,5 +1,7 @@ package swati4star.createpdf.interfaces; +import androidx.annotation.NonNull; + import swati4star.createpdf.model.EnhancementOptionsEntity; /** @@ -14,5 +16,6 @@ public interface Enhancer { /** * @return The {@link EnhancementOptionsEntity} for this {@link Enhancer}. */ + @NonNull EnhancementOptionsEntity getEnhancementOptionsEntity(); } diff --git a/app/src/main/java/swati4star/createpdf/interfaces/ExtractImagesListener.java b/app/src/main/java/swati4star/createpdf/interfaces/ExtractImagesListener.java index b384c42c6..565e1a2d6 100644 --- a/app/src/main/java/swati4star/createpdf/interfaces/ExtractImagesListener.java +++ b/app/src/main/java/swati4star/createpdf/interfaces/ExtractImagesListener.java @@ -1,5 +1,7 @@ package swati4star.createpdf.interfaces; +import androidx.annotation.NonNull; + import java.util.ArrayList; public interface ExtractImagesListener { @@ -7,5 +9,5 @@ public interface ExtractImagesListener { void extractionStarted(); - void updateView(int imageCount, ArrayList outputFilePaths); + void updateView(int imageCount, @NonNull ArrayList outputFilePaths); } \ No newline at end of file diff --git a/app/src/main/java/swati4star/createpdf/interfaces/ItemSelectedListener.java b/app/src/main/java/swati4star/createpdf/interfaces/ItemSelectedListener.java index 244c908fe..04f37601e 100644 --- a/app/src/main/java/swati4star/createpdf/interfaces/ItemSelectedListener.java +++ b/app/src/main/java/swati4star/createpdf/interfaces/ItemSelectedListener.java @@ -1,5 +1,7 @@ package swati4star.createpdf.interfaces; +import androidx.annotation.NonNull; + public interface ItemSelectedListener { - void isSelected(Boolean isSelected, int countFiles); + void isSelected(@NonNull Boolean isSelected, int countFiles); } \ No newline at end of file diff --git a/app/src/main/java/swati4star/createpdf/interfaces/MergeFilesListener.java b/app/src/main/java/swati4star/createpdf/interfaces/MergeFilesListener.java index e39d0f1ae..d49b518b0 100644 --- a/app/src/main/java/swati4star/createpdf/interfaces/MergeFilesListener.java +++ b/app/src/main/java/swati4star/createpdf/interfaces/MergeFilesListener.java @@ -1,7 +1,9 @@ package swati4star.createpdf.interfaces; +import androidx.annotation.NonNull; + public interface MergeFilesListener { - void resetValues(boolean isPDFMerged, String path); + void resetValues(boolean isPDFMerged, @NonNull String path); void mergeStarted(); } diff --git a/app/src/main/java/swati4star/createpdf/interfaces/OnFilterItemClickedListener.java b/app/src/main/java/swati4star/createpdf/interfaces/OnFilterItemClickedListener.java index 6fc8fbecf..a2cc7f036 100644 --- a/app/src/main/java/swati4star/createpdf/interfaces/OnFilterItemClickedListener.java +++ b/app/src/main/java/swati4star/createpdf/interfaces/OnFilterItemClickedListener.java @@ -2,6 +2,8 @@ import android.view.View; +import androidx.annotation.NonNull; + public interface OnFilterItemClickedListener { - void onItemClick(View v, int position); + void onItemClick(@NonNull View v, int position); } diff --git a/app/src/main/java/swati4star/createpdf/interfaces/OnPDFCompressedInterface.java b/app/src/main/java/swati4star/createpdf/interfaces/OnPDFCompressedInterface.java index ad5956b3a..5fe2f7f66 100644 --- a/app/src/main/java/swati4star/createpdf/interfaces/OnPDFCompressedInterface.java +++ b/app/src/main/java/swati4star/createpdf/interfaces/OnPDFCompressedInterface.java @@ -1,7 +1,9 @@ package swati4star.createpdf.interfaces; +import androidx.annotation.NonNull; + public interface OnPDFCompressedInterface { void pdfCompressionStarted(); - void pdfCompressionEnded(String path, Boolean success); + void pdfCompressionEnded(@NonNull String path, @NonNull Boolean success); } diff --git a/app/src/main/java/swati4star/createpdf/interfaces/OnPDFCreatedInterface.java b/app/src/main/java/swati4star/createpdf/interfaces/OnPDFCreatedInterface.java index c24b2bd59..5f03dbea9 100644 --- a/app/src/main/java/swati4star/createpdf/interfaces/OnPDFCreatedInterface.java +++ b/app/src/main/java/swati4star/createpdf/interfaces/OnPDFCreatedInterface.java @@ -1,7 +1,9 @@ package swati4star.createpdf.interfaces; +import androidx.annotation.NonNull; + public interface OnPDFCreatedInterface { void onPDFCreationStarted(); - void onPDFCreated(boolean success, String path); + void onPDFCreated(boolean success, @NonNull String path); } diff --git a/app/src/main/java/swati4star/createpdf/interfaces/OnPdfReorderedInterface.java b/app/src/main/java/swati4star/createpdf/interfaces/OnPdfReorderedInterface.java index 402efdc49..1a1c51f0a 100644 --- a/app/src/main/java/swati4star/createpdf/interfaces/OnPdfReorderedInterface.java +++ b/app/src/main/java/swati4star/createpdf/interfaces/OnPdfReorderedInterface.java @@ -2,6 +2,8 @@ import android.graphics.Bitmap; +import androidx.annotation.NonNull; + import java.util.List; public interface OnPdfReorderedInterface { @@ -16,7 +18,7 @@ public interface OnPdfReorderedInterface { * * @param bitmaps All the pages of the pdf as bitmap . */ - void onPdfReorderCompleted(List bitmaps); + void onPdfReorderCompleted(@NonNull List bitmaps); /* * Called when the pdf reorder operation fails. diff --git a/app/src/main/java/swati4star/createpdf/model/EnhancementOptionsEntity.java b/app/src/main/java/swati4star/createpdf/model/EnhancementOptionsEntity.java index 42122b2af..ccb85de05 100644 --- a/app/src/main/java/swati4star/createpdf/model/EnhancementOptionsEntity.java +++ b/app/src/main/java/swati4star/createpdf/model/EnhancementOptionsEntity.java @@ -3,38 +3,42 @@ import android.content.Context; import android.graphics.drawable.Drawable; +import androidx.annotation.NonNull; + public class EnhancementOptionsEntity { private Drawable mImage; private String mName; - public EnhancementOptionsEntity(Drawable image, String name) { + public EnhancementOptionsEntity(@NonNull Drawable image, @NonNull String name) { this.mImage = image; this.mName = name; } - public EnhancementOptionsEntity(Context context, int imageId, String name) { + public EnhancementOptionsEntity(@NonNull Context context, int imageId, @NonNull String name) { this.mImage = context.getResources().getDrawable(imageId); this.mName = name; } - public EnhancementOptionsEntity(Context context, int resourceId, int stringId) { + public EnhancementOptionsEntity(@NonNull Context context, int resourceId, int stringId) { this.mImage = context.getResources().getDrawable(resourceId); this.mName = context.getString(stringId); } + @NonNull public Drawable getImage() { return mImage; } - public void setImage(Drawable image) { + public void setImage(@NonNull Drawable image) { this.mImage = image; } + @NonNull public String getName() { return mName; } - public void setName(String name) { + public void setName(@NonNull String name) { this.mName = name; } } diff --git a/app/src/main/java/swati4star/createpdf/model/FAQItem.java b/app/src/main/java/swati4star/createpdf/model/FAQItem.java index df1292858..307951308 100644 --- a/app/src/main/java/swati4star/createpdf/model/FAQItem.java +++ b/app/src/main/java/swati4star/createpdf/model/FAQItem.java @@ -1,5 +1,7 @@ package swati4star.createpdf.model; +import androidx.annotation.NonNull; + public class FAQItem { private String mQuestion; @@ -12,7 +14,7 @@ public class FAQItem { * @param question - question text * @param answer - answer text */ - public FAQItem(String question, String answer) { + public FAQItem(@NonNull String question, @NonNull String answer) { this.mQuestion = question; this.mAnswer = answer; mIsExpanded = false; @@ -26,19 +28,21 @@ public void setExpanded(boolean expanded) { mIsExpanded = expanded; } + @NonNull public String getQuestion() { return mQuestion; } - public void setQuestion(String question) { + public void setQuestion(@NonNull String question) { this.mQuestion = question; } + @NonNull public String getAnswer() { return mAnswer; } - public void setAnswer(String answer) { + public void setAnswer(@NonNull String answer) { this.mAnswer = answer; } } diff --git a/app/src/main/java/swati4star/createpdf/model/FilterItem.java b/app/src/main/java/swati4star/createpdf/model/FilterItem.java index ccb7e0e88..a236cc3a1 100644 --- a/app/src/main/java/swati4star/createpdf/model/FilterItem.java +++ b/app/src/main/java/swati4star/createpdf/model/FilterItem.java @@ -1,5 +1,7 @@ package swati4star.createpdf.model; +import androidx.annotation.NonNull; + import ja.burhanrashid52.photoeditor.PhotoFilter; public class FilterItem { @@ -14,7 +16,7 @@ public class FilterItem { * @param imageId - id of image to be set * @param name - filter mName */ - public FilterItem(int imageId, String name, PhotoFilter filter) { + public FilterItem(int imageId, @NonNull String name, @NonNull PhotoFilter filter) { this.mImageId = imageId; this.mName = name; this.mFilter = filter; @@ -28,19 +30,21 @@ public void setImageId(int imageId) { this.mImageId = imageId; } + @NonNull public String getName() { return mName; } - public void setName(String name) { + public void setName(@NonNull String name) { this.mName = name; } + @NonNull public PhotoFilter getFilter() { return mFilter; } - public void setFilter(PhotoFilter filter) { + public void setFilter(@NonNull PhotoFilter filter) { this.mFilter = filter; } } diff --git a/app/src/main/java/swati4star/createpdf/model/ImageToPDFOptions.java b/app/src/main/java/swati4star/createpdf/model/ImageToPDFOptions.java index e1995577d..3a458da2a 100644 --- a/app/src/main/java/swati4star/createpdf/model/ImageToPDFOptions.java +++ b/app/src/main/java/swati4star/createpdf/model/ImageToPDFOptions.java @@ -1,5 +1,7 @@ package swati4star.createpdf.model; +import androidx.annotation.NonNull; + import java.util.ArrayList; public class ImageToPDFOptions extends PDFOptions { @@ -21,10 +23,10 @@ public ImageToPDFOptions() { setBorderWidth(0); } - public ImageToPDFOptions(String mFileName, String mPageSize, boolean mPasswordProtected, - String mPassword, String mQualityString, int mBorderWidth, - String masterPwd, ArrayList mImagesUri, - boolean mWatermarkAdded, Watermark mWatermark, int pageColor) { + public ImageToPDFOptions(@NonNull String mFileName, @NonNull String mPageSize, boolean mPasswordProtected, + @NonNull String mPassword, @NonNull String mQualityString, int mBorderWidth, + @NonNull String masterPwd, @NonNull ArrayList mImagesUri, + boolean mWatermarkAdded, @NonNull Watermark mWatermark, int pageColor) { super(mFileName, mPageSize, mPasswordProtected, mPassword, mBorderWidth, mWatermarkAdded, mWatermark, pageColor); this.mQualityString = mQualityString; @@ -32,19 +34,21 @@ public ImageToPDFOptions(String mFileName, String mPageSize, boolean mPasswordPr this.mMasterPwd = masterPwd; } + @NonNull public String getQualityString() { return mQualityString; } - public void setQualityString(String mQualityString) { + public void setQualityString(@NonNull String mQualityString) { this.mQualityString = mQualityString; } + @NonNull public ArrayList getImagesUri() { return mImagesUri; } - public void setImagesUri(ArrayList mImagesUri) { + public void setImagesUri(@NonNull ArrayList mImagesUri) { this.mImagesUri = mImagesUri; } @@ -71,27 +75,30 @@ public int getMarginLeft() { return mMarginLeft; } + @NonNull public String getImageScaleType() { return mImageScaleType; } - public void setImageScaleType(String mImageScaleType) { + public void setImageScaleType(@NonNull String mImageScaleType) { this.mImageScaleType = mImageScaleType; } + @NonNull public String getPageNumStyle() { return mPageNumStyle; } - public void setPageNumStyle(String mPageNumStyle) { + public void setPageNumStyle(@NonNull String mPageNumStyle) { this.mPageNumStyle = mPageNumStyle; } + @NonNull public String getMasterPwd() { return mMasterPwd; } - public void setMasterPwd(String pwd) { + public void setMasterPwd(@NonNull String pwd) { this.mMasterPwd = pwd; } } diff --git a/app/src/main/java/swati4star/createpdf/model/PDFFile.java b/app/src/main/java/swati4star/createpdf/model/PDFFile.java index dbb0a1634..9b0acb04c 100644 --- a/app/src/main/java/swati4star/createpdf/model/PDFFile.java +++ b/app/src/main/java/swati4star/createpdf/model/PDFFile.java @@ -1,21 +1,24 @@ package swati4star.createpdf.model; +import androidx.annotation.NonNull; + import java.io.File; public class PDFFile { private File mPdfFile; private boolean mIsEncrypted; - public PDFFile(File mPdfFile, boolean mIsEncrypted) { + public PDFFile(@NonNull File mPdfFile, boolean mIsEncrypted) { this.mPdfFile = mPdfFile; this.mIsEncrypted = mIsEncrypted; } + @NonNull public File getPdfFile() { return mPdfFile; } - public void setPdfFile(File mPdfFile) { + public void setPdfFile(@NonNull File mPdfFile) { this.mPdfFile = mPdfFile; } diff --git a/app/src/main/java/swati4star/createpdf/model/PDFOptions.java b/app/src/main/java/swati4star/createpdf/model/PDFOptions.java index 299c6d816..47be086fb 100644 --- a/app/src/main/java/swati4star/createpdf/model/PDFOptions.java +++ b/app/src/main/java/swati4star/createpdf/model/PDFOptions.java @@ -1,5 +1,7 @@ package swati4star.createpdf.model; +import androidx.annotation.NonNull; + public class PDFOptions { private String mOutFileName; @@ -27,19 +29,21 @@ public class PDFOptions { this.mPageColor = pageColor; } + @NonNull public String getOutFileName() { return mOutFileName; } - public void setOutFileName(String mOutFileName) { + public void setOutFileName(@NonNull String mOutFileName) { this.mOutFileName = mOutFileName; } + @NonNull public String getPageSize() { return mPageSize; } - public void setPageSize(String mPageSize) { + public void setPageSize(@NonNull String mPageSize) { this.mPageSize = mPageSize; } @@ -51,11 +55,12 @@ public void setPasswordProtected(boolean mPasswordProtected) { this.mPasswordProtected = mPasswordProtected; } + @NonNull public String getPassword() { return mPassword; } - public void setPassword(String mPassword) { + public void setPassword(@NonNull String mPassword) { this.mPassword = mPassword; } @@ -75,11 +80,12 @@ public void setWatermarkAdded(boolean mWatermarkAdded) { this.mWatermarkAdded = mWatermarkAdded; } + @NonNull public Watermark getWatermark() { return this.mWatermark; } - public void setWatermark(Watermark mWatermark) { + public void setWatermark(@NonNull Watermark mWatermark) { this.mWatermark = mWatermark; } diff --git a/app/src/main/java/swati4star/createpdf/model/PreviewImageOptionItem.java b/app/src/main/java/swati4star/createpdf/model/PreviewImageOptionItem.java index a12eda43d..bd379b852 100644 --- a/app/src/main/java/swati4star/createpdf/model/PreviewImageOptionItem.java +++ b/app/src/main/java/swati4star/createpdf/model/PreviewImageOptionItem.java @@ -1,10 +1,12 @@ package swati4star.createpdf.model; +import androidx.annotation.NonNull; + public class PreviewImageOptionItem { private int mOptionImageId; private String mOptionName; - public PreviewImageOptionItem(int mOptionImageId, String mOptionName) { + public PreviewImageOptionItem(int mOptionImageId, @NonNull String mOptionName) { this.mOptionImageId = mOptionImageId; this.mOptionName = mOptionName; } @@ -17,11 +19,12 @@ public void setOptionImageId(int mOptionImageId) { this.mOptionImageId = mOptionImageId; } + @NonNull public String getOptionName() { return mOptionName; } - public void setOptionName(String mOptionName) { + public void setOptionName(@NonNull String mOptionName) { this.mOptionName = mOptionName; } } diff --git a/app/src/main/java/swati4star/createpdf/model/TextToPDFOptions.java b/app/src/main/java/swati4star/createpdf/model/TextToPDFOptions.java index 63c5b6c89..413d0c4d9 100644 --- a/app/src/main/java/swati4star/createpdf/model/TextToPDFOptions.java +++ b/app/src/main/java/swati4star/createpdf/model/TextToPDFOptions.java @@ -3,6 +3,8 @@ import android.content.Context; import android.net.Uri; +import androidx.annotation.NonNull; + import com.itextpdf.text.Font; import swati4star.createpdf.preferences.TextToPdfPreferences; @@ -13,8 +15,8 @@ public class TextToPDFOptions extends PDFOptions { private final Font.FontFamily mFontFamily; private final int mFontColor; - public TextToPDFOptions(String mFileName, String mPageSize, boolean mPasswordProtected, - String mPassword, Uri mInFileUri, int mFontSize, Font.FontFamily mFontFamily, int color, + public TextToPDFOptions(@NonNull String mFileName, @NonNull String mPageSize, boolean mPasswordProtected, + @NonNull String mPassword, @NonNull Uri mInFileUri, int mFontSize, @NonNull Font.FontFamily mFontFamily, int color, int pageColor) { super(mFileName, mPageSize, mPasswordProtected, mPassword, 0, false, null, pageColor); this.mInFileUri = mInFileUri; @@ -23,6 +25,7 @@ public TextToPDFOptions(String mFileName, String mPageSize, boolean mPasswordPro this.mFontColor = color; } + @NonNull public Uri getInFileUri() { return mInFileUri; } @@ -31,6 +34,7 @@ public int getFontSize() { return mFontSize; } + @NonNull public Font.FontFamily getFontFamily() { return mFontFamily; } @@ -52,7 +56,7 @@ public static class Builder { private int mFontColor; private String mFontSizeTitle; - public Builder(Context context) { + public Builder(@NonNull Context context) { final TextToPdfPreferences preferences = new TextToPdfPreferences(context); mPageSize = preferences.getPageSize(); mPasswordProtected = false; @@ -62,20 +66,24 @@ public Builder(Context context) { mPageColor = preferences.getPageColor(); } + @NonNull public String getFileName() { return mFileName; } - public Builder setFileName(String fileName) { + @NonNull + public Builder setFileName(@NonNull String fileName) { mFileName = fileName; return this; } + @NonNull public String getPageSize() { return mPageSize; } - public Builder setPageSize(String pageSize) { + @NonNull + public Builder setPageSize(@NonNull String pageSize) { mPageSize = pageSize; return this; } @@ -84,16 +92,19 @@ public boolean isPasswordProtected() { return mPasswordProtected; } + @NonNull public Builder setPasswordProtected(boolean passwordProtected) { mPasswordProtected = passwordProtected; return this; } + @NonNull public String getPassword() { return mPassword; } - public Builder setPassword(String password) { + @NonNull + public Builder setPassword(@NonNull String password) { mPassword = password; return this; } @@ -102,16 +113,19 @@ public int getPageColor() { return mPageColor; } + @NonNull public Builder setPageColor(int pageColor) { mPageColor = pageColor; return this; } + @NonNull public Uri getInFileUri() { return mInFileUri; } - public Builder setInFileUri(Uri inFileUri) { + @NonNull + public Builder setInFileUri(@NonNull Uri inFileUri) { mInFileUri = inFileUri; return this; } @@ -120,16 +134,19 @@ public int getFontSize() { return mFontSize; } + @NonNull public Builder setFontSize(int fontSize) { mFontSize = fontSize; return this; } + @NonNull public Font.FontFamily getFontFamily() { return mFontFamily; } - public Builder setFontFamily(Font.FontFamily fontFamily) { + @NonNull + public Builder setFontFamily(@NonNull Font.FontFamily fontFamily) { mFontFamily = fontFamily; return this; } @@ -138,20 +155,24 @@ public int getFontColor() { return mFontColor; } + @NonNull public Builder setFontColor(int fontColor) { mFontColor = fontColor; return this; } + @NonNull public String getFontSizeTitle() { return mFontSizeTitle; } - public Builder setFontSizeTitle(String fontSizeTitle) { + @NonNull + public Builder setFontSizeTitle(@NonNull String fontSizeTitle) { mFontSizeTitle = fontSizeTitle; return this; } + @NonNull public TextToPDFOptions build() { return new TextToPDFOptions(mFileName, mPageSize, mPasswordProtected, mPassword, mInFileUri, mFontSize, mFontFamily, mFontColor, mPageColor); diff --git a/app/src/main/java/swati4star/createpdf/model/Watermark.java b/app/src/main/java/swati4star/createpdf/model/Watermark.java index 4a21f0f77..0ad6b993a 100644 --- a/app/src/main/java/swati4star/createpdf/model/Watermark.java +++ b/app/src/main/java/swati4star/createpdf/model/Watermark.java @@ -1,5 +1,7 @@ package swati4star.createpdf.model; +import androidx.annotation.NonNull; + import com.itextpdf.text.BaseColor; import com.itextpdf.text.Font; @@ -11,11 +13,12 @@ public class Watermark { private Font.FontFamily mFontFamily; private int mFontStyle; + @NonNull public String getWatermarkText() { return mWatermarkText; } - public void setWatermarkText(String watermarkText) { + public void setWatermarkText(@NonNull String watermarkText) { this.mWatermarkText = watermarkText; } @@ -27,11 +30,12 @@ public void setRotationAngle(int rotationAngle) { this.mRotationAngle = rotationAngle; } + @NonNull public BaseColor getTextColor() { return mTextColor; } - public void setTextColor(BaseColor textColor) { + public void setTextColor(@NonNull BaseColor textColor) { this.mTextColor = textColor; } @@ -43,11 +47,12 @@ public void setTextSize(int textSize) { this.mTextSize = textSize; } + @NonNull public Font.FontFamily getFontFamily() { return mFontFamily; } - public void setFontFamily(Font.FontFamily fontFamily) { + public void setFontFamily(@NonNull Font.FontFamily fontFamily) { this.mFontFamily = fontFamily; } diff --git a/app/src/main/java/swati4star/createpdf/model/WhatsNew.java b/app/src/main/java/swati4star/createpdf/model/WhatsNew.java index 6374970e8..46b38d259 100644 --- a/app/src/main/java/swati4star/createpdf/model/WhatsNew.java +++ b/app/src/main/java/swati4star/createpdf/model/WhatsNew.java @@ -1,38 +1,43 @@ package swati4star.createpdf.model; +import androidx.annotation.NonNull; + public class WhatsNew { private String mTitle; private String mDescription; private String mIcon; - public WhatsNew(String title, String description, String icon) { + public WhatsNew(@NonNull String title, @NonNull String description, @NonNull String icon) { this.mTitle = title; this.mDescription = description; this.mIcon = icon; } + @NonNull public String getTitle() { return mTitle; } - public void setTitle(String title) { + public void setTitle(@NonNull String title) { this.mTitle = title; } + @NonNull public String getDescription() { return mDescription; } - public void setDescription(String description) { + public void setDescription(@NonNull String description) { this.mDescription = description; } + @NonNull public String getIcon() { return mIcon; } - public void setIcon(String icon) { + public void setIcon(@NonNull String icon) { this.mIcon = icon; } } diff --git a/app/src/main/java/swati4star/createpdf/preferences/TextToPdfPreferences.java b/app/src/main/java/swati4star/createpdf/preferences/TextToPdfPreferences.java index 014ec7dcf..954fd40c9 100644 --- a/app/src/main/java/swati4star/createpdf/preferences/TextToPdfPreferences.java +++ b/app/src/main/java/swati4star/createpdf/preferences/TextToPdfPreferences.java @@ -66,6 +66,7 @@ public void setPageColor(final int pageColor) { /** * @return the default font family. */ + @NonNull public String getFontFamily() { return mSharedPreferences.getString(Constants.DEFAULT_FONT_FAMILY_TEXT, Constants.DEFAULT_FONT_FAMILY); @@ -103,6 +104,7 @@ public void setFontSize(final int fontSize) { /** * @return the default page size. */ + @NonNull public String getPageSize() { return mSharedPreferences.getString(Constants.DEFAULT_PAGE_SIZE_TEXT, Constants.DEFAULT_PAGE_SIZE); } diff --git a/app/src/main/java/swati4star/createpdf/providers/fragmentmanagement/FragmentManagement.java b/app/src/main/java/swati4star/createpdf/providers/fragmentmanagement/FragmentManagement.java index 61ea2ede9..7f843eb46 100644 --- a/app/src/main/java/swati4star/createpdf/providers/fragmentmanagement/FragmentManagement.java +++ b/app/src/main/java/swati4star/createpdf/providers/fragmentmanagement/FragmentManagement.java @@ -22,6 +22,7 @@ import android.os.Bundle; import android.widget.Toast; +import androidx.annotation.NonNull; import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentActivity; import androidx.fragment.app.FragmentManager; @@ -68,7 +69,7 @@ public class FragmentManagement implements IFragmentManagement { private final FragmentUtils mFragmentUtils; private boolean mDoubleBackToExitPressedOnce = false; - public FragmentManagement(FragmentActivity context, NavigationView navigationView) { + public FragmentManagement(@NonNull FragmentActivity context, @NonNull NavigationView navigationView) { mContext = context; mNavigationView = navigationView; mFeedbackUtils = new FeedbackUtils(mContext); @@ -88,6 +89,7 @@ public void favouritesFragmentOption() { transaction.commit(); } + @NonNull public Fragment checkForAppShortcutClicked() { Fragment fragment = new HomeFragment(); if (mContext.getIntent().getAction() != null) { diff --git a/app/src/main/java/swati4star/createpdf/util/AddTextEnhancementOptionsUtils.java b/app/src/main/java/swati4star/createpdf/util/AddTextEnhancementOptionsUtils.java index 38b8d6f3d..2b983dded 100644 --- a/app/src/main/java/swati4star/createpdf/util/AddTextEnhancementOptionsUtils.java +++ b/app/src/main/java/swati4star/createpdf/util/AddTextEnhancementOptionsUtils.java @@ -2,6 +2,8 @@ import android.content.Context; +import androidx.annotation.NonNull; + import com.itextpdf.text.Font; import java.util.ArrayList; @@ -15,13 +17,15 @@ private AddTextEnhancementOptionsUtils() { } + @NonNull public static AddTextEnhancementOptionsUtils getInstance() { return SingletonHolder.INSTANCE; } - public ArrayList getEnhancementOptions(Context context, - String fontTitle, - Font.FontFamily fontFamily) { + @NonNull + public ArrayList getEnhancementOptions(@NonNull Context context, + @NonNull String fontTitle, + @NonNull Font.FontFamily fontFamily) { ArrayList options = new ArrayList<>(); options.add(new EnhancementOptionsEntity( diff --git a/app/src/main/java/swati4star/createpdf/util/BottomSheetCallback.java b/app/src/main/java/swati4star/createpdf/util/BottomSheetCallback.java index 6c3c27c85..bcbfced2d 100644 --- a/app/src/main/java/swati4star/createpdf/util/BottomSheetCallback.java +++ b/app/src/main/java/swati4star/createpdf/util/BottomSheetCallback.java @@ -13,7 +13,7 @@ public class BottomSheetCallback extends BottomSheetBehavior.BottomSheetCallback private final ImageView mUpArrow; private final boolean mIsAdded; - public BottomSheetCallback(ImageView mUpArrow, boolean mIsFragmentAdded) { + public BottomSheetCallback(@NonNull ImageView mUpArrow, boolean mIsFragmentAdded) { this.mUpArrow = mUpArrow; this.mIsAdded = mIsFragmentAdded; } diff --git a/app/src/main/java/swati4star/createpdf/util/BottomSheetUtils.java b/app/src/main/java/swati4star/createpdf/util/BottomSheetUtils.java index dab5f60be..0560a7028 100644 --- a/app/src/main/java/swati4star/createpdf/util/BottomSheetUtils.java +++ b/app/src/main/java/swati4star/createpdf/util/BottomSheetUtils.java @@ -2,6 +2,8 @@ import android.app.Activity; +import androidx.annotation.NonNull; + import com.google.android.material.bottomsheet.BottomSheetBehavior; import swati4star.createpdf.interfaces.BottomSheetPopulate; @@ -10,11 +12,11 @@ public class BottomSheetUtils { private final Activity mContext; - public BottomSheetUtils(Activity context) { + public BottomSheetUtils(@NonNull Activity context) { this.mContext = context; } - public void showHideSheet(BottomSheetBehavior sheetBehavior) { + public void showHideSheet(@NonNull BottomSheetBehavior sheetBehavior) { if (sheetBehavior.getState() != BottomSheetBehavior.STATE_EXPANDED) { sheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED); } else { @@ -22,7 +24,7 @@ public void showHideSheet(BottomSheetBehavior sheetBehavior) { } } - public void populateBottomSheetWithPDFs(BottomSheetPopulate listener) { + public void populateBottomSheetWithPDFs(@NonNull BottomSheetPopulate listener) { new PopulateBottomSheetList(listener, new DirectoryUtils(mContext)).execute(); } @@ -32,7 +34,7 @@ public void populateBottomSheetWithPDFs(BottomSheetPopulate listener) { * @param listener a bottom sheet listener used to inform the caller when the list of files * is available */ - public void populateBottomSheetWithExcelFiles(BottomSheetPopulate listener) { + public void populateBottomSheetWithExcelFiles(@NonNull BottomSheetPopulate listener) { new PopulateBottomSheetListWithExcelFiles(listener, new DirectoryUtils(mContext)).execute(); } diff --git a/app/src/main/java/swati4star/createpdf/util/BrushUtils.java b/app/src/main/java/swati4star/createpdf/util/BrushUtils.java index f49f3b14e..edc079bb1 100644 --- a/app/src/main/java/swati4star/createpdf/util/BrushUtils.java +++ b/app/src/main/java/swati4star/createpdf/util/BrushUtils.java @@ -1,5 +1,7 @@ package swati4star.createpdf.util; +import androidx.annotation.NonNull; + import java.util.ArrayList; import swati4star.createpdf.R; @@ -11,10 +13,12 @@ private BrushUtils() { } + @NonNull public static BrushUtils getInstance() { return BrushUtils.SingletonHolder.INSTANCE; } + @NonNull public ArrayList getBrushItems() { ArrayList brushItems = new ArrayList<>(); brushItems.add(new BrushItem(R.color.mb_white)); diff --git a/app/src/main/java/swati4star/createpdf/util/ColorUtils.java b/app/src/main/java/swati4star/createpdf/util/ColorUtils.java index cf94cf734..ce6d71a97 100644 --- a/app/src/main/java/swati4star/createpdf/util/ColorUtils.java +++ b/app/src/main/java/swati4star/createpdf/util/ColorUtils.java @@ -2,6 +2,8 @@ import android.graphics.Color; +import androidx.annotation.NonNull; + public class ColorUtils { private static final double COLOR_DIFF_THRESHOLD = 30.0; @@ -9,6 +11,7 @@ public class ColorUtils { private ColorUtils() { } + @NonNull public static ColorUtils getInstance() { return ColorUtils.SingletonHolder.INSTANCE; } diff --git a/app/src/main/java/swati4star/createpdf/util/CommonCodeUtils.java b/app/src/main/java/swati4star/createpdf/util/CommonCodeUtils.java index ac9fe93d6..8bcbf4ef5 100644 --- a/app/src/main/java/swati4star/createpdf/util/CommonCodeUtils.java +++ b/app/src/main/java/swati4star/createpdf/util/CommonCodeUtils.java @@ -90,6 +90,7 @@ import android.widget.RelativeLayout; import android.widget.TextView; +import androidx.annotation.NonNull; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; @@ -110,6 +111,7 @@ public class CommonCodeUtils { Map mFragmentPositionMap; + @NonNull public static CommonCodeUtils getInstance() { return CommonCodeUtils.SingletonHolder.INSTANCE; } @@ -118,10 +120,10 @@ public static CommonCodeUtils getInstance() { * updates the output recycler view if paths.size > 0 * else give the main view */ - public void populateUtil(Activity mActivity, ArrayList paths, - MergeFilesAdapter.OnClickListener onClickListener, - RelativeLayout layout, LottieAnimationView animationView, - RecyclerView recyclerView) { + public void populateUtil(@NonNull Activity mActivity, @NonNull ArrayList paths, + @NonNull MergeFilesAdapter.OnClickListener onClickListener, + @NonNull RelativeLayout layout, @NonNull LottieAnimationView animationView, + @NonNull RecyclerView recyclerView) { if (paths == null || paths.size() == 0) { layout.setVisibility(View.GONE); @@ -141,9 +143,9 @@ public void populateUtil(Activity mActivity, ArrayList paths, /** * sets the appropriate text to success Text View & display images in adapter */ - public void updateView(Activity mActivity, int imageCount, ArrayList outputFilePaths, - TextView successTextView, LinearLayout options, RecyclerView mCreatedImages, - ExtractImagesAdapter.OnFileItemClickedListener listener) { + public void updateView(@NonNull Activity mActivity, int imageCount, @NonNull ArrayList outputFilePaths, + @NonNull TextView successTextView, @NonNull LinearLayout options, @NonNull RecyclerView mCreatedImages, + @NonNull ExtractImagesAdapter.OnFileItemClickedListener listener) { if (imageCount == 0) { StringUtils.getInstance().showSnackbar(mActivity, R.string.extract_images_failed); @@ -169,7 +171,7 @@ public void updateView(Activity mActivity, int imageCount, ArrayList out * Closes the bottom sheet if it is expanded */ - public void closeBottomSheetUtil(BottomSheetBehavior sheetBehavior) { + public void closeBottomSheetUtil(@NonNull BottomSheetBehavior sheetBehavior) { if (checkSheetBehaviourUtil(sheetBehavior)) sheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED); } @@ -177,7 +179,7 @@ public void closeBottomSheetUtil(BottomSheetBehavior sheetBehavior) { /** * Checks whether the bottom sheet is expanded or collapsed */ - public boolean checkSheetBehaviourUtil(BottomSheetBehavior sheetBehavior) { + public boolean checkSheetBehaviourUtil(@NonNull BottomSheetBehavior sheetBehavior) { return sheetBehavior.getState() == BottomSheetBehavior.STATE_EXPANDED; } @@ -186,6 +188,7 @@ private void addFragmentPosition(boolean homePageItems, int iconA, int iconB, mFragmentPositionMap.put(homePageItems ? iconA : iconB, new HomePageItem(iconId, drawableId, titleString)); } + @NonNull public Map fillNavigationItemsMap(boolean homePageItems) { mFragmentPositionMap = new HashMap<>(); addFragmentPosition(homePageItems, R.id.images_to_pdf, diff --git a/app/src/main/java/swati4star/createpdf/util/CreatePdf.java b/app/src/main/java/swati4star/createpdf/util/CreatePdf.java index ee28fc595..c161aa9e1 100644 --- a/app/src/main/java/swati4star/createpdf/util/CreatePdf.java +++ b/app/src/main/java/swati4star/createpdf/util/CreatePdf.java @@ -55,8 +55,8 @@ public class CreatePdf extends AsyncTask { private boolean mSuccess; private String mPath; - public CreatePdf(ImageToPDFOptions mImageToPDFOptions, String parentPath, - OnPDFCreatedInterface onPDFCreated) { + public CreatePdf(@NonNull ImageToPDFOptions mImageToPDFOptions, @NonNull String parentPath, + @NonNull OnPDFCreatedInterface onPDFCreated) { this.mImagesUri = mImageToPDFOptions.getImagesUri(); this.mFileName = mImageToPDFOptions.getOutFileName(); this.mPassword = mImageToPDFOptions.getPassword(); diff --git a/app/src/main/java/swati4star/createpdf/util/DialogUtils.java b/app/src/main/java/swati4star/createpdf/util/DialogUtils.java index d8cd7afdf..d1a634c7d 100644 --- a/app/src/main/java/swati4star/createpdf/util/DialogUtils.java +++ b/app/src/main/java/swati4star/createpdf/util/DialogUtils.java @@ -11,6 +11,7 @@ import android.view.View; import android.widget.TextView; +import androidx.annotation.NonNull; import androidx.appcompat.app.AlertDialog; import com.afollestad.materialdialogs.MaterialDialog; @@ -26,6 +27,7 @@ public class DialogUtils { private DialogUtils() { } + @NonNull public static DialogUtils getInstance() { return DialogUtils.SingletonHolder.INSTANCE; } @@ -37,7 +39,8 @@ public static DialogUtils getInstance() { * @param content - content resource id * @return - material dialog builder */ - public MaterialDialog.Builder createWarningDialog(Activity activity, + @NonNull + public MaterialDialog.Builder createWarningDialog(@NonNull Activity activity, int content) { return new MaterialDialog.Builder(activity) .title(R.string.warning) @@ -52,7 +55,8 @@ public MaterialDialog.Builder createWarningDialog(Activity activity, * @param activity - activity instance * @return - material dialog builder */ - public MaterialDialog.Builder createOverwriteDialog(Activity activity) { + @NonNull + public MaterialDialog.Builder createOverwriteDialog(@NonNull Activity activity) { return new MaterialDialog.Builder(activity) .title(R.string.warning) .content(R.string.overwrite_message) @@ -68,7 +72,8 @@ public MaterialDialog.Builder createOverwriteDialog(Activity activity) { * @param content - content resource id * @return - material dialog builder */ - public MaterialDialog.Builder createCustomDialog(Activity activity, + @NonNull + public MaterialDialog.Builder createCustomDialog(@NonNull Activity activity, int title, int content) { return new MaterialDialog.Builder(activity) .title(title) @@ -84,7 +89,8 @@ public MaterialDialog.Builder createCustomDialog(Activity activity, * @param title - dialog title resource id * @return - material dialog builder */ - public MaterialDialog.Builder createCustomDialogWithoutContent(Activity activity, + @NonNull + public MaterialDialog.Builder createCustomDialogWithoutContent(@NonNull Activity activity, int title) { return new MaterialDialog.Builder(activity) .title(title) @@ -98,7 +104,8 @@ public MaterialDialog.Builder createCustomDialogWithoutContent(Activity activity * @param activity - activity instance * @return - material dialog */ - public MaterialDialog createAnimationDialog(Activity activity) { + @NonNull + public MaterialDialog createAnimationDialog(@NonNull Activity activity) { return new MaterialDialog.Builder(activity) .customView(R.layout.lottie_anim_dialog, false) .build(); @@ -111,7 +118,8 @@ public MaterialDialog createAnimationDialog(Activity activity) { * @param title - dialog message * @return - material dialog */ - public MaterialDialog createCustomAnimationDialog(Activity activity, String title) { + @NonNull + public MaterialDialog createCustomAnimationDialog(@NonNull Activity activity, @NonNull String title) { View view = LayoutInflater.from(activity).inflate(R.layout.lottie_anim_dialog, null); TextView dialogTitle = view.findViewById(R.id.textView); @@ -123,7 +131,7 @@ public MaterialDialog createCustomAnimationDialog(Activity activity, String titl } - public void showFilesInfoDialog(Activity activity, int dialogId) { + public void showFilesInfoDialog(@NonNull Activity activity, int dialogId) { int stringId = R.string.viewfiles_rotatepages; switch (dialogId) { case ROTATE_PAGES: @@ -148,13 +156,13 @@ public void showFilesInfoDialog(Activity activity, int dialogId) { } public static void showChoiceDialog( - Context context, + @NonNull Context context, int title, int message, int positiveButtonLabel, int negativeButtonLabel, boolean cancelable, - final DialogCallbacks callbacks + final @NonNull DialogCallbacks callbacks ) { new AlertDialog.Builder(context) .setTitle(title == EMPTY_STRING ? "" : context.getString(title)) diff --git a/app/src/main/java/swati4star/createpdf/util/DirectoryUtils.java b/app/src/main/java/swati4star/createpdf/util/DirectoryUtils.java index 59041588c..eb9a0bc61 100644 --- a/app/src/main/java/swati4star/createpdf/util/DirectoryUtils.java +++ b/app/src/main/java/swati4star/createpdf/util/DirectoryUtils.java @@ -10,6 +10,8 @@ import android.os.Environment; import android.preference.PreferenceManager; +import androidx.annotation.NonNull; + import java.io.File; import java.util.ArrayList; import java.util.Arrays; @@ -26,7 +28,7 @@ public class DirectoryUtils { private final SharedPreferences mSharedPreferences; private ArrayList mFilePaths; - public DirectoryUtils(Context context) { + public DirectoryUtils(@NonNull Context context) { mContext = context; mSharedPreferences = PreferenceManager.getDefaultSharedPreferences(context); } @@ -142,6 +144,7 @@ private boolean isPDFAndNotDirectory(File file) { /** * create PDF directory if directory does not exists */ + @NonNull public File getOrCreatePdfDirectory() { File folder = new File(mSharedPreferences.getString(STORAGE_LOCATION, StringUtils.getInstance().getDefaultStorageLocation())); @@ -155,6 +158,7 @@ public File getOrCreatePdfDirectory() { * * @return ArrayList of PDF files */ + @NonNull public ArrayList getPdfFromOtherDirectories() { mFilePaths = new ArrayList<>(); walkDir(getOrCreatePdfDirectory()); diff --git a/app/src/main/java/swati4star/createpdf/util/DocFileReader.java b/app/src/main/java/swati4star/createpdf/util/DocFileReader.java index 7a972eb02..ab4c79560 100644 --- a/app/src/main/java/swati4star/createpdf/util/DocFileReader.java +++ b/app/src/main/java/swati4star/createpdf/util/DocFileReader.java @@ -3,6 +3,8 @@ import android.content.Context; import android.net.Uri; +import androidx.annotation.NonNull; + import com.itextpdf.text.Document; import com.itextpdf.text.Element; import com.itextpdf.text.Font; @@ -15,13 +17,13 @@ public class DocFileReader extends FileReader { - public DocFileReader(Context context) { + public DocFileReader(@NonNull Context context) { super(context); } @Override protected void createDocumentFromStream( - Uri uri, Document document, Font myfont, InputStream inputStream) throws Exception { + @NonNull Uri uri, @NonNull Document document, @NonNull Font myfont, @NonNull InputStream inputStream) throws Exception { HWPFDocument doc = new HWPFDocument(inputStream); WordExtractor extractor = new WordExtractor(doc); String fileData = extractor.getText(); diff --git a/app/src/main/java/swati4star/createpdf/util/DocxFileReader.java b/app/src/main/java/swati4star/createpdf/util/DocxFileReader.java index 427028de4..96c7f0ad3 100644 --- a/app/src/main/java/swati4star/createpdf/util/DocxFileReader.java +++ b/app/src/main/java/swati4star/createpdf/util/DocxFileReader.java @@ -3,6 +3,8 @@ import android.content.Context; import android.net.Uri; +import androidx.annotation.NonNull; + import com.itextpdf.text.Document; import com.itextpdf.text.Element; import com.itextpdf.text.Font; @@ -15,13 +17,13 @@ public class DocxFileReader extends FileReader { - public DocxFileReader(Context context) { + public DocxFileReader(@NonNull Context context) { super(context); } @Override protected void createDocumentFromStream( - Uri uri, Document document, Font myfont, InputStream inputStream) throws Exception { + @NonNull Uri uri, @NonNull Document document, @NonNull Font myfont, @NonNull InputStream inputStream) throws Exception { XWPFDocument doc = new XWPFDocument(inputStream); XWPFWordExtractor extractor = new XWPFWordExtractor(doc); diff --git a/app/src/main/java/swati4star/createpdf/util/ExcelToPDFAsync.java b/app/src/main/java/swati4star/createpdf/util/ExcelToPDFAsync.java index ef503f3ca..3e204466b 100644 --- a/app/src/main/java/swati4star/createpdf/util/ExcelToPDFAsync.java +++ b/app/src/main/java/swati4star/createpdf/util/ExcelToPDFAsync.java @@ -2,6 +2,8 @@ import android.os.AsyncTask; +import androidx.annotation.NonNull; + import com.aspose.cells.FileFormatType; import com.aspose.cells.PdfSaveOptions; import com.aspose.cells.PdfSecurityOptions; @@ -25,8 +27,8 @@ public class ExcelToPDFAsync extends AsyncTask { * @param destPath is the path of the destination pdf file. * @param onPDFCreated is the onPDFCreatedInterface instance. */ - public ExcelToPDFAsync(String parentPath, String destPath, - OnPDFCreatedInterface onPDFCreated, boolean isPasswordProtected, String password) { + public ExcelToPDFAsync(@NonNull String parentPath, @NonNull String destPath, + @NonNull OnPDFCreatedInterface onPDFCreated, boolean isPasswordProtected, @NonNull String password) { mPath = parentPath; mDestPath = destPath; this.mOnPDFCreatedInterface = onPDFCreated; diff --git a/app/src/main/java/swati4star/createpdf/util/ExtractImages.java b/app/src/main/java/swati4star/createpdf/util/ExtractImages.java index 4426a2203..d5373a754 100644 --- a/app/src/main/java/swati4star/createpdf/util/ExtractImages.java +++ b/app/src/main/java/swati4star/createpdf/util/ExtractImages.java @@ -7,6 +7,8 @@ import android.graphics.BitmapFactory; import android.os.AsyncTask; +import androidx.annotation.NonNull; + import com.itextpdf.text.pdf.PRStream; import com.itextpdf.text.pdf.PdfName; import com.itextpdf.text.pdf.PdfObject; @@ -24,7 +26,7 @@ public class ExtractImages extends AsyncTask { private int mImagesCount = 0; private ArrayList mOutputFilePaths; - public ExtractImages(String mPath, ExtractImagesListener mExtractImagesListener) { + public ExtractImages(@NonNull String mPath, @NonNull ExtractImagesListener mExtractImagesListener) { this.mPath = mPath; this.mExtractImagesListener = mExtractImagesListener; mOutputFilePaths = new ArrayList<>(); diff --git a/app/src/main/java/swati4star/createpdf/util/FavouritesPreferences.java b/app/src/main/java/swati4star/createpdf/util/FavouritesPreferences.java index 66f658f74..fb51e6978 100644 --- a/app/src/main/java/swati4star/createpdf/util/FavouritesPreferences.java +++ b/app/src/main/java/swati4star/createpdf/util/FavouritesPreferences.java @@ -4,6 +4,7 @@ import android.content.SharedPreferences; import android.os.Bundle; +import androidx.annotation.NonNull; import androidx.preference.PreferenceFragmentCompat; import swati4star.createpdf.R; @@ -12,7 +13,7 @@ public class FavouritesPreferences extends PreferenceFragmentCompat implements SharedPreferences.OnSharedPreferenceChangeListener { @Override - public void onCreatePreferences(Bundle bundle, String s) { + public void onCreatePreferences(@NonNull Bundle bundle, @NonNull String s) { addPreferencesFromResource(R.xml.favourites_preferences); } @@ -21,7 +22,7 @@ public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, Strin } @Override - public void onCreate(Bundle savedInstanceState) { + public void onCreate(@NonNull Bundle savedInstanceState) { super.onCreate(savedInstanceState); getPreferenceScreen().getSharedPreferences() .registerOnSharedPreferenceChangeListener(this); diff --git a/app/src/main/java/swati4star/createpdf/util/FeedbackUtils.java b/app/src/main/java/swati4star/createpdf/util/FeedbackUtils.java index 9654ceb1f..f80736b43 100644 --- a/app/src/main/java/swati4star/createpdf/util/FeedbackUtils.java +++ b/app/src/main/java/swati4star/createpdf/util/FeedbackUtils.java @@ -9,6 +9,8 @@ import android.net.Uri; import android.preference.PreferenceManager; +import androidx.annotation.NonNull; + import swati4star.createpdf.R; public class FeedbackUtils { @@ -16,7 +18,7 @@ public class FeedbackUtils { private final Activity mContext; private final SharedPreferences mSharedPreferences; - public FeedbackUtils(Activity context) { + public FeedbackUtils(@NonNull Activity context) { this.mContext = context; mSharedPreferences = PreferenceManager.getDefaultSharedPreferences(context); } @@ -31,7 +33,7 @@ public void shareApplication() { openMailIntent(intent); } - public void openMailIntent(Intent intent) { + public void openMailIntent(@NonNull Intent intent) { try { mContext.startActivity(Intent.createChooser(intent, mContext.getString(R.string.share_chooser))); } catch (android.content.ActivityNotFoundException ex) { @@ -77,7 +79,7 @@ public void rateUs() { * * @param url - web page to open up */ - public void openWebPage(String url) { + public void openWebPage(@NonNull String url) { Uri uri = Uri.parse(url); Intent intent = new Intent(Intent.ACTION_VIEW, uri); if (intent.resolveActivity(mContext.getPackageManager()) != null) diff --git a/app/src/main/java/swati4star/createpdf/util/FileInfoUtils.java b/app/src/main/java/swati4star/createpdf/util/FileInfoUtils.java index 035d8372a..d0fdb64c0 100644 --- a/app/src/main/java/swati4star/createpdf/util/FileInfoUtils.java +++ b/app/src/main/java/swati4star/createpdf/util/FileInfoUtils.java @@ -1,5 +1,7 @@ package swati4star.createpdf.util; +import androidx.annotation.NonNull; + import java.io.File; import java.util.Date; @@ -13,7 +15,8 @@ public class FileInfoUtils { * @param file file object whose last modified date is to be returned * @return String date modified in formatted form **/ - public static String getFormattedDate(File file) { + @NonNull + public static String getFormattedDate(@NonNull File file) { Date lastModDate = new Date(file.lastModified()); String[] formatDate = lastModDate.toString().split(" "); String time = formatDate[3]; @@ -29,7 +32,8 @@ public static String getFormattedDate(File file) { * @param file file object whose size is to be returned * @return String Size of pdf in formatted form */ - public static String getFormattedSize(File file) { + @NonNull + public static String getFormattedSize(@NonNull File file) { return String.format("%.2f MB", (double) file.length() / (1024 * 1024)); } } diff --git a/app/src/main/java/swati4star/createpdf/util/FileReader.java b/app/src/main/java/swati4star/createpdf/util/FileReader.java index 3358914ed..3f5f9fb96 100644 --- a/app/src/main/java/swati4star/createpdf/util/FileReader.java +++ b/app/src/main/java/swati4star/createpdf/util/FileReader.java @@ -3,6 +3,8 @@ import android.content.Context; import android.net.Uri; +import androidx.annotation.NonNull; + import com.itextpdf.text.Document; import com.itextpdf.text.Font; @@ -11,7 +13,7 @@ public abstract class FileReader { Context mContext; - public FileReader(Context context) { + public FileReader(@NonNull Context context) { mContext = context; } @@ -29,5 +31,5 @@ void read(Uri uri, Document document, Font myfont) { } protected abstract void createDocumentFromStream( - Uri uri, Document document, Font myfont, InputStream inputStream) throws Exception; + @NonNull Uri uri, @NonNull Document document, @NonNull Font myfont, @NonNull InputStream inputStream) throws Exception; } \ No newline at end of file diff --git a/app/src/main/java/swati4star/createpdf/util/FileSortUtils.java b/app/src/main/java/swati4star/createpdf/util/FileSortUtils.java index 3df1a4507..6abef5939 100644 --- a/app/src/main/java/swati4star/createpdf/util/FileSortUtils.java +++ b/app/src/main/java/swati4star/createpdf/util/FileSortUtils.java @@ -1,5 +1,7 @@ package swati4star.createpdf.util; +import androidx.annotation.NonNull; + import java.io.File; import java.util.Collections; import java.util.List; @@ -15,13 +17,14 @@ public class FileSortUtils { private FileSortUtils() { } + @NonNull public static FileSortUtils getInstance() { return FileSortUtils.SingletonHolder.INSTANCE; } // SORTING FUNCTIONS - public void performSortOperation(int option, List pdf) { + public void performSortOperation(int option, @NonNull List pdf) { switch (option) { case DATE_INDEX: sortFilesByDateNewestToOldest(pdf); diff --git a/app/src/main/java/swati4star/createpdf/util/FileUriUtils.java b/app/src/main/java/swati4star/createpdf/util/FileUriUtils.java index 5f9c041e1..93c446e5a 100644 --- a/app/src/main/java/swati4star/createpdf/util/FileUriUtils.java +++ b/app/src/main/java/swati4star/createpdf/util/FileUriUtils.java @@ -9,6 +9,8 @@ import android.provider.DocumentsContract; import android.provider.MediaStore; +import androidx.annotation.NonNull; + public class FileUriUtils { private final String mEXTERNALSTORAGEDOC = "com.android.externalstorage.documents"; @@ -19,6 +21,7 @@ public class FileUriUtils { private FileUriUtils() { } + @NonNull public static FileUriUtils getInstance() { return FileUriUtils.SingletonHolder.INSTANCE; } @@ -185,7 +188,8 @@ private String getImageRealPath(ContentResolver contentResolver, Uri uri, String * @param uri - input uri * @return - path */ - public String getFilePath(Uri uri) { + @NonNull + public String getFilePath(@NonNull Uri uri) { String path = uri.getPath(); if (path == null) return null; diff --git a/app/src/main/java/swati4star/createpdf/util/FileUtils.java b/app/src/main/java/swati4star/createpdf/util/FileUtils.java index b6e06cfd0..c6790823e 100644 --- a/app/src/main/java/swati4star/createpdf/util/FileUtils.java +++ b/app/src/main/java/swati4star/createpdf/util/FileUtils.java @@ -18,6 +18,7 @@ import android.print.PrintManager; import android.provider.MediaStore; +import androidx.annotation.NonNull; import androidx.core.content.FileProvider; import com.afollestad.materialdialogs.MaterialDialog; @@ -36,7 +37,7 @@ public class FileUtils { private final Activity mContext; private final SharedPreferences mSharedPreferences; - public FileUtils(Activity context) { + public FileUtils(@NonNull Activity context) { this.mContext = context; mSharedPreferences = PreferenceManager.getDefaultSharedPreferences(context); } @@ -47,7 +48,8 @@ public FileUtils(Activity context) { * @param path - file path * @return - extracted filename */ - public static String getFileName(String path) { + @NonNull + public static String getFileName(@NonNull String path) { if (path == null) return null; @@ -61,7 +63,8 @@ public static String getFileName(String path) { * @param path - file path * @return - extracted filename without extension */ - public static String getFileNameWithoutExtension(String path) { + @NonNull + public static String getFileNameWithoutExtension(@NonNull String path) { if (path == null || path.lastIndexOf(PATH_SEPERATOR) == -1) return path; @@ -77,7 +80,8 @@ public static String getFileNameWithoutExtension(String path) { * @param path absolute path of the file * @return absolute path of file directory */ - public static String getFileDirectoryPath(String path) { + @NonNull + public static String getFileDirectoryPath(@NonNull String path) { return path.substring(0, path.lastIndexOf(PATH_SEPERATOR) + 1); } @@ -86,7 +90,7 @@ public static String getFileDirectoryPath(String path) { * * @param file the file to be printed */ - public void printFile(final File file) { + public void printFile(final @NonNull File file) { final PrintDocumentAdapter mPrintDocumentAdapter = new PrintDocumentAdapterHelper(file); PrintManager printManager = (PrintManager) mContext @@ -103,7 +107,7 @@ public void printFile(final File file) { * * @param file - the file to be shared */ - public void shareFile(File file) { + public void shareFile(@NonNull File file) { Uri uri = FileProvider.getUriForFile(mContext, AUTHORITY_APP, file); ArrayList uris = new ArrayList<>(); uris.add(uri); @@ -115,7 +119,7 @@ public void shareFile(File file) { * * @param files - the list of files to be shared */ - public void shareMultipleFiles(List files) { + public void shareMultipleFiles(@NonNull List files) { ArrayList uris = new ArrayList<>(); for (File file : files) { Uri uri = FileProvider.getUriForFile(mContext, AUTHORITY_APP, file); @@ -145,7 +149,7 @@ private void shareFile(ArrayList uris) { * * @param path - path of the file to be opened */ - public void openFile(String path, FileType fileType) { + public void openFile(@NonNull String path, @NonNull FileType fileType) { if (path == null) { StringUtils.getInstance().showSnackbar(mContext, R.string.error_path_not_found); return; @@ -201,7 +205,8 @@ private int checkRepeat(String finalOutputFile, final List mFile) { * @param uri - uri of the image * @return - real path of the image file on device */ - public String getUriRealPath(Uri uri) { + @NonNull + public String getUriRealPath(@NonNull Uri uri) { if (uri == null || FileUriUtils.getInstance().isWhatsappImage(uri.getAuthority())) return null; @@ -214,7 +219,7 @@ public String getUriRealPath(Uri uri) { * @return true if file exists else false */ - public boolean isFileExist(String mFileName) { + public boolean isFileExist(@NonNull String mFileName) { String path = mSharedPreferences.getString(STORAGE_LOCATION, StringUtils.getInstance().getDefaultStorageLocation()) + mFileName; File file = new File(path); @@ -228,7 +233,8 @@ public boolean isFileExist(String mFileName) { * @param uri - file uri * @return - extracted filename */ - public String getFileName(Uri uri) { + @NonNull + public String getFileName(@NonNull Uri uri) { String fileName = null; String scheme = uri.getScheme(); @@ -259,7 +265,8 @@ public String getFileName(Uri uri) { * @param filesPath - ArrayList of image paths * @return fileName with _pdf suffix */ - public String getLastFileName(ArrayList filesPath) { + @NonNull + public String getLastFileName(@NonNull ArrayList filesPath) { if (filesPath.size() == 0) return ""; @@ -275,7 +282,8 @@ public String getLastFileName(ArrayList filesPath) { * @param fileNameWithExt fileName with extension. Ex: androidDev.jpg * @return fileName without extension. Ex: androidDev */ - public String stripExtension(String fileNameWithExt) { + @NonNull + public String stripExtension(@NonNull String fileNameWithExt) { // Handle null case specially. if (fileNameWithExt == null) return null; @@ -294,7 +302,7 @@ public String stripExtension(String fileNameWithExt) { * * @param path - image path */ - public void openImage(String path) { + public void openImage(@NonNull String path) { File file = new File(path); Intent target = new Intent(Intent.ACTION_VIEW); target.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY); @@ -322,6 +330,7 @@ private void openIntent(Intent intent) { * * @return - intent */ + @NonNull public Intent getFileChooser() { String folderPath = Environment.getExternalStorageDirectory() + "/"; Intent intent = new Intent(); @@ -337,6 +346,7 @@ public Intent getFileChooser() { * * @return - intent */ + @NonNull public Intent getMultipleFileChooser() { String folderPath = Environment.getExternalStorageDirectory() + "/"; Intent intent = new Intent(); @@ -377,7 +387,7 @@ String getUniqueFileName(String fileName) { * @param ext the file extension * @param saveMethod the method that should be called when a filename is chosen */ - public void openSaveDialog(String preFillName, String ext, Consumer saveMethod) { + public void openSaveDialog(@NonNull String preFillName, @NonNull String ext, @NonNull Consumer saveMethod) { MaterialDialog.Builder builder = DialogUtils.getInstance().createCustomDialog(mContext, R.string.creating_pdf, R.string.enter_file_name); diff --git a/app/src/main/java/swati4star/createpdf/util/FragmentUtils.java b/app/src/main/java/swati4star/createpdf/util/FragmentUtils.java index b4735731e..7ca368709 100644 --- a/app/src/main/java/swati4star/createpdf/util/FragmentUtils.java +++ b/app/src/main/java/swati4star/createpdf/util/FragmentUtils.java @@ -9,6 +9,7 @@ import android.content.Context; import android.os.Bundle; +import androidx.annotation.NonNull; import androidx.fragment.app.Fragment; import swati4star.createpdf.R; @@ -32,11 +33,12 @@ public class FragmentUtils { private final Context mContext; - public FragmentUtils(Context mContext) { + public FragmentUtils(@NonNull Context mContext) { this.mContext = mContext; } - public String getFragmentName(Fragment fragment) { + @NonNull + public String getFragmentName(@NonNull Fragment fragment) { String name = mContext.getString(R.string.app_name); if (fragment instanceof ImageToPdfFragment) { name = mContext.getString(R.string.images_to_pdf); @@ -73,7 +75,7 @@ public String getFragmentName(Fragment fragment) { return name; } - public boolean handleFragmentBottomSheetBehavior(Fragment fragment) { + public boolean handleFragmentBottomSheetBehavior(@NonNull Fragment fragment) { boolean bottomSheetBehaviour = false; if (fragment instanceof InvertPdfFragment) { bottomSheetBehaviour = ((InvertPdfFragment) fragment).checkSheetBehaviour(); diff --git a/app/src/main/java/swati4star/createpdf/util/ImageEnhancementOptionsUtils.java b/app/src/main/java/swati4star/createpdf/util/ImageEnhancementOptionsUtils.java index b2ad2c156..279f3b5b7 100644 --- a/app/src/main/java/swati4star/createpdf/util/ImageEnhancementOptionsUtils.java +++ b/app/src/main/java/swati4star/createpdf/util/ImageEnhancementOptionsUtils.java @@ -4,6 +4,8 @@ import android.graphics.Color; import android.graphics.drawable.Drawable; +import androidx.annotation.NonNull; + import java.util.ArrayList; import swati4star.createpdf.R; @@ -15,12 +17,14 @@ public class ImageEnhancementOptionsUtils { public ImageEnhancementOptionsUtils() { } + @NonNull public static ImageEnhancementOptionsUtils getInstance() { return SingletonHolder.INSTANCE; } - public ArrayList getEnhancementOptions(Context context, - ImageToPDFOptions pdfOptions) { + @NonNull + public ArrayList getEnhancementOptions(@NonNull Context context, + @NonNull ImageToPDFOptions pdfOptions) { ArrayList options = new ArrayList<>(); int passwordIcon = R.drawable.baseline_enhanced_encryption_24; if (pdfOptions.isPasswordProtected()) diff --git a/app/src/main/java/swati4star/createpdf/util/ImageFilterUtils.java b/app/src/main/java/swati4star/createpdf/util/ImageFilterUtils.java index 5073e911a..27f56ebe9 100644 --- a/app/src/main/java/swati4star/createpdf/util/ImageFilterUtils.java +++ b/app/src/main/java/swati4star/createpdf/util/ImageFilterUtils.java @@ -2,6 +2,8 @@ import android.content.Context; +import androidx.annotation.NonNull; + import java.util.ArrayList; import ja.burhanrashid52.photoeditor.PhotoFilter; @@ -13,11 +15,13 @@ public class ImageFilterUtils { public ImageFilterUtils() { } + @NonNull public static ImageFilterUtils getInstance() { return ImageFilterUtils.SingletonHolder.INSTANCE; } - public ArrayList getFiltersList(Context context) { + @NonNull + public ArrayList getFiltersList(@NonNull Context context) { ArrayList items = new ArrayList<>(); diff --git a/app/src/main/java/swati4star/createpdf/util/ImageSortUtils.java b/app/src/main/java/swati4star/createpdf/util/ImageSortUtils.java index 644ea0187..d8be418c1 100644 --- a/app/src/main/java/swati4star/createpdf/util/ImageSortUtils.java +++ b/app/src/main/java/swati4star/createpdf/util/ImageSortUtils.java @@ -1,5 +1,7 @@ package swati4star.createpdf.util; +import androidx.annotation.NonNull; + import java.io.File; import java.util.Collections; import java.util.List; @@ -10,6 +12,7 @@ public class ImageSortUtils { private static final int DATE_ASC = 2; private static final int DATE_DESC = 3; + @NonNull public static ImageSortUtils getInstance() { return ImageSortUtils.SingletonHolder.INSTANCE; } @@ -20,7 +23,7 @@ public static ImageSortUtils getInstance() { * @param option sorting operation * @param images list of image paths */ - public void performSortOperation(int option, List images) { + public void performSortOperation(int option, @NonNull List images) { if (option < 0 || option > 3) throw new IllegalArgumentException("Invalid sort option. " + "Sort option must be in [0; 3] range!"); switch (option) { diff --git a/app/src/main/java/swati4star/createpdf/util/ImageUtils.java b/app/src/main/java/swati4star/createpdf/util/ImageUtils.java index a3c7dc81d..82b6a9246 100644 --- a/app/src/main/java/swati4star/createpdf/util/ImageUtils.java +++ b/app/src/main/java/swati4star/createpdf/util/ImageUtils.java @@ -26,6 +26,7 @@ import android.widget.CheckBox; import android.widget.RadioGroup; +import androidx.annotation.NonNull; import androidx.fragment.app.Fragment; import com.afollestad.materialdialogs.MaterialDialog; @@ -42,8 +43,10 @@ public class ImageUtils { + @NonNull public String mImageScaleType; + @NonNull public static ImageUtils getInstance() { return ImageUtils.SingletonHolder.INSTANCE; } @@ -74,7 +77,8 @@ static Rectangle calculateFitSize(float originalWidth, float originalHeight, Rec * @return input image size as Rectangle. * @see com.itextpdf.text.Rectangle */ - public static Rectangle getImageSize(String imageUri) { + @NonNull + public static Rectangle getImageSize(@NonNull String imageUri) { BitmapFactory.Options options = new BitmapFactory.Options(); options.inJustDecodeBounds = true; File imageFile = new File(Uri.parse(imageUri).getPath()); @@ -88,7 +92,8 @@ public static Rectangle getImageSize(String imageUri) { * @param filename - name of the file * @param finalBitmap - bitmap to save */ - public static String saveImage(String filename, Bitmap finalBitmap) { + @NonNull + public static String saveImage(@NonNull String filename, @NonNull Bitmap finalBitmap) { if (finalBitmap == null || checkIfBitmapIsWhite(finalBitmap)) return null; @@ -120,7 +125,7 @@ public static String saveImage(String filename, Bitmap finalBitmap) { * @param frag the fragment that should receive the Images * @param requestCode the internal request code the fragment uses for image selection */ - public static void selectImages(Fragment frag, int requestCode) { + public static void selectImages(@NonNull Fragment frag, int requestCode) { Matisse.from(frag) .choose(MimeType.ofImage(), false) .countable(true) @@ -152,7 +157,8 @@ private static boolean checkIfBitmapIsWhite(Bitmap bitmap) { * @param bmp - input bitmap * @return - output bitmap */ - public Bitmap getRoundBitmap(Bitmap bmp) { + @NonNull + public Bitmap getRoundBitmap(@NonNull Bitmap bmp) { int width = bmp.getWidth(), height = bmp.getHeight(); int radius = Math.min(width, height); // set the smallest edge as radius. Bitmap bitmap; @@ -190,7 +196,8 @@ public Bitmap getRoundBitmap(Bitmap bmp) { * @param path - file path * @return - output round bitmap */ - public Bitmap getRoundBitmapFromPath(String path) { + @NonNull + public Bitmap getRoundBitmapFromPath(@NonNull String path) { File file = new File(path); // First decode with inJustDecodeBounds=true to check dimensions @@ -238,7 +245,7 @@ private int calculateInSampleSize(BitmapFactory.Options options) { return inSampleSize; } - public void showImageScaleTypeDialog(Context context, Boolean saveValue) { + public void showImageScaleTypeDialog(@NonNull Context context, @NonNull Boolean saveValue) { SharedPreferences mSharedPreferences = PreferenceManager.getDefaultSharedPreferences(context); MaterialDialog.Builder builder = DialogUtils.getInstance().createCustomDialogWithoutContent((Activity) context, @@ -274,7 +281,8 @@ public void showImageScaleTypeDialog(Context context, Boolean saveValue) { * @param bmpOriginal original bitmap which is converted to a new * grayscale bitmap */ - public Bitmap toGrayscale(Bitmap bmpOriginal) { + @NonNull + public Bitmap toGrayscale(@NonNull Bitmap bmpOriginal) { int width, height; height = bmpOriginal.getHeight(); width = bmpOriginal.getWidth(); diff --git a/app/src/main/java/swati4star/createpdf/util/InvertPdf.java b/app/src/main/java/swati4star/createpdf/util/InvertPdf.java index 4dfe34bea..321d8270f 100644 --- a/app/src/main/java/swati4star/createpdf/util/InvertPdf.java +++ b/app/src/main/java/swati4star/createpdf/util/InvertPdf.java @@ -6,6 +6,8 @@ import android.os.AsyncTask; import android.os.ParcelFileDescriptor; +import androidx.annotation.NonNull; + import com.itextpdf.text.Rectangle; import com.itextpdf.text.pdf.GrayColor; import com.itextpdf.text.pdf.PdfContentByte; @@ -31,7 +33,7 @@ public class InvertPdf extends AsyncTask { * @param path - path of input file * @param onPDFCreatedInterface - interface implementation to handle pre & post */ - public InvertPdf(String path, OnPDFCreatedInterface onPDFCreatedInterface) { + public InvertPdf(@NonNull String path, @NonNull OnPDFCreatedInterface onPDFCreatedInterface) { this.mPath = path; this.mOnPDFCreatedInterface = onPDFCreatedInterface; } diff --git a/app/src/main/java/swati4star/createpdf/util/MergeHelper.java b/app/src/main/java/swati4star/createpdf/util/MergeHelper.java index d5098b506..ff369a0cb 100644 --- a/app/src/main/java/swati4star/createpdf/util/MergeHelper.java +++ b/app/src/main/java/swati4star/createpdf/util/MergeHelper.java @@ -9,6 +9,8 @@ import android.content.SharedPreferences; import android.preference.PreferenceManager; +import androidx.annotation.NonNull; + import com.afollestad.materialdialogs.MaterialDialog; import swati4star.createpdf.R; @@ -27,7 +29,7 @@ public class MergeHelper implements MergeFilesListener { private MaterialDialog mMaterialDialog; private String mPassword; - public MergeHelper(Activity activity, ViewFilesAdapter viewFilesAdapter) { + public MergeHelper(@NonNull Activity activity, @NonNull ViewFilesAdapter viewFilesAdapter) { mActivity = activity; mFileUtils = new FileUtils(mActivity); mHomePath = PreferenceManager.getDefaultSharedPreferences(mActivity) @@ -64,7 +66,7 @@ public void mergeFiles() { } @Override - public void resetValues(boolean isPDFMerged, String path) { + public void resetValues(boolean isPDFMerged, @NonNull String path) { mMaterialDialog.dismiss(); if (isPDFMerged) { StringUtils.getInstance().getSnackbarwithAction(mActivity, R.string.pdf_merged) diff --git a/app/src/main/java/swati4star/createpdf/util/MergePdf.java b/app/src/main/java/swati4star/createpdf/util/MergePdf.java index 375183a18..a67f1fd92 100644 --- a/app/src/main/java/swati4star/createpdf/util/MergePdf.java +++ b/app/src/main/java/swati4star/createpdf/util/MergePdf.java @@ -4,6 +4,8 @@ import android.os.AsyncTask; +import androidx.annotation.NonNull; + import com.itextpdf.text.Document; import com.itextpdf.text.pdf.PdfCopy; import com.itextpdf.text.pdf.PdfReader; @@ -32,8 +34,8 @@ public class MergePdf extends AsyncTask { * @param mergeFilesListener - listener object * @param masterpwd - current master password */ - public MergePdf(String fileName, String homePath, boolean isPasswordProtected, - String password, MergeFilesListener mergeFilesListener, String masterpwd) { + public MergePdf(@NonNull String fileName, @NonNull String homePath, boolean isPasswordProtected, + @NonNull String password, @NonNull MergeFilesListener mergeFilesListener, @NonNull String masterpwd) { mFilename = fileName; mFinPath = homePath; mMergeFilesListener = mergeFilesListener; diff --git a/app/src/main/java/swati4star/createpdf/util/MergePdfEnhancementOptionsUtils.java b/app/src/main/java/swati4star/createpdf/util/MergePdfEnhancementOptionsUtils.java index 7bc4f3a8f..df7aef028 100644 --- a/app/src/main/java/swati4star/createpdf/util/MergePdfEnhancementOptionsUtils.java +++ b/app/src/main/java/swati4star/createpdf/util/MergePdfEnhancementOptionsUtils.java @@ -2,17 +2,21 @@ import android.content.Context; +import androidx.annotation.NonNull; + import java.util.ArrayList; import swati4star.createpdf.R; import swati4star.createpdf.model.EnhancementOptionsEntity; public class MergePdfEnhancementOptionsUtils { + @NonNull public static MergePdfEnhancementOptionsUtils getInstance() { return MergePdfEnhancementOptionsUtils.SingletonHolder.INSTANCE; } - public ArrayList getEnhancementOptions(Context context) { + @NonNull + public ArrayList getEnhancementOptions(@NonNull Context context) { ArrayList options = new ArrayList<>(); options.add(new EnhancementOptionsEntity( diff --git a/app/src/main/java/swati4star/createpdf/util/MorphButtonUtility.java b/app/src/main/java/swati4star/createpdf/util/MorphButtonUtility.java index e5317a9b0..2f428cc3d 100644 --- a/app/src/main/java/swati4star/createpdf/util/MorphButtonUtility.java +++ b/app/src/main/java/swati4star/createpdf/util/MorphButtonUtility.java @@ -13,6 +13,7 @@ import androidx.annotation.ColorRes; import androidx.annotation.DimenRes; +import androidx.annotation.NonNull; import com.dd.morphingbutton.MorphingButton; @@ -23,7 +24,7 @@ public class MorphButtonUtility { private final Activity mActivity; private boolean mDarkModeEnabled = false; - public MorphButtonUtility(Activity activity) { + public MorphButtonUtility(@NonNull Activity activity) { mActivity = activity; checkDarkMode(); } @@ -64,7 +65,7 @@ private void checkDarkMode() { * @param btnMorph the button to be converted * @param duration time period of transition */ - public void morphToSquare(final MorphingButton btnMorph, int duration) { + public void morphToSquare(final @NonNull MorphingButton btnMorph, int duration) { MorphingButton.Params square = defaultButton(duration); String text = btnMorph.getText().toString().isEmpty() ? mActivity.getString(R.string.create_pdf) : @@ -85,7 +86,7 @@ public void morphToSquare(final MorphingButton btnMorph, int duration) { * * @param btnMorph the button to be converted */ - public void morphToSuccess(final MorphingButton btnMorph) { + public void morphToSuccess(final @NonNull MorphingButton btnMorph) { MorphingButton.Params circle = MorphingButton.Params.create() .duration(integer()) .cornerRadius(dimen(R.dimen.mb_height_56)) @@ -103,7 +104,7 @@ public void morphToSuccess(final MorphingButton btnMorph) { * @param btnMorph the button to be converted * @param duration time period of transition */ - public void morphToGrey(final MorphingButton btnMorph, int duration) { + public void morphToGrey(final @NonNull MorphingButton btnMorph, int duration) { MorphingButton.Params square = defaultButton(duration); square.color(color(R.color.mb_gray)); square.colorPressed(color(R.color.mb_gray)); @@ -125,17 +126,17 @@ private MorphingButton.Params defaultButton(int duration) { .height(FrameLayout.LayoutParams.WRAP_CONTENT); } - public void setTextAndActivateButtons(String path, - MorphingButton toSetPathOn, - MorphingButton toEnable) { + public void setTextAndActivateButtons(@NonNull String path, + @NonNull MorphingButton toSetPathOn, + @NonNull MorphingButton toEnable) { toSetPathOn.setText(path); toSetPathOn.setBackgroundColor(mActivity.getResources().getColor(R.color.mb_green_dark)); toEnable.setEnabled(true); morphToSquare(toEnable, integer()); } - public void initializeButton(MorphingButton button, - MorphingButton buttonToDisable) { + public void initializeButton(@NonNull MorphingButton button, + @NonNull MorphingButton buttonToDisable) { button.setText(R.string.merge_file_select); if (mDarkModeEnabled) { button.setBackgroundColor(color(R.color.colorBlackAltLight)); @@ -144,8 +145,8 @@ public void initializeButton(MorphingButton button, buttonToDisable.setEnabled(false); } - public void initializeButtonForAddText(MorphingButton pdfButton, MorphingButton textButton, - MorphingButton buttonToDisable) { + public void initializeButtonForAddText(@NonNull MorphingButton pdfButton, @NonNull MorphingButton textButton, + @NonNull MorphingButton buttonToDisable) { pdfButton.setText(R.string.select_pdf_file); textButton.setText(R.string.select_text_file); if (mDarkModeEnabled) { diff --git a/app/src/main/java/swati4star/createpdf/util/PDFEncryptionUtility.java b/app/src/main/java/swati4star/createpdf/util/PDFEncryptionUtility.java index fc9d8d559..54995fe2a 100644 --- a/app/src/main/java/swati4star/createpdf/util/PDFEncryptionUtility.java +++ b/app/src/main/java/swati4star/createpdf/util/PDFEncryptionUtility.java @@ -11,6 +11,8 @@ import android.widget.EditText; import android.widget.TextView; +import androidx.annotation.NonNull; + import com.afollestad.materialdialogs.DialogAction; import com.afollestad.materialdialogs.MaterialDialog; import com.itextpdf.text.DocumentException; @@ -35,7 +37,7 @@ public class PDFEncryptionUtility { private final SharedPreferences mSharedPrefs; private String mPassword; - public PDFEncryptionUtility(Activity context) { + public PDFEncryptionUtility(@NonNull Activity context) { this.mContext = context; this.mFileUtils = new FileUtils(context); mSharedPrefs = PreferenceManager.getDefaultSharedPreferences(context); @@ -51,7 +53,7 @@ public PDFEncryptionUtility(Activity context) { * * @param filePath Path of file to be encrypted */ - public void setPassword(final String filePath, final DataSetChanged dataSetChanged) { + public void setPassword(final @NonNull String filePath, final @NonNull DataSetChanged dataSetChanged) { mDialog.setTitle(R.string.set_password); final View mPositiveAction = mDialog.getActionButton(DialogAction.POSITIVE); @@ -142,8 +144,8 @@ private boolean isPDFEncrypted(final String file) { * * @param file Path of pdf file to be decrypted */ - public void removePassword(final String file, - final DataSetChanged dataSetChanged) { + public void removePassword(final @NonNull String file, + final @NonNull DataSetChanged dataSetChanged) { if (!isPDFEncrypted(file)) return; @@ -190,8 +192,9 @@ public void afterTextChanged(Editable input) { * @param inputPassword - the password of the encrypted file. * @return - output file path */ - public String removeDefPasswordForImages(final String file, - final String[] inputPassword) { + @NonNull + public String removeDefPasswordForImages(final @NonNull String file, + final @NonNull String[] inputPassword) { String finalOutputFile; try { String masterPwd = mSharedPrefs.getString(MASTER_PWD_STRING, appName); diff --git a/app/src/main/java/swati4star/createpdf/util/PDFRotationUtils.java b/app/src/main/java/swati4star/createpdf/util/PDFRotationUtils.java index c98f0de9a..4e426ae59 100644 --- a/app/src/main/java/swati4star/createpdf/util/PDFRotationUtils.java +++ b/app/src/main/java/swati4star/createpdf/util/PDFRotationUtils.java @@ -4,6 +4,8 @@ import android.util.SparseIntArray; import android.widget.RadioGroup; +import androidx.annotation.NonNull; + import com.afollestad.materialdialogs.MaterialDialog; import com.itextpdf.text.pdf.PdfDictionary; import com.itextpdf.text.pdf.PdfName; @@ -23,7 +25,7 @@ public class PDFRotationUtils { private final SparseIntArray mAngleRadioButton; private final FileUtils mFileUtils; - public PDFRotationUtils(Activity context) { + public PDFRotationUtils(@NonNull Activity context) { this.mContext = context; this.mFileUtils = new FileUtils(mContext); mAngleRadioButton = new SparseIntArray(); @@ -37,7 +39,7 @@ public PDFRotationUtils(Activity context) { * * @param sourceFilePath - path of file to be rotated */ - public void rotatePages(String sourceFilePath, final DataSetChanged dataSetChanged) { + public void rotatePages(@NonNull String sourceFilePath, final @NonNull DataSetChanged dataSetChanged) { MaterialDialog.Builder builder = DialogUtils.getInstance().createCustomDialogWithoutContent(mContext, R.string.rotate_pages); builder.customView(R.layout.dialog_rotate_pdf, true) diff --git a/app/src/main/java/swati4star/createpdf/util/PDFUtils.java b/app/src/main/java/swati4star/createpdf/util/PDFUtils.java index f27829577..651ce18f1 100644 --- a/app/src/main/java/swati4star/createpdf/util/PDFUtils.java +++ b/app/src/main/java/swati4star/createpdf/util/PDFUtils.java @@ -47,7 +47,7 @@ public class PDFUtils { private final Activity mContext; private final FileUtils mFileUtils; - public PDFUtils(Activity context) { + public PDFUtils(@NonNull Activity context) { this.mContext = context; this.mFileUtils = new FileUtils(mContext); } @@ -57,7 +57,7 @@ public PDFUtils(Activity context) { * * @param file - file name */ - public void showDetails(File file) { + public void showDetails(@NonNull File file) { String name = file.getName(); String path = file.getPath(); String size = FileInfoUtils.getFormattedSize(file); @@ -89,7 +89,7 @@ public void showDetails(File file) { * @return true - if encrypted otherwise false */ @WorkerThread - public boolean isPDFEncrypted(String path) { + public boolean isPDFEncrypted(@NonNull String path) { boolean isEncrypted; PdfReader pdfReader = null; try { @@ -103,8 +103,8 @@ public boolean isPDFEncrypted(String path) { return isEncrypted; } - public void compressPDF(String inputPath, String outputPath, int quality, - OnPDFCompressedInterface onPDFCompressedInterface) { + public void compressPDF(@NonNull String inputPath, @NonNull String outputPath, int quality, + @NonNull OnPDFCompressedInterface onPDFCompressedInterface) { new CompressPdfAsync(inputPath, outputPath, quality, onPDFCompressedInterface) .execute(); } @@ -117,7 +117,7 @@ public void compressPDF(String inputPath, String outputPath, int quality, * @param imagesUri - list of images to add * @return true, if succeeded, otherwise false */ - public boolean addImagesToPdf(String inputPath, String output, ArrayList imagesUri) { + public boolean addImagesToPdf(@NonNull String inputPath, @NonNull String output, @NonNull ArrayList imagesUri) { try { PdfReader reader = new PdfReader(inputPath); Document document = new Document(); @@ -182,7 +182,7 @@ private void appendImages(Document document, ArrayList imagesUri) throws } } - public boolean reorderRemovePDF(String inputPath, String output, String pages) { + public boolean reorderRemovePDF(@NonNull String inputPath, @NonNull String output, @NonNull String pages) { try { PdfReader reader = new PdfReader(inputPath); reader.selectPages(pages); @@ -213,7 +213,7 @@ public boolean reorderRemovePDF(String inputPath, String output, String pages) { * @param path Absolute path of the pdf * @param onPdfReorderedInterface interface to update pdf reorder progress */ - public void reorderPdfPages(Uri uri, String path, @NonNull OnPdfReorderedInterface onPdfReorderedInterface) { + public void reorderPdfPages(@NonNull Uri uri, @NonNull String path, @NonNull OnPdfReorderedInterface onPdfReorderedInterface) { new ReorderPdfPagesAsync(uri, path, mContext, onPdfReorderedInterface).execute(); } diff --git a/app/src/main/java/swati4star/createpdf/util/PageSizeUtils.java b/app/src/main/java/swati4star/createpdf/util/PageSizeUtils.java index eceb50bb6..7247bb47b 100644 --- a/app/src/main/java/swati4star/createpdf/util/PageSizeUtils.java +++ b/app/src/main/java/swati4star/createpdf/util/PageSizeUtils.java @@ -8,6 +8,8 @@ import android.widget.RadioGroup; import android.widget.Spinner; +import androidx.annotation.NonNull; + import com.afollestad.materialdialogs.MaterialDialog; import com.itextpdf.text.Rectangle; @@ -21,6 +23,7 @@ public class PageSizeUtils { public static final String PAGE_SIZE_FIT_SIZE = "FIT_SIZE"; + @NonNull public static String mPageSize; private final Context mActivity; private final String mDefaultPageSize; @@ -32,7 +35,7 @@ public class PageSizeUtils { * * @param mActivity - current context */ - public PageSizeUtils(Context mActivity) { + public PageSizeUtils(@NonNull Context mActivity) { this.mActivity = mActivity; mPreferences = new TextToPdfPreferences(mActivity); mDefaultPageSize = mPreferences.getPageSize(); @@ -80,6 +83,7 @@ private String getPageSize(int selectionId, String spinnerAValue, String spinner * @param saveValue - save the value in shared preferences * @return - dialog object */ + @NonNull public MaterialDialog showPageSizeDialog(boolean saveValue) { MaterialDialog materialDialog = getPageSizeDialog(saveValue); @@ -119,7 +123,8 @@ public MaterialDialog showPageSizeDialog(boolean saveValue) { * @return common size of input images as Rectangle. * @see com.itextpdf.text.Rectangle */ - public static Rectangle calculateCommonPageSize(List imagesUri) { + @NonNull + public static Rectangle calculateCommonPageSize(@NonNull List imagesUri) { float maxWidth = 0; float maxHeight = 0; for (String imageUri : imagesUri) { Rectangle imageSize = ImageUtils.getImageSize(imageUri); diff --git a/app/src/main/java/swati4star/createpdf/util/PdfToImages.java b/app/src/main/java/swati4star/createpdf/util/PdfToImages.java index 2505e2ac3..bdc0302e2 100644 --- a/app/src/main/java/swati4star/createpdf/util/PdfToImages.java +++ b/app/src/main/java/swati4star/createpdf/util/PdfToImages.java @@ -14,6 +14,8 @@ import android.os.AsyncTask; import android.os.ParcelFileDescriptor; +import androidx.annotation.NonNull; + import java.io.File; import java.io.IOException; import java.util.ArrayList; @@ -32,8 +34,8 @@ public class PdfToImages extends AsyncTask { private PDFEncryptionUtility mPDFEncryptionUtility; private String mDecryptedPath; - public PdfToImages(Context context, String[] password, String mPath, Uri mUri, - ExtractImagesListener mExtractImagesListener) { + public PdfToImages(@NonNull Context context, @NonNull String[] password, @NonNull String mPath, @NonNull Uri mUri, + @NonNull ExtractImagesListener mExtractImagesListener) { this.mPath = mPath; this.mUri = mUri; this.mExtractImagesListener = mExtractImagesListener; diff --git a/app/src/main/java/swati4star/createpdf/util/PermissionsUtils.java b/app/src/main/java/swati4star/createpdf/util/PermissionsUtils.java index 7d852f87b..dc988e60c 100644 --- a/app/src/main/java/swati4star/createpdf/util/PermissionsUtils.java +++ b/app/src/main/java/swati4star/createpdf/util/PermissionsUtils.java @@ -24,6 +24,7 @@ */ public class PermissionsUtils { + @NonNull public static PermissionsUtils getInstance() { return PermissionsUtils.SingletonHolder.INSTANCE; } @@ -36,7 +37,7 @@ public static PermissionsUtils getInstance() { * @param permissions string array of permissions * @return true if all permissions are granted, otherwise false */ - public boolean checkRuntimePermissions(Object context, String[] permissions) { + public boolean checkRuntimePermissions(@NonNull Object context, @NonNull String[] permissions) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { for (String permission : permissions) { if ((ContextCompat.checkSelfPermission(retrieveContext(context), @@ -58,7 +59,7 @@ public boolean checkRuntimePermissions(Object context, String[] permissions) { * @param permissions string array of permissions * @param requestCode permission request code */ - public void requestRuntimePermissions(Object context, String[] permissions, + public void requestRuntimePermissions(@NonNull Object context, @NonNull String[] permissions, int requestCode) { if (context instanceof Activity) { ActivityCompat.requestPermissions((AppCompatActivity) context, @@ -91,7 +92,7 @@ private Context retrieveContext(@NonNull Object context) { * @param expectedRequest * @param whenSuccessful the Runnable to call when permission is granted */ - public void handleRequestPermissionsResult(Activity context, @NonNull int[] grantResults, + public void handleRequestPermissionsResult(@NonNull Activity context, @NonNull int[] grantResults, int requestCode, int expectedRequest, @NonNull Runnable whenSuccessful) { if (requestCode == expectedRequest && grantResults.length > 0) { @@ -111,7 +112,7 @@ private static class SingletonHolder { * Manage storage permission for api above 30 */ - public void checkStoragePermissionAndProceed(Context context, final GenericCallback callback) { + public void checkStoragePermissionAndProceed(@NonNull Context context, final @NonNull GenericCallback callback) { if (Build.VERSION.SDK_INT >= 30) { if (Environment.isExternalStorageManager()) { callback.proceed(); @@ -128,7 +129,7 @@ public void checkStoragePermissionAndProceed(Context context, final GenericCallb } } - public boolean isStoragePermissionGranted(Context context) { + public boolean isStoragePermissionGranted(@NonNull Context context) { if (Build.VERSION.SDK_INT >= 30) { return Environment.isExternalStorageManager(); } else { diff --git a/app/src/main/java/swati4star/createpdf/util/PopulateList.java b/app/src/main/java/swati4star/createpdf/util/PopulateList.java index f54135e12..2aff7485a 100644 --- a/app/src/main/java/swati4star/createpdf/util/PopulateList.java +++ b/app/src/main/java/swati4star/createpdf/util/PopulateList.java @@ -39,9 +39,9 @@ public class PopulateList extends AsyncTask { * @param index - sorting order * @param mQuery - to filter pdf files, {@code null} to get all */ - public PopulateList(ViewFilesAdapter adapter, - EmptyStateChangeListener emptyStateChangeListener, - DirectoryUtils directoryUtils, int index, @Nullable String mQuery) { + public PopulateList(@NonNull ViewFilesAdapter adapter, + @NonNull EmptyStateChangeListener emptyStateChangeListener, + @NonNull DirectoryUtils directoryUtils, int index, @Nullable String mQuery) { this.mAdapter = adapter; mCurrentSortingIndex = index; mEmptyStateChangeListener = emptyStateChangeListener; diff --git a/app/src/main/java/swati4star/createpdf/util/RealPathUtil.java b/app/src/main/java/swati4star/createpdf/util/RealPathUtil.java index ebfc90bcc..a8e271664 100644 --- a/app/src/main/java/swati4star/createpdf/util/RealPathUtil.java +++ b/app/src/main/java/swati4star/createpdf/util/RealPathUtil.java @@ -10,8 +10,11 @@ import android.text.TextUtils; import android.util.Log; +import androidx.annotation.NonNull; + public class RealPathUtil { + @NonNull public static RealPathUtil getInstance() { return RealPathUtil.SingletonHolder.INSTANCE; } @@ -23,7 +26,8 @@ public static RealPathUtil getInstance() { * @param fileUri - uri of file * @return - actual path */ - public String getRealPath(Context context, Uri fileUri) { + @NonNull + public String getRealPath(@NonNull Context context, @NonNull Uri fileUri) { return getRealPathFromURI_API19(context, fileUri); } diff --git a/app/src/main/java/swati4star/createpdf/util/RecentUtil.java b/app/src/main/java/swati4star/createpdf/util/RecentUtil.java index 76ab7fde6..c8d438a85 100644 --- a/app/src/main/java/swati4star/createpdf/util/RecentUtil.java +++ b/app/src/main/java/swati4star/createpdf/util/RecentUtil.java @@ -4,6 +4,8 @@ import android.content.SharedPreferences; +import androidx.annotation.NonNull; + import org.json.JSONException; import org.json.JSONObject; @@ -14,6 +16,7 @@ public class RecentUtil { + @NonNull public static RecentUtil getInstance() { return RecentUtil.SingletonHolder.INSTANCE; } @@ -25,7 +28,8 @@ public static RecentUtil getInstance() { * @return LinkedHashMap consisting of string as a key holding the feature view Id when it was * clicked and map of drawable Id and title string res Id. */ - public LinkedHashMap> getList(SharedPreferences preferences) + @NonNull + public LinkedHashMap> getList(@NonNull SharedPreferences preferences) throws JSONException { //creating the empty list. @@ -61,8 +65,8 @@ public LinkedHashMap> getList(SharedPreferences pref * @param resId - the view Id basically the feature that was clicked. * @param itemClicked - Map of Drawable Id and title string resId received from HomePageItem. */ - public void addFeatureInRecentList(SharedPreferences preferences, - int resId, Map itemClicked) throws JSONException { + public void addFeatureInRecentList(@NonNull SharedPreferences preferences, + int resId, @NonNull Map itemClicked) throws JSONException { LinkedHashMap> recentList = getList(preferences); diff --git a/app/src/main/java/swati4star/createpdf/util/RemoveDuplicates.java b/app/src/main/java/swati4star/createpdf/util/RemoveDuplicates.java index dea05ffbe..ed4547ed2 100644 --- a/app/src/main/java/swati4star/createpdf/util/RemoveDuplicates.java +++ b/app/src/main/java/swati4star/createpdf/util/RemoveDuplicates.java @@ -7,6 +7,8 @@ import android.os.AsyncTask; import android.os.ParcelFileDescriptor; +import androidx.annotation.NonNull; + import com.itextpdf.text.DocumentException; import com.itextpdf.text.pdf.PdfReader; import com.itextpdf.text.pdf.PdfStamper; @@ -25,7 +27,7 @@ public class RemoveDuplicates extends AsyncTask { private String mPath; private Boolean mIsNewPDFCreated; - public RemoveDuplicates(String mPath, OnPDFCreatedInterface onPDFCreatedInterface) { + public RemoveDuplicates(@NonNull String mPath, @NonNull OnPDFCreatedInterface onPDFCreatedInterface) { this.mPath = mPath; mSequence = new StringBuilder(); mBitmaps = new ArrayList<>(); diff --git a/app/src/main/java/swati4star/createpdf/util/ResultUtils.java b/app/src/main/java/swati4star/createpdf/util/ResultUtils.java index fcb43a992..971305d66 100644 --- a/app/src/main/java/swati4star/createpdf/util/ResultUtils.java +++ b/app/src/main/java/swati4star/createpdf/util/ResultUtils.java @@ -3,16 +3,19 @@ import android.app.Activity; import android.content.Intent; +import androidx.annotation.NonNull; + public class ResultUtils { private ResultUtils() { } + @NonNull public static ResultUtils getInstance() { return ResultUtils.SingletonHolder.INSTANCE; } - public boolean checkResultValidity(int resultCode, Intent data) { + public boolean checkResultValidity(int resultCode, @NonNull Intent data) { return resultCode == Activity.RESULT_OK && data != null && data.getData() != null; } diff --git a/app/src/main/java/swati4star/createpdf/util/SettingsOptions.java b/app/src/main/java/swati4star/createpdf/util/SettingsOptions.java index 36c9048f3..433c69095 100644 --- a/app/src/main/java/swati4star/createpdf/util/SettingsOptions.java +++ b/app/src/main/java/swati4star/createpdf/util/SettingsOptions.java @@ -6,6 +6,8 @@ import android.content.SharedPreferences; import android.preference.PreferenceManager; +import androidx.annotation.NonNull; + import com.itextpdf.text.Font; import java.util.ArrayList; @@ -15,7 +17,8 @@ public class SettingsOptions { - public static ArrayList getEnhancementOptions(Context context) { + @NonNull + public static ArrayList getEnhancementOptions(@NonNull Context context) { ArrayList options = new ArrayList<>(); SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context); diff --git a/app/src/main/java/swati4star/createpdf/util/SharedPreferencesUtil.java b/app/src/main/java/swati4star/createpdf/util/SharedPreferencesUtil.java index ca2b55d8d..8c90dbe26 100644 --- a/app/src/main/java/swati4star/createpdf/util/SharedPreferencesUtil.java +++ b/app/src/main/java/swati4star/createpdf/util/SharedPreferencesUtil.java @@ -2,11 +2,14 @@ import android.content.SharedPreferences; +import androidx.annotation.NonNull; + public class SharedPreferencesUtil { private SharedPreferencesUtil() { } + @NonNull public static SharedPreferencesUtil getInstance() { return SharedPreferencesUtil.SingletonHolder.INSTANCE; } @@ -18,7 +21,7 @@ public static SharedPreferencesUtil getInstance() { * @param pageNumStyle the page numbering style as defined in {@link Constants} * @param id the id of the style */ - public void setDefaultPageNumStyle(SharedPreferences.Editor editor, String pageNumStyle, int id) { + public void setDefaultPageNumStyle(@NonNull SharedPreferences.Editor editor, @NonNull String pageNumStyle, int id) { editor.putString(Constants.PREF_PAGE_STYLE, pageNumStyle); editor.putInt(Constants.PREF_PAGE_STYLE_ID, id); editor.apply(); @@ -29,7 +32,7 @@ public void setDefaultPageNumStyle(SharedPreferences.Editor editor, String pageN * * @param editor the {@link SharedPreferences.Editor} to use for editing */ - public void clearDefaultPageNumStyle(SharedPreferences.Editor editor) { + public void clearDefaultPageNumStyle(@NonNull SharedPreferences.Editor editor) { setDefaultPageNumStyle(editor, null, -1); } diff --git a/app/src/main/java/swati4star/createpdf/util/SplitPDFUtils.java b/app/src/main/java/swati4star/createpdf/util/SplitPDFUtils.java index a7ab86a44..5ceae86a9 100644 --- a/app/src/main/java/swati4star/createpdf/util/SplitPDFUtils.java +++ b/app/src/main/java/swati4star/createpdf/util/SplitPDFUtils.java @@ -8,6 +8,8 @@ import android.preference.PreferenceManager; import android.util.Log; +import androidx.annotation.NonNull; + import com.itextpdf.text.Document; import com.itextpdf.text.DocumentException; import com.itextpdf.text.pdf.PdfCopy; @@ -31,7 +33,7 @@ public class SplitPDFUtils { private final Activity mContext; private final SharedPreferences mSharedPreferences; - public SplitPDFUtils(Activity context) { + public SplitPDFUtils(@NonNull Activity context) { this.mContext = context; mSharedPreferences = PreferenceManager .getDefaultSharedPreferences(mContext); @@ -57,7 +59,7 @@ public SplitPDFUtils(Activity context) { * ERROR_PAGE_RANGE if range is invalid like 9-4 * ERROR_INVALID_INPUT if input is invalid like -3 or 3--4 or 3,,4 */ - public static int checkRangeValidity(int numOfPages, String[] ranges) { + public static int checkRangeValidity(int numOfPages, @NonNull String[] ranges) { int startPage, endPage; int returnValue = NO_ERROR; @@ -106,7 +108,8 @@ public static int checkRangeValidity(int numOfPages, String[] ranges) { * @param splitDetail string that contains split configuration * @return output splitted string array */ - public ArrayList splitPDFByConfig(String path, String splitDetail) { + @NonNull + public ArrayList splitPDFByConfig(@NonNull String path, @NonNull String splitDetail) { String splitConfig = splitDetail.replaceAll("\\s+", ""); ArrayList outputPaths = new ArrayList<>(); String delims = "[,]"; diff --git a/app/src/main/java/swati4star/createpdf/util/StringUtils.java b/app/src/main/java/swati4star/createpdf/util/StringUtils.java index 13d24ec31..b4f84ba2a 100644 --- a/app/src/main/java/swati4star/createpdf/util/StringUtils.java +++ b/app/src/main/java/swati4star/createpdf/util/StringUtils.java @@ -9,6 +9,8 @@ import android.view.View; import android.view.inputmethod.InputMethodManager; +import androidx.annotation.NonNull; + import com.google.android.material.snackbar.Snackbar; import java.io.File; @@ -24,39 +26,42 @@ public class StringUtils { private StringUtils() { } + @NonNull public static StringUtils getInstance() { return StringUtils.SingletonHolder.INSTANCE; } - public boolean isEmpty(CharSequence s) { + public boolean isEmpty(@NonNull CharSequence s) { return s == null || s.toString().trim().equals(""); } - public boolean isNotEmpty(CharSequence s) { + public boolean isNotEmpty(@NonNull CharSequence s) { return s != null && !s.toString().trim().equals(""); } - public void showSnackbar(Activity context, int resID) { + public void showSnackbar(@NonNull Activity context, int resID) { Snackbar.make(Objects.requireNonNull(context).findViewById(android.R.id.content), resID, Snackbar.LENGTH_LONG).show(); } - public void showSnackbar(Activity context, String resID) { + public void showSnackbar(@NonNull Activity context, @NonNull String resID) { Snackbar.make(Objects.requireNonNull(context).findViewById(android.R.id.content), resID, Snackbar.LENGTH_LONG).show(); } - public Snackbar showIndefiniteSnackbar(Activity context, String resID) { + @NonNull + public Snackbar showIndefiniteSnackbar(@NonNull Activity context, @NonNull String resID) { return Snackbar.make(Objects.requireNonNull(context).findViewById(android.R.id.content), resID, Snackbar.LENGTH_INDEFINITE); } - public Snackbar getSnackbarwithAction(Activity context, int resID) { + @NonNull + public Snackbar getSnackbarwithAction(@NonNull Activity context, int resID) { return Snackbar.make(Objects.requireNonNull(context).findViewById(android.R.id.content), resID, Snackbar.LENGTH_LONG); } - public void hideKeyboard(Activity activity) { + public void hideKeyboard(@NonNull Activity activity) { InputMethodManager imm = (InputMethodManager) activity.getSystemService(Activity.INPUT_METHOD_SERVICE); //Find the currently focused view, so we can grab the correct window token from it. View view = activity.getCurrentFocus(); @@ -68,6 +73,7 @@ public void hideKeyboard(Activity activity) { imm.hideSoftInputFromWindow(view.getWindowToken(), 0); } + @NonNull public String getDefaultStorageLocation() { File dir = new File(Environment.getExternalStorageDirectory().getAbsolutePath(), pdfDirectory); @@ -89,7 +95,7 @@ public String getDefaultStorageLocation() { * @return the text parsed to an int or the default value * @throws NumberFormatException if the text is not empty and not formatted as an int */ - public int parseIntOrDefault(CharSequence text, int def) throws NumberFormatException { + public int parseIntOrDefault(@NonNull CharSequence text, int def) throws NumberFormatException { if (isEmpty(text)) return def; else diff --git a/app/src/main/java/swati4star/createpdf/util/TextFileReader.java b/app/src/main/java/swati4star/createpdf/util/TextFileReader.java index 88d3ddde0..6a055f613 100644 --- a/app/src/main/java/swati4star/createpdf/util/TextFileReader.java +++ b/app/src/main/java/swati4star/createpdf/util/TextFileReader.java @@ -3,6 +3,8 @@ import android.content.Context; import android.net.Uri; +import androidx.annotation.NonNull; + import com.itextpdf.text.Document; import com.itextpdf.text.Element; import com.itextpdf.text.Font; @@ -14,13 +16,13 @@ public class TextFileReader extends FileReader { - public TextFileReader(Context context) { + public TextFileReader(@NonNull Context context) { super(context); } @Override protected void createDocumentFromStream( - Uri uri, Document document, Font myfont, InputStream inputStream) throws Exception { + @NonNull Uri uri, @NonNull Document document, @NonNull Font myfont, @NonNull InputStream inputStream) throws Exception { BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream)); String line; diff --git a/app/src/main/java/swati4star/createpdf/util/TextToPDFUtils.java b/app/src/main/java/swati4star/createpdf/util/TextToPDFUtils.java index 7a76e3a2d..50ef31bb4 100644 --- a/app/src/main/java/swati4star/createpdf/util/TextToPDFUtils.java +++ b/app/src/main/java/swati4star/createpdf/util/TextToPDFUtils.java @@ -9,6 +9,8 @@ import android.graphics.Color; import android.preference.PreferenceManager; +import androidx.annotation.NonNull; + import com.itextpdf.text.BaseColor; import com.itextpdf.text.Document; import com.itextpdf.text.DocumentException; @@ -33,7 +35,7 @@ public class TextToPDFUtils { private final DocFileReader mDocFileReader; private final DocxFileReader mDocxFileReader; - public TextToPDFUtils(Activity context) { + public TextToPDFUtils(@NonNull Activity context) { mContext = context; mTextFileReader = new TextFileReader(mContext); mDocFileReader = new DocFileReader(mContext); @@ -48,7 +50,7 @@ public TextToPDFUtils(Activity context) { * @param mTextToPDFOptions TextToPDFOptions Object * @param fileExtension file extension represented as string */ - public void createPdfFromTextFile(TextToPDFOptions mTextToPDFOptions, String fileExtension) + public void createPdfFromTextFile(@NonNull TextToPDFOptions mTextToPDFOptions, @NonNull String fileExtension) throws DocumentException, IOException { String masterpwd = mSharedPreferences.getString(MASTER_PWD_STRING, appName); diff --git a/app/src/main/java/swati4star/createpdf/util/TextToPdfAsync.java b/app/src/main/java/swati4star/createpdf/util/TextToPdfAsync.java index ab8c96167..2022441a1 100644 --- a/app/src/main/java/swati4star/createpdf/util/TextToPdfAsync.java +++ b/app/src/main/java/swati4star/createpdf/util/TextToPdfAsync.java @@ -2,6 +2,8 @@ import android.os.AsyncTask; +import androidx.annotation.NonNull; + import swati4star.createpdf.interfaces.OnTextToPdfInterface; import swati4star.createpdf.model.TextToPDFOptions; @@ -22,8 +24,8 @@ public class TextToPdfAsync extends AsyncTask { * @param fileextension is the file extension name string. * @param onPDFCreatedInterface is the OnTextToPdfInterface instance. */ - public TextToPdfAsync(TextToPDFUtils textToPDFutil, TextToPDFOptions textToPDFOptions, - String fileextension, OnTextToPdfInterface onPDFCreatedInterface) { + public TextToPdfAsync(@NonNull TextToPDFUtils textToPDFutil, @NonNull TextToPDFOptions textToPDFOptions, + @NonNull String fileextension, @NonNull OnTextToPdfInterface onPDFCreatedInterface) { this.mTexttoPDFUtil = textToPDFutil; this.mTextToPdfOptions = textToPDFOptions; this.mFileExtension = fileextension; diff --git a/app/src/main/java/swati4star/createpdf/util/ThemeUtils.java b/app/src/main/java/swati4star/createpdf/util/ThemeUtils.java index b7e41854d..e20c6c1ed 100644 --- a/app/src/main/java/swati4star/createpdf/util/ThemeUtils.java +++ b/app/src/main/java/swati4star/createpdf/util/ThemeUtils.java @@ -10,10 +10,13 @@ import android.content.res.Configuration; import android.preference.PreferenceManager; +import androidx.annotation.NonNull; + import swati4star.createpdf.R; public class ThemeUtils { + @NonNull public static ThemeUtils getInstance() { return ThemeUtils.SingletonHolder.INSTANCE; } @@ -23,7 +26,7 @@ public static ThemeUtils getInstance() { * * @param context - current context */ - public void setThemeApp(Context context) { + public void setThemeApp(@NonNull Context context) { SharedPreferences mSharedPreferences = PreferenceManager.getDefaultSharedPreferences(context); String themeName = mSharedPreferences.getString(Constants.DEFAULT_THEME_TEXT, Constants.DEFAULT_THEME); @@ -55,7 +58,7 @@ public void setThemeApp(Context context) { * @param context - current context * @return - position */ - public int getSelectedThemePosition(Context context) { + public int getSelectedThemePosition(@NonNull Context context) { SharedPreferences mSharedPreferences = PreferenceManager.getDefaultSharedPreferences(context); String themeName = mSharedPreferences.getString(Constants.DEFAULT_THEME_TEXT, Constants.DEFAULT_THEME); @@ -78,7 +81,7 @@ public int getSelectedThemePosition(Context context) { * @param context - current context * @param themeName - name of theme to save */ - public void saveTheme(Context context, String themeName) { + public void saveTheme(@NonNull Context context, @NonNull String themeName) { SharedPreferences mSharedPreferences = PreferenceManager.getDefaultSharedPreferences(context); SharedPreferences.Editor editor = mSharedPreferences.edit(); editor.putString(Constants.DEFAULT_THEME_TEXT, themeName); diff --git a/app/src/main/java/swati4star/createpdf/util/ViewFilesDividerItemDecoration.java b/app/src/main/java/swati4star/createpdf/util/ViewFilesDividerItemDecoration.java index b3df7bb8c..26f57b58a 100644 --- a/app/src/main/java/swati4star/createpdf/util/ViewFilesDividerItemDecoration.java +++ b/app/src/main/java/swati4star/createpdf/util/ViewFilesDividerItemDecoration.java @@ -19,12 +19,12 @@ public class ViewFilesDividerItemDecoration extends RecyclerView.ItemDecoration { private final Drawable mDivider; - public ViewFilesDividerItemDecoration(Context context) { + public ViewFilesDividerItemDecoration(@NonNull Context context) { mDivider = context.getResources().getDrawable(R.drawable.files_divider); } @Override - public void onDrawOver(@NonNull Canvas canvas, RecyclerView parent, @NonNull RecyclerView.State state) { + public void onDrawOver(@NonNull Canvas canvas, @NonNull RecyclerView parent, @NonNull RecyclerView.State state) { int left = parent.getPaddingLeft(); int right = parent.getWidth() - parent.getPaddingRight(); diff --git a/app/src/main/java/swati4star/createpdf/util/WatermarkUtils.java b/app/src/main/java/swati4star/createpdf/util/WatermarkUtils.java index 55dc3fa6b..8f96415f2 100644 --- a/app/src/main/java/swati4star/createpdf/util/WatermarkUtils.java +++ b/app/src/main/java/swati4star/createpdf/util/WatermarkUtils.java @@ -7,6 +7,8 @@ import android.widget.EditText; import android.widget.Spinner; +import androidx.annotation.NonNull; + import com.afollestad.materialdialogs.DialogAction; import com.afollestad.materialdialogs.MaterialDialog; import com.github.danielnilsson9.colorpickerview.view.ColorPickerView; @@ -35,12 +37,12 @@ public class WatermarkUtils { private final FileUtils mFileUtils; private Watermark mWatermark; - public WatermarkUtils(Activity context) { + public WatermarkUtils(@NonNull Activity context) { mContext = context; mFileUtils = new FileUtils(context); } - public static int getStyleValueFromName(String name) { + public static int getStyleValueFromName(@NonNull String name) { switch (name) { case "BOLD": return Font.BOLD; @@ -57,6 +59,7 @@ public static int getStyleValueFromName(String name) { } } + @NonNull public static String getStyleNameFromFont(int font) { switch (font) { case Font.BOLD: @@ -74,7 +77,7 @@ public static String getStyleNameFromFont(int font) { } } - public void setWatermark(String path, final DataSetChanged dataSetChanged) { + public void setWatermark(@NonNull String path, final @NonNull DataSetChanged dataSetChanged) { final MaterialDialog mDialog = new MaterialDialog.Builder(mContext) .title(R.string.add_watermark) diff --git a/app/src/main/java/swati4star/createpdf/util/WhatsNewUtils.java b/app/src/main/java/swati4star/createpdf/util/WhatsNewUtils.java index bac21f280..4d28cec4c 100644 --- a/app/src/main/java/swati4star/createpdf/util/WhatsNewUtils.java +++ b/app/src/main/java/swati4star/createpdf/util/WhatsNewUtils.java @@ -5,6 +5,7 @@ import android.widget.Button; import android.widget.TextView; +import androidx.annotation.NonNull; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; @@ -23,6 +24,7 @@ public class WhatsNewUtils { + @NonNull public static WhatsNewUtils getInstance() { return WhatsNewUtils.SingletonHolder.INSTANCE; } @@ -32,7 +34,7 @@ public static WhatsNewUtils getInstance() { * * @param context - current context */ - public void displayDialog(Context context) { + public void displayDialog(@NonNull Context context) { final Dialog dialog = new Dialog(context); dialog.setContentView(R.layout.fragment_whats_new); RecyclerView rv = dialog.findViewById(R.id.whatsNewListView); diff --git a/app/src/main/java/swati4star/createpdf/util/ZipToPdf.java b/app/src/main/java/swati4star/createpdf/util/ZipToPdf.java index a11612cf4..c52c7fe22 100644 --- a/app/src/main/java/swati4star/createpdf/util/ZipToPdf.java +++ b/app/src/main/java/swati4star/createpdf/util/ZipToPdf.java @@ -7,6 +7,8 @@ import android.net.Uri; import android.os.Environment; +import androidx.annotation.NonNull; + import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.File; @@ -24,6 +26,7 @@ public class ZipToPdf { private static final int BUFFER_SIZE = 4096; + @NonNull public static ZipToPdf getInstance() { return ZipToPdf.SingletonHolder.INSTANCE; } @@ -34,7 +37,7 @@ public static ZipToPdf getInstance() { * @param path - path of zip file * @param context - current context */ - public void convertZipToPDF(String path, Activity context) { + public void convertZipToPDF(@NonNull String path, @NonNull Activity context) { BufferedOutputStream bufferedOutputStream; ArrayList imageUris = new ArrayList<>(); diff --git a/app/src/main/res/drawable-hdpi/auto_fix.png b/app/src/main/res/drawable-hdpi/auto_fix.png deleted file mode 100644 index de9a65022..000000000 Binary files a/app/src/main/res/drawable-hdpi/auto_fix.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/auto_fix.webp b/app/src/main/res/drawable-hdpi/auto_fix.webp new file mode 100644 index 000000000..6d837bcd8 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/auto_fix.webp differ diff --git a/app/src/main/res/drawable-hdpi/black.png b/app/src/main/res/drawable-hdpi/black.png deleted file mode 100644 index eec104cc6..000000000 Binary files a/app/src/main/res/drawable-hdpi/black.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/black.webp b/app/src/main/res/drawable-hdpi/black.webp new file mode 100644 index 000000000..b64f512a2 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/black.webp differ diff --git a/app/src/main/res/drawable-hdpi/brightness.png b/app/src/main/res/drawable-hdpi/brightness.png deleted file mode 100644 index 1e040b0b1..000000000 Binary files a/app/src/main/res/drawable-hdpi/brightness.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/brightness.webp b/app/src/main/res/drawable-hdpi/brightness.webp new file mode 100644 index 000000000..baeeb18a7 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/brightness.webp differ diff --git a/app/src/main/res/drawable-hdpi/circle.png b/app/src/main/res/drawable-hdpi/circle.png deleted file mode 100644 index 72cc7b960..000000000 Binary files a/app/src/main/res/drawable-hdpi/circle.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/circle.webp b/app/src/main/res/drawable-hdpi/circle.webp new file mode 100644 index 000000000..c13202f75 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/circle.webp differ diff --git a/app/src/main/res/drawable-hdpi/contrast.png b/app/src/main/res/drawable-hdpi/contrast.png deleted file mode 100644 index 095e1bb73..000000000 Binary files a/app/src/main/res/drawable-hdpi/contrast.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/contrast.webp b/app/src/main/res/drawable-hdpi/contrast.webp new file mode 100644 index 000000000..07891ff7b Binary files /dev/null and b/app/src/main/res/drawable-hdpi/contrast.webp differ diff --git a/app/src/main/res/drawable-hdpi/cross_process.png b/app/src/main/res/drawable-hdpi/cross_process.png deleted file mode 100644 index 76f849de5..000000000 Binary files a/app/src/main/res/drawable-hdpi/cross_process.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/cross_process.webp b/app/src/main/res/drawable-hdpi/cross_process.webp new file mode 100644 index 000000000..d91e1e436 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/cross_process.webp differ diff --git a/app/src/main/res/drawable-hdpi/documentary.png b/app/src/main/res/drawable-hdpi/documentary.png deleted file mode 100644 index 95bce1832..000000000 Binary files a/app/src/main/res/drawable-hdpi/documentary.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/documentary.webp b/app/src/main/res/drawable-hdpi/documentary.webp new file mode 100644 index 000000000..69357e2be Binary files /dev/null and b/app/src/main/res/drawable-hdpi/documentary.webp differ diff --git a/app/src/main/res/drawable-hdpi/due_tone.png b/app/src/main/res/drawable-hdpi/due_tone.png deleted file mode 100644 index 9f02dcadb..000000000 Binary files a/app/src/main/res/drawable-hdpi/due_tone.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/due_tone.webp b/app/src/main/res/drawable-hdpi/due_tone.webp new file mode 100644 index 000000000..c944ca9ad Binary files /dev/null and b/app/src/main/res/drawable-hdpi/due_tone.webp differ diff --git a/app/src/main/res/drawable-hdpi/extract_images.png b/app/src/main/res/drawable-hdpi/extract_images.png deleted file mode 100644 index 6ed370001..000000000 Binary files a/app/src/main/res/drawable-hdpi/extract_images.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/extract_images.webp b/app/src/main/res/drawable-hdpi/extract_images.webp new file mode 100644 index 000000000..de53204f2 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/extract_images.webp differ diff --git a/app/src/main/res/drawable-hdpi/fill_light.png b/app/src/main/res/drawable-hdpi/fill_light.png deleted file mode 100644 index 77dc5ee8b..000000000 Binary files a/app/src/main/res/drawable-hdpi/fill_light.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/fill_light.webp b/app/src/main/res/drawable-hdpi/fill_light.webp new file mode 100644 index 000000000..2c2174e63 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/fill_light.webp differ diff --git a/app/src/main/res/drawable-hdpi/flip_horizontal.png b/app/src/main/res/drawable-hdpi/flip_horizontal.png deleted file mode 100644 index 2fc892472..000000000 Binary files a/app/src/main/res/drawable-hdpi/flip_horizontal.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/flip_horizontal.webp b/app/src/main/res/drawable-hdpi/flip_horizontal.webp new file mode 100644 index 000000000..97a5e6d43 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/flip_horizontal.webp differ diff --git a/app/src/main/res/drawable-hdpi/flip_vertical.png b/app/src/main/res/drawable-hdpi/flip_vertical.png deleted file mode 100644 index ed2146a09..000000000 Binary files a/app/src/main/res/drawable-hdpi/flip_vertical.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/flip_vertical.webp b/app/src/main/res/drawable-hdpi/flip_vertical.webp new file mode 100644 index 000000000..acf752b97 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/flip_vertical.webp differ diff --git a/app/src/main/res/drawable-hdpi/grain.png b/app/src/main/res/drawable-hdpi/grain.png deleted file mode 100644 index 794528af2..000000000 Binary files a/app/src/main/res/drawable-hdpi/grain.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/grain.webp b/app/src/main/res/drawable-hdpi/grain.webp new file mode 100644 index 000000000..a22eb6057 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/grain.webp differ diff --git a/app/src/main/res/drawable-hdpi/lomish.png b/app/src/main/res/drawable-hdpi/lomish.png deleted file mode 100644 index ab0e627f9..000000000 Binary files a/app/src/main/res/drawable-hdpi/lomish.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/lomish.webp b/app/src/main/res/drawable-hdpi/lomish.webp new file mode 100644 index 000000000..75087ca80 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/lomish.webp differ diff --git a/app/src/main/res/drawable-hdpi/negative.png b/app/src/main/res/drawable-hdpi/negative.png deleted file mode 100644 index 7621da43c..000000000 Binary files a/app/src/main/res/drawable-hdpi/negative.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/negative.webp b/app/src/main/res/drawable-hdpi/negative.webp new file mode 100644 index 000000000..0797269de Binary files /dev/null and b/app/src/main/res/drawable-hdpi/negative.webp differ diff --git a/app/src/main/res/drawable-hdpi/none.png b/app/src/main/res/drawable-hdpi/none.png deleted file mode 100644 index c8e866c10..000000000 Binary files a/app/src/main/res/drawable-hdpi/none.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/none.webp b/app/src/main/res/drawable-hdpi/none.webp new file mode 100644 index 000000000..ac2a21113 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/none.webp differ diff --git a/app/src/main/res/drawable-hdpi/poster.png b/app/src/main/res/drawable-hdpi/poster.png deleted file mode 100644 index 81e22ee31..000000000 Binary files a/app/src/main/res/drawable-hdpi/poster.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/poster.webp b/app/src/main/res/drawable-hdpi/poster.webp new file mode 100644 index 000000000..771887fd6 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/poster.webp differ diff --git a/app/src/main/res/drawable-hdpi/qrcode_to_pdf.png b/app/src/main/res/drawable-hdpi/qrcode_to_pdf.png deleted file mode 100644 index 8ce517b53..000000000 Binary files a/app/src/main/res/drawable-hdpi/qrcode_to_pdf.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/qrcode_to_pdf.webp b/app/src/main/res/drawable-hdpi/qrcode_to_pdf.webp new file mode 100644 index 000000000..55d63dae7 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/qrcode_to_pdf.webp differ diff --git a/app/src/main/res/drawable-hdpi/remove_reorder.png b/app/src/main/res/drawable-hdpi/remove_reorder.png deleted file mode 100644 index 95e89941e..000000000 Binary files a/app/src/main/res/drawable-hdpi/remove_reorder.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/remove_reorder.webp b/app/src/main/res/drawable-hdpi/remove_reorder.webp new file mode 100644 index 000000000..d7d3663e7 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/remove_reorder.webp differ diff --git a/app/src/main/res/drawable-hdpi/rotate.png b/app/src/main/res/drawable-hdpi/rotate.png deleted file mode 100644 index 0c1de49a6..000000000 Binary files a/app/src/main/res/drawable-hdpi/rotate.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/rotate.webp b/app/src/main/res/drawable-hdpi/rotate.webp new file mode 100644 index 000000000..7792e12c9 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/rotate.webp differ diff --git a/app/src/main/res/drawable-hdpi/saturate.png b/app/src/main/res/drawable-hdpi/saturate.png deleted file mode 100644 index f5969c1c1..000000000 Binary files a/app/src/main/res/drawable-hdpi/saturate.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/saturate.webp b/app/src/main/res/drawable-hdpi/saturate.webp new file mode 100644 index 000000000..ee2639a98 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/saturate.webp differ diff --git a/app/src/main/res/drawable-hdpi/sepia.png b/app/src/main/res/drawable-hdpi/sepia.png deleted file mode 100644 index 24ce05531..000000000 Binary files a/app/src/main/res/drawable-hdpi/sepia.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/sepia.webp b/app/src/main/res/drawable-hdpi/sepia.webp new file mode 100644 index 000000000..5a5d72493 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/sepia.webp differ diff --git a/app/src/main/res/drawable-hdpi/sharpen.png b/app/src/main/res/drawable-hdpi/sharpen.png deleted file mode 100644 index 48382b349..000000000 Binary files a/app/src/main/res/drawable-hdpi/sharpen.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/sharpen.webp b/app/src/main/res/drawable-hdpi/sharpen.webp new file mode 100644 index 000000000..b99141b1f Binary files /dev/null and b/app/src/main/res/drawable-hdpi/sharpen.webp differ diff --git a/app/src/main/res/drawable-hdpi/temp.png b/app/src/main/res/drawable-hdpi/temp.png deleted file mode 100644 index e2b6f4c39..000000000 Binary files a/app/src/main/res/drawable-hdpi/temp.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/temp.webp b/app/src/main/res/drawable-hdpi/temp.webp new file mode 100644 index 000000000..508b730c6 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/temp.webp differ diff --git a/app/src/main/res/drawable-hdpi/text_to_pdf.png b/app/src/main/res/drawable-hdpi/text_to_pdf.png deleted file mode 100644 index bbee58cb6..000000000 Binary files a/app/src/main/res/drawable-hdpi/text_to_pdf.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/text_to_pdf.webp b/app/src/main/res/drawable-hdpi/text_to_pdf.webp new file mode 100644 index 000000000..02464f64a Binary files /dev/null and b/app/src/main/res/drawable-hdpi/text_to_pdf.webp differ diff --git a/app/src/main/res/drawable-hdpi/vignette.png b/app/src/main/res/drawable-hdpi/vignette.png deleted file mode 100644 index 3c4f790f9..000000000 Binary files a/app/src/main/res/drawable-hdpi/vignette.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/vignette.webp b/app/src/main/res/drawable-hdpi/vignette.webp new file mode 100644 index 000000000..4036be334 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/vignette.webp differ diff --git a/app/src/main/res/drawable-xxhdpi/circle.png b/app/src/main/res/drawable-xxhdpi/circle.png deleted file mode 100644 index f5a7648d0..000000000 Binary files a/app/src/main/res/drawable-xxhdpi/circle.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/circle.webp b/app/src/main/res/drawable-xxhdpi/circle.webp new file mode 100644 index 000000000..b8d55b577 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/circle.webp differ diff --git a/app/src/main/res/drawable-xxhdpi/tint.gif b/app/src/main/res/drawable-xxhdpi/tint.gif deleted file mode 100644 index bde742ca1..000000000 Binary files a/app/src/main/res/drawable-xxhdpi/tint.gif and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/tint.webp b/app/src/main/res/drawable-xxhdpi/tint.webp new file mode 100644 index 000000000..d5506eb64 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/tint.webp differ diff --git a/app/src/main/res/drawable-xxxhdpi/auto_fix.png b/app/src/main/res/drawable-xxxhdpi/auto_fix.png deleted file mode 100644 index 9a1972589..000000000 Binary files a/app/src/main/res/drawable-xxxhdpi/auto_fix.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/auto_fix.webp b/app/src/main/res/drawable-xxxhdpi/auto_fix.webp new file mode 100644 index 000000000..54aefd12f Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/auto_fix.webp differ diff --git a/app/src/main/res/drawable-xxxhdpi/black.png b/app/src/main/res/drawable-xxxhdpi/black.png deleted file mode 100644 index b8de1ee0b..000000000 Binary files a/app/src/main/res/drawable-xxxhdpi/black.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/black.webp b/app/src/main/res/drawable-xxxhdpi/black.webp new file mode 100644 index 000000000..c5a658dc4 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/black.webp differ diff --git a/app/src/main/res/drawable-xxxhdpi/brightness.png b/app/src/main/res/drawable-xxxhdpi/brightness.png deleted file mode 100644 index e69253177..000000000 Binary files a/app/src/main/res/drawable-xxxhdpi/brightness.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/brightness.webp b/app/src/main/res/drawable-xxxhdpi/brightness.webp new file mode 100644 index 000000000..eb75baa16 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/brightness.webp differ diff --git a/app/src/main/res/drawable-xxxhdpi/contrast.png b/app/src/main/res/drawable-xxxhdpi/contrast.png deleted file mode 100644 index a15a0090f..000000000 Binary files a/app/src/main/res/drawable-xxxhdpi/contrast.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/contrast.webp b/app/src/main/res/drawable-xxxhdpi/contrast.webp new file mode 100644 index 000000000..d25452517 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/contrast.webp differ diff --git a/app/src/main/res/drawable-xxxhdpi/cross_process.png b/app/src/main/res/drawable-xxxhdpi/cross_process.png deleted file mode 100644 index 9220de95c..000000000 Binary files a/app/src/main/res/drawable-xxxhdpi/cross_process.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/cross_process.webp b/app/src/main/res/drawable-xxxhdpi/cross_process.webp new file mode 100644 index 000000000..429cd8e29 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/cross_process.webp differ diff --git a/app/src/main/res/drawable-xxxhdpi/documentary.png b/app/src/main/res/drawable-xxxhdpi/documentary.png deleted file mode 100644 index 6b8a5f870..000000000 Binary files a/app/src/main/res/drawable-xxxhdpi/documentary.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/documentary.webp b/app/src/main/res/drawable-xxxhdpi/documentary.webp new file mode 100644 index 000000000..d36156ff9 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/documentary.webp differ diff --git a/app/src/main/res/drawable-xxxhdpi/due_tone.png b/app/src/main/res/drawable-xxxhdpi/due_tone.png deleted file mode 100644 index d54237c48..000000000 Binary files a/app/src/main/res/drawable-xxxhdpi/due_tone.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/due_tone.webp b/app/src/main/res/drawable-xxxhdpi/due_tone.webp new file mode 100644 index 000000000..07bbb6b62 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/due_tone.webp differ diff --git a/app/src/main/res/drawable-xxxhdpi/extract_images.png b/app/src/main/res/drawable-xxxhdpi/extract_images.png deleted file mode 100644 index 55dc008ec..000000000 Binary files a/app/src/main/res/drawable-xxxhdpi/extract_images.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/extract_images.webp b/app/src/main/res/drawable-xxxhdpi/extract_images.webp new file mode 100644 index 000000000..4d64fdb03 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/extract_images.webp differ diff --git a/app/src/main/res/drawable-xxxhdpi/fill_light.png b/app/src/main/res/drawable-xxxhdpi/fill_light.png deleted file mode 100644 index 453fd68c5..000000000 Binary files a/app/src/main/res/drawable-xxxhdpi/fill_light.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/fill_light.webp b/app/src/main/res/drawable-xxxhdpi/fill_light.webp new file mode 100644 index 000000000..9a9b2776a Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/fill_light.webp differ diff --git a/app/src/main/res/drawable-xxxhdpi/flip_horizontal.png b/app/src/main/res/drawable-xxxhdpi/flip_horizontal.png deleted file mode 100644 index 2cba0be3d..000000000 Binary files a/app/src/main/res/drawable-xxxhdpi/flip_horizontal.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/flip_horizontal.webp b/app/src/main/res/drawable-xxxhdpi/flip_horizontal.webp new file mode 100644 index 000000000..a8e579942 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/flip_horizontal.webp differ diff --git a/app/src/main/res/drawable-xxxhdpi/flip_vertical.png b/app/src/main/res/drawable-xxxhdpi/flip_vertical.png deleted file mode 100644 index a15905335..000000000 Binary files a/app/src/main/res/drawable-xxxhdpi/flip_vertical.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/flip_vertical.webp b/app/src/main/res/drawable-xxxhdpi/flip_vertical.webp new file mode 100644 index 000000000..018fead84 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/flip_vertical.webp differ diff --git a/app/src/main/res/drawable-xxxhdpi/grain.png b/app/src/main/res/drawable-xxxhdpi/grain.png deleted file mode 100644 index 880540e29..000000000 Binary files a/app/src/main/res/drawable-xxxhdpi/grain.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/grain.webp b/app/src/main/res/drawable-xxxhdpi/grain.webp new file mode 100644 index 000000000..530d15813 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/grain.webp differ diff --git a/app/src/main/res/drawable-xxxhdpi/lomish.png b/app/src/main/res/drawable-xxxhdpi/lomish.png deleted file mode 100644 index 3a210ef1a..000000000 Binary files a/app/src/main/res/drawable-xxxhdpi/lomish.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/lomish.webp b/app/src/main/res/drawable-xxxhdpi/lomish.webp new file mode 100644 index 000000000..e4dfbead9 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/lomish.webp differ diff --git a/app/src/main/res/drawable-xxxhdpi/negative.png b/app/src/main/res/drawable-xxxhdpi/negative.png deleted file mode 100644 index 1711d42b0..000000000 Binary files a/app/src/main/res/drawable-xxxhdpi/negative.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/negative.webp b/app/src/main/res/drawable-xxxhdpi/negative.webp new file mode 100644 index 000000000..acda3d153 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/negative.webp differ diff --git a/app/src/main/res/drawable-xxxhdpi/none.png b/app/src/main/res/drawable-xxxhdpi/none.png deleted file mode 100644 index 03294cd99..000000000 Binary files a/app/src/main/res/drawable-xxxhdpi/none.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/none.webp b/app/src/main/res/drawable-xxxhdpi/none.webp new file mode 100644 index 000000000..d140c5360 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/none.webp differ diff --git a/app/src/main/res/drawable-xxxhdpi/poster.png b/app/src/main/res/drawable-xxxhdpi/poster.png deleted file mode 100644 index fa9ce128c..000000000 Binary files a/app/src/main/res/drawable-xxxhdpi/poster.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/poster.webp b/app/src/main/res/drawable-xxxhdpi/poster.webp new file mode 100644 index 000000000..eccdded54 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/poster.webp differ diff --git a/app/src/main/res/drawable-xxxhdpi/qrcode_to_pdf.png b/app/src/main/res/drawable-xxxhdpi/qrcode_to_pdf.png deleted file mode 100644 index 567729493..000000000 Binary files a/app/src/main/res/drawable-xxxhdpi/qrcode_to_pdf.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/qrcode_to_pdf.webp b/app/src/main/res/drawable-xxxhdpi/qrcode_to_pdf.webp new file mode 100644 index 000000000..53d3256dc Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/qrcode_to_pdf.webp differ diff --git a/app/src/main/res/drawable-xxxhdpi/remove_reorder.png b/app/src/main/res/drawable-xxxhdpi/remove_reorder.png deleted file mode 100644 index 9810a9552..000000000 Binary files a/app/src/main/res/drawable-xxxhdpi/remove_reorder.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/remove_reorder.webp b/app/src/main/res/drawable-xxxhdpi/remove_reorder.webp new file mode 100644 index 000000000..176ed7ebc Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/remove_reorder.webp differ diff --git a/app/src/main/res/drawable-xxxhdpi/rotate.png b/app/src/main/res/drawable-xxxhdpi/rotate.png deleted file mode 100644 index 86840c1e1..000000000 Binary files a/app/src/main/res/drawable-xxxhdpi/rotate.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/rotate.webp b/app/src/main/res/drawable-xxxhdpi/rotate.webp new file mode 100644 index 000000000..c29dca389 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/rotate.webp differ diff --git a/app/src/main/res/drawable-xxxhdpi/saturate.png b/app/src/main/res/drawable-xxxhdpi/saturate.png deleted file mode 100644 index 972e74599..000000000 Binary files a/app/src/main/res/drawable-xxxhdpi/saturate.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/saturate.webp b/app/src/main/res/drawable-xxxhdpi/saturate.webp new file mode 100644 index 000000000..16667e7b1 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/saturate.webp differ diff --git a/app/src/main/res/drawable-xxxhdpi/sepia.png b/app/src/main/res/drawable-xxxhdpi/sepia.png deleted file mode 100644 index 0fb218e12..000000000 Binary files a/app/src/main/res/drawable-xxxhdpi/sepia.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/sepia.webp b/app/src/main/res/drawable-xxxhdpi/sepia.webp new file mode 100644 index 000000000..de50a1b1e Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/sepia.webp differ diff --git a/app/src/main/res/drawable-xxxhdpi/sharpen.png b/app/src/main/res/drawable-xxxhdpi/sharpen.png deleted file mode 100644 index b83c81f6b..000000000 Binary files a/app/src/main/res/drawable-xxxhdpi/sharpen.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/sharpen.webp b/app/src/main/res/drawable-xxxhdpi/sharpen.webp new file mode 100644 index 000000000..ff50b026b Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/sharpen.webp differ diff --git a/app/src/main/res/drawable-xxxhdpi/temp.png b/app/src/main/res/drawable-xxxhdpi/temp.png deleted file mode 100644 index e3ffe9b7d..000000000 Binary files a/app/src/main/res/drawable-xxxhdpi/temp.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/temp.webp b/app/src/main/res/drawable-xxxhdpi/temp.webp new file mode 100644 index 000000000..4c06a4503 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/temp.webp differ diff --git a/app/src/main/res/drawable-xxxhdpi/text_to_pdf.png b/app/src/main/res/drawable-xxxhdpi/text_to_pdf.png deleted file mode 100644 index 7e24df908..000000000 Binary files a/app/src/main/res/drawable-xxxhdpi/text_to_pdf.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/text_to_pdf.webp b/app/src/main/res/drawable-xxxhdpi/text_to_pdf.webp new file mode 100644 index 000000000..c4d419904 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/text_to_pdf.webp differ diff --git a/app/src/main/res/drawable-xxxhdpi/vignette.png b/app/src/main/res/drawable-xxxhdpi/vignette.png deleted file mode 100644 index bca962740..000000000 Binary files a/app/src/main/res/drawable-xxxhdpi/vignette.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/vignette.webp b/app/src/main/res/drawable-xxxhdpi/vignette.webp new file mode 100644 index 000000000..7ffa82ec6 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/vignette.webp differ diff --git a/app/src/main/res/drawable/button_bg.xml b/app/src/main/res/drawable/button_bg.xml deleted file mode 100644 index e03030884..000000000 --- a/app/src/main/res/drawable/button_bg.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/home.webp b/app/src/main/res/drawable/home.webp deleted file mode 100644 index e86b90fcd..000000000 Binary files a/app/src/main/res/drawable/home.webp and /dev/null differ diff --git a/app/src/main/res/drawable/ic_logo.png b/app/src/main/res/drawable/ic_logo.png deleted file mode 100644 index 20ec79276..000000000 Binary files a/app/src/main/res/drawable/ic_logo.png and /dev/null differ diff --git a/app/src/main/res/drawable/ic_logo.webp b/app/src/main/res/drawable/ic_logo.webp new file mode 100644 index 000000000..7c7bce178 Binary files /dev/null and b/app/src/main/res/drawable/ic_logo.webp differ diff --git a/app/src/main/res/drawable/ic_whats_new_black_24dp.xml b/app/src/main/res/drawable/ic_whats_new_black_24dp.xml deleted file mode 100644 index 70b2294aa..000000000 --- a/app/src/main/res/drawable/ic_whats_new_black_24dp.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index b0dd854e8..46a92b211 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -18,7 +18,6 @@ android:background="@drawable/toolbar_bg"> + app:srcCompat="@mipmap/ic_launcher" + android:contentDescription="Welcome page" /> @@ -27,7 +25,6 @@ diff --git a/app/src/main/res/layout/dialog_font_family.xml b/app/src/main/res/layout/dialog_font_family.xml index 199d2001d..46ff1ab46 100644 --- a/app/src/main/res/layout/dialog_font_family.xml +++ b/app/src/main/res/layout/dialog_font_family.xml @@ -11,37 +11,31 @@ android:orientation="vertical"> diff --git a/app/src/main/res/layout/dialog_theme_default.xml b/app/src/main/res/layout/dialog_theme_default.xml index c0863e53b..98b2df7f2 100644 --- a/app/src/main/res/layout/dialog_theme_default.xml +++ b/app/src/main/res/layout/dialog_theme_default.xml @@ -6,25 +6,21 @@ android:orientation="vertical"> diff --git a/app/src/main/res/layout/directory_dialog.xml b/app/src/main/res/layout/directory_dialog.xml deleted file mode 100644 index f51ebad2f..000000000 --- a/app/src/main/res/layout/directory_dialog.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/favourites_fragment.xml b/app/src/main/res/layout/favourites_fragment.xml index 551246522..f66306aa2 100644 --- a/app/src/main/res/layout/favourites_fragment.xml +++ b/app/src/main/res/layout/favourites_fragment.xml @@ -1,7 +1,6 @@ @@ -316,5 +315,6 @@ android:focusable="true" android:src="@drawable/ic_add_black_24dp" android:tint="@android:color/white" - android:translationZ="12dp" /> + android:translationZ="12dp" + android:contentDescription="Add to Favorites" /> \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_about_us.xml b/app/src/main/res/layout/fragment_about_us.xml index b059c9013..fd6bb0643 100644 --- a/app/src/main/res/layout/fragment_about_us.xml +++ b/app/src/main/res/layout/fragment_about_us.xml @@ -41,7 +41,6 @@ android:textSize="13sp" /> diff --git a/app/src/main/res/layout/fragment_add_images.xml b/app/src/main/res/layout/fragment_add_images.xml index fcd956df0..b48cef56f 100644 --- a/app/src/main/res/layout/fragment_add_images.xml +++ b/app/src/main/res/layout/fragment_add_images.xml @@ -6,7 +6,6 @@ android:layout_height="match_parent"> + android:textSize="17sp" + style="?android:attr/buttonBarButtonStyle" />