Skip to content

Commit

Permalink
Update min sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
billthefarmer committed Nov 13, 2023
1 parent bed4b4d commit 235c4b6
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 39 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ android {

defaultConfig {
applicationId "org.billthefarmer.diary"
minSdkVersion 14
minSdkVersion 21
targetSdkVersion 28
versionName "1.103"
versionCode 1103
Expand Down
21 changes: 6 additions & 15 deletions src/main/java/org/billthefarmer/diary/Diary.java
Original file line number Diff line number Diff line change
Expand Up @@ -632,8 +632,6 @@ public boolean onPrepareOptionsMenu(Menu menu)
menu.findItem(R.id.cancel).setVisible(changed);
menu.findItem(R.id.index).setVisible(useIndex);
menu.findItem(R.id.link).setVisible(useIndex);
menu.findItem(R.id.print)
.setVisible(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP);

// Set up search view
searchItem = menu.findItem(R.id.search);
Expand Down Expand Up @@ -1783,9 +1781,6 @@ private void findAll()
// print
private void print()
{
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP)
return;

// Get a PrintManager instance
PrintManager printManager = (PrintManager)
getSystemService(PRINT_SERVICE);
Expand Down Expand Up @@ -1940,14 +1935,11 @@ private void backup()
break;

case DialogInterface.BUTTON_NEUTRAL:
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT)
{
Intent intent = new Intent(Intent.ACTION_CREATE_DOCUMENT);
intent.setType(APPLICATION_ZIP);
intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.putExtra(Intent.EXTRA_TITLE, name);
startActivityForResult(intent, CREATE_BACKUP);
}
Intent intent = new Intent(Intent.ACTION_CREATE_DOCUMENT);
intent.setType(APPLICATION_ZIP);
intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.putExtra(Intent.EXTRA_TITLE, name);
startActivityForResult(intent, CREATE_BACKUP);
break;
}
});
Expand All @@ -1964,8 +1956,7 @@ private void saveAsDialog(String path, int title, int message,
// Add the buttons
builder.setPositiveButton(R.string.save, listener);
builder.setNegativeButton(android.R.string.cancel, listener);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT)
builder.setNeutralButton(R.string.storage, listener);
builder.setNeutralButton(R.string.storage, listener);

// Create edit text
LayoutInflater inflater = (LayoutInflater) builder.getContext()
Expand Down
5 changes: 1 addition & 4 deletions src/main/java/org/billthefarmer/diary/FileUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

package org.billthefarmer.diary;

import android.annotation.TargetApi;
import android.content.ContentResolver;
import android.content.ContentUris;
import android.content.Context;
Expand Down Expand Up @@ -477,7 +476,6 @@ public static String getDataColumn(Context context, Uri uri,
* @see #isLocal(String)
* @see #getFile(Context, Uri)
*/
@TargetApi(19)
public static String getPath(final Context context, final Uri uri)
{

Expand All @@ -493,8 +491,7 @@ public static String getPath(final Context context, final Uri uri)
);

// DocumentProvider
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT &&
DocumentsContract.isDocumentUri(context, uri))
if (DocumentsContract.isDocumentUri(context, uri))
{
// ExternalStorageProvider
if (isExternalStorageDocument(uri))
Expand Down
File renamed without changes.
17 changes: 0 additions & 17 deletions src/main/res/values-v21/styles.xml

This file was deleted.

4 changes: 2 additions & 2 deletions src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
replaced by AppBaseTheme from res/values-vXX/styles.xml on newer
devices.
-->
<style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">
<style name="AppBaseTheme" parent="android:Theme.Material.Light.DarkActionBar">
<!--
Theme customizations available in newer API levels can go in
res/values-vXX/styles.xml, while customizations related to
backward-compatibility can go here.
-->
</style>

<style name="AppDarkBaseTheme" parent="android:Theme.Holo">
<style name="AppDarkBaseTheme" parent="android:Theme.Material">
<!--
Theme customizations available in newer API levels can go in
res/values-vXX/styles.xml, while customizations related to
Expand Down

0 comments on commit 235c4b6

Please sign in to comment.