diff options
author | tom79 <tschneider.ac@gmail.com> | 2019-03-31 19:16:55 +0200 |
---|---|---|
committer | tom79 <tschneider.ac@gmail.com> | 2019-03-31 19:16:55 +0200 |
commit | 3b3e1544979ff0867f2d1f2e91fa1477b7b7757d (patch) | |
tree | 12f30dd94339428df88e32292cf8139792d6af64 | |
parent | c1c78cc51c2d5a4b82cd1dfae168f71e66ece738 (diff) | |
parent | 3c9b6f2d8d81aeaa50c323fab831515a3a32fa02 (diff) |
Merge branch 'develop'
94 files changed, 2787 insertions, 1466 deletions
diff --git a/app/build.gradle b/app/build.gradle index 538d5ff12..0e620ad50 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -7,8 +7,8 @@ android { applicationId "fr.gouv.etalab.mastodon" minSdkVersion 16 targetSdkVersion 28 - versionCode 249 - versionName "1.77.1" + versionCode 251 + versionName "1.78.0" multiDexEnabled true } dexOptions { @@ -55,7 +55,7 @@ ext.conscryptLibraryVersion = '2.0.0' ext.evernoteLibraryVersion = '1.2.6' ext.gsonLibraryVersion = '2.8.2' ext.guavaLibraryVersion = '24.1-android' -ext.photoViewLibraryVersion = '2.0.0' +ext.photoViewLibraryVersion = '2.1.3' ext.swipebackLibraryVersion = '1.0.3' ext.ratethisappLibraryVersion = '1.2.0' ext.uploadServiceVersion = "3.4.2" @@ -94,6 +94,6 @@ dependencies { implementation 'com.github.mabbas007:TagsEditText:1.0.5' implementation 'com.jaredrummler:material-spinner:1.3.1' implementation "com.tonyodev.fetch2:fetch2:2.3.6" - implementation 'com.github.stom79:horizontalbargraph:1.3' + implementation 'com.github.stom79:horizontalbargraph:1.5' playstoreImplementation "io.github.kobakei:ratethisapp:$ratethisappLibraryVersion" } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index b32c4c837..0719ab804 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -172,6 +172,11 @@ android:configChanges="orientation|screenSize" android:label="@string/app_name" /> + <activity android:name=".activities.SearchResultTabActivity" + android:windowSoftInputMode="stateAlwaysHidden" + android:configChanges="orientation|screenSize" + android:label="@string/app_name" + /> <activity android:name=".activities.ListActivity" android:windowSoftInputMode="stateAlwaysHidden" android:configChanges="orientation|screenSize" diff --git a/app/src/main/java/fr/gouv/etalab/mastodon/activities/BaseMainActivity.java b/app/src/main/java/fr/gouv/etalab/mastodon/activities/BaseMainActivity.java index 5849c3c7e..58bf3c9a2 100644 --- a/app/src/main/java/fr/gouv/etalab/mastodon/activities/BaseMainActivity.java +++ b/app/src/main/java/fr/gouv/etalab/mastodon/activities/BaseMainActivity.java @@ -1128,9 +1128,17 @@ public abstract class BaseMainActivity extends BaseActivity //It's not a peertube search if(displayPeertube == null){ if( social != UpdateAccountInfoAsyncTask.SOCIAL.GNU) { - Intent intent = new Intent(BaseMainActivity.this, SearchResultActivity.class); - intent.putExtra("search", query); - startActivity(intent); + if( (social == UpdateAccountInfoAsyncTask.SOCIAL.MASTODON || social == UpdateAccountInfoAsyncTask.SOCIAL.PLEROMA) + && !query.contains("http://") && !query.contains("https://")){ + Intent intent = new Intent(BaseMainActivity.this, SearchResultTabActivity.class); + intent.putExtra("search", query); + startActivity(intent); + }else{ + Intent intent = new Intent(BaseMainActivity.this, SearchResultActivity.class); + intent.putExtra("search", query); + startActivity(intent); + } + }else{ Intent intent = new Intent(BaseMainActivity.this, HashTagActivity.class); Bundle b = new Bundle(); diff --git a/app/src/main/java/fr/gouv/etalab/mastodon/activities/MediaActivity.java b/app/src/main/java/fr/gouv/etalab/mastodon/activities/MediaActivity.java index a80492efa..ad76f7b3a 100644 --- a/app/src/main/java/fr/gouv/etalab/mastodon/activities/MediaActivity.java +++ b/app/src/main/java/fr/gouv/etalab/mastodon/activities/MediaActivity.java @@ -23,11 +23,9 @@ import android.graphics.RectF; import android.net.Uri; import android.os.Build; import android.os.Bundle; -import android.os.Handler; import android.support.annotation.NonNull; import android.support.v4.app.ActivityCompat; import android.support.v4.content.ContextCompat; -import android.support.v7.widget.Toolbar; import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; @@ -74,6 +72,7 @@ import fr.gouv.etalab.mastodon.webview.MastalabWebViewClient; import static fr.gouv.etalab.mastodon.helper.Helper.EXTERNAL_STORAGE_REQUEST_CODE; import static fr.gouv.etalab.mastodon.helper.Helper.THEME_BLACK; +import static fr.gouv.etalab.mastodon.helper.Helper.THEME_LIGHT; import static fr.gouv.etalab.mastodon.helper.Helper.changeDrawableColor; @@ -90,13 +89,14 @@ public class MediaActivity extends BaseActivity implements OnDownloadInterface { private PhotoView imageView; private SimpleExoPlayerView videoView; private float downX; + private float downY; private int mediaPosition; MediaActivity.actionSwipe currentAction; static final int MIN_DISTANCE = 100; private String finalUrlDownload; private String preview_url; private ImageView prev, next; - private boolean isHiding; + private boolean isControlElementShown = true; private Bitmap downloadedImage; private File fileVideo; private TextView progress; @@ -106,6 +106,8 @@ public class MediaActivity extends BaseActivity implements OnDownloadInterface { private TextView media_description; private Attachment attachment; SwipeBackLayout mSwipeBackLayout; + private float imageScale = 0; + private RelativeLayout action_bar_container; private enum actionSwipe{ RIGHT_TO_LEFT, LEFT_TO_RIGHT, @@ -125,8 +127,9 @@ public class MediaActivity extends BaseActivity implements OnDownloadInterface { setTheme(R.style.TransparentBlack); super.onCreate(savedInstanceState); setContentView(R.layout.activity_media); + action_bar_container = (RelativeLayout) findViewById(R.id.action_bar_container); mSwipeBackLayout = new SwipeBackLayout(MediaActivity.this); - mSwipeBackLayout.setDirectionMode(SwipeBackLayout.FROM_BOTTOM); + mSwipeBackLayout.setDirectionMode(SwipeBackLayout.FROM_TOP); mSwipeBackLayout.setMaskAlpha(125); mSwipeBackLayout.setSwipeBackFactor(0.5f); mSwipeBackLayout.setSwipeBackListener(new SwipeBackLayout.OnSwipeBackListener() { @@ -162,17 +165,16 @@ public class MediaActivity extends BaseActivity implements OnDownloadInterface { } media_description = findViewById(R.id.media_description); message_ready = findViewById(R.id.message_ready); - Toolbar toolbar = findViewById(R.id.toolbar); - setSupportActionBar(toolbar); media_save = findViewById(R.id.media_save); media_share = findViewById(R.id.media_share); media_close = findViewById(R.id.media_close); progress = findViewById(R.id.loader_progress); webview_video = findViewById(R.id.webview_video); + media_save.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { - isSHaring = false; + isSHaring = true; if(attachment.getType().toLowerCase().equals("video") || attachment.getType().toLowerCase().equals("gifv") || attachment.getType().toLowerCase().equals("web")) { if( attachment != null ) { progress.setText("0 %"); @@ -221,28 +223,6 @@ public class MediaActivity extends BaseActivity implements OnDownloadInterface { finish(); } }); - Handler h = new Handler(); - scheduleHidden = scheduleHiddenDescription = true; - h.postDelayed(new Runnable() { - - @Override - public void run() { - // DO DELAYED STUFF - media_close.setVisibility(View.GONE); - media_save.setVisibility(View.GONE); - media_share.setVisibility(View.GONE); - scheduleHidden = false; - } - }, 2000); - h.postDelayed(new Runnable() { - - @Override - public void run() { - // DO DELAYED STUFF - media_description.setVisibility(View.GONE); - scheduleHiddenDescription = false; - } - }, 6000); canSwipe = true; loader = findViewById(R.id.loader); imageView = findViewById(R.id.media_picture); @@ -252,9 +232,12 @@ public class MediaActivity extends BaseActivity implements OnDownloadInterface { if( theme == THEME_BLACK){ changeDrawableColor(getApplicationContext(), prev, R.color.dark_icon); changeDrawableColor(getApplicationContext(), next, R.color.dark_icon); - }else { + }else if(theme == THEME_LIGHT) { changeDrawableColor(getApplicationContext(), prev, R.color.mastodonC4); changeDrawableColor(getApplicationContext(), next, R.color.mastodonC4); + }else{ + changeDrawableColor(getApplicationContext(), prev, R.color.white); + changeDrawableColor(getApplicationContext(), next, R.color.white); } prev.setOnClickListener(new View.OnClickListener() { @Override @@ -275,18 +258,28 @@ public class MediaActivity extend |