From e5941e467f983c6a5733e1d12c086ccb7885fc7e Mon Sep 17 00:00:00 2001 From: Maksim Lin Date: Tue, 20 Mar 2018 09:18:02 +1100 Subject: [PATCH 1/2] use the correct shareprovider for appcompat menus --- .../java/me/sheimi/sgit/SGitApplication.java | 4 +- .../sgit/activities/CommitDiffActivity.java | 37 +++++++++---------- app/src/main/res/menu/diff_commits.xml | 5 ++- 3 files changed, 24 insertions(+), 22 deletions(-) diff --git a/app/src/main/java/me/sheimi/sgit/SGitApplication.java b/app/src/main/java/me/sheimi/sgit/SGitApplication.java index 28363725..d500578a 100644 --- a/app/src/main/java/me/sheimi/sgit/SGitApplication.java +++ b/app/src/main/java/me/sheimi/sgit/SGitApplication.java @@ -57,7 +57,9 @@ protected void attachBaseContext(Context base) { super.attachBaseContext(base); // The following line triggers the initialization of ACRA - ACRA.init(this); + if (!BuildConfig.DEBUG) { + ACRA.init(this); + } } diff --git a/app/src/main/java/me/sheimi/sgit/activities/CommitDiffActivity.java b/app/src/main/java/me/sheimi/sgit/activities/CommitDiffActivity.java index eab48a6a..59bfc260 100644 --- a/app/src/main/java/me/sheimi/sgit/activities/CommitDiffActivity.java +++ b/app/src/main/java/me/sheimi/sgit/activities/CommitDiffActivity.java @@ -1,21 +1,11 @@ package me.sheimi.sgit.activities; -import java.util.List; - -import me.sheimi.android.activities.SheimiFragmentActivity; -import me.sheimi.android.utils.CodeGuesser; -import me.sheimi.android.utils.FsUtils; -import me.sheimi.android.utils.Profile; -import me.sheimi.sgit.R; -import me.sheimi.sgit.database.models.Repo; -import me.sheimi.sgit.repo.tasks.repo.CommitDiffTask; -import me.sheimi.sgit.repo.tasks.repo.CommitDiffTask.CommitDiffResult; - -import org.eclipse.jgit.diff.DiffEntry; - -import android.content.Context; +import android.content.Intent; import android.graphics.Color; +import android.net.Uri; import android.os.Bundle; +import android.support.v4.view.MenuItemCompat; +import android.support.v7.widget.ShareActionProvider; import android.util.Log; import android.view.Menu; import android.view.MenuItem; @@ -25,16 +15,25 @@ import android.webkit.WebSettings; import android.webkit.WebView; import android.widget.ProgressBar; -import org.eclipse.jgit.revwalk.RevCommit; + +import org.eclipse.jgit.diff.DiffEntry; import org.eclipse.jgit.lib.PersonIdent; -import android.widget.ShareActionProvider; -import android.content.Intent; -import android.net.Uri; +import org.eclipse.jgit.revwalk.RevCommit; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; +import java.util.List; + +import me.sheimi.android.activities.SheimiFragmentActivity; +import me.sheimi.android.utils.CodeGuesser; +import me.sheimi.android.utils.FsUtils; +import me.sheimi.android.utils.Profile; +import me.sheimi.sgit.R; +import me.sheimi.sgit.database.models.Repo; +import me.sheimi.sgit.repo.tasks.repo.CommitDiffTask; +import me.sheimi.sgit.repo.tasks.repo.CommitDiffTask.CommitDiffResult; public class CommitDiffActivity extends SheimiFragmentActivity { @@ -104,7 +103,7 @@ public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.diff_commits, menu); MenuItem item = menu.findItem(R.id.action_share_diff); - ShareActionProvider shareActionProvider = (ShareActionProvider) item.getActionProvider(); + ShareActionProvider shareActionProvider = (ShareActionProvider) MenuItemCompat.getActionProvider(item); final Intent shareIntent = new Intent(android.content.Intent.ACTION_SEND); shareIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); Uri futurePathName = Uri.fromFile(sharedDiffPathName()); diff --git a/app/src/main/res/menu/diff_commits.xml b/app/src/main/res/menu/diff_commits.xml index f383cf5b..f43c401e 100644 --- a/app/src/main/res/menu/diff_commits.xml +++ b/app/src/main/res/menu/diff_commits.xml @@ -1,9 +1,10 @@ - + + app:actionProviderClass="android.support.v7.widget.ShareActionProvider" /> Date: Tue, 20 Mar 2018 09:20:20 +1100 Subject: [PATCH 2/2] bump app version for release --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 70ddf79a..545674f4 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -12,8 +12,8 @@ android { vectorDrawables.useSupportLibrary = true - versionCode 206 - versionName "1.5.4.1" + versionCode 207 + versionName "1.5.4.2" } dataBinding {