diff options
-rw-r--r-- | src/main/AndroidManifest.xml | 2 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/ShowFullscreenMessageActivity.java | 42 | ||||
-rw-r--r-- | src/main/res/layout/activity_fullscreen_message.xml | 49 | ||||
-rw-r--r-- | src/main/res/values/themes.xml | 4 |
4 files changed, 54 insertions, 43 deletions
diff --git a/src/main/AndroidManifest.xml b/src/main/AndroidManifest.xml index 92ab4706c..b194e4b7c 100644 --- a/src/main/AndroidManifest.xml +++ b/src/main/AndroidManifest.xml @@ -230,7 +230,7 @@ </activity> <activity android:name=".ui.ShowFullscreenMessageActivity" - android:theme="@style/ConversationsTheme.NoActionBar.FullScreen" + android:theme="@style/ConversationsTheme.FullScreen" android:configChanges="orientation|screenSize"> </activity> <activity diff --git a/src/main/java/de/pixart/messenger/ui/ShowFullscreenMessageActivity.java b/src/main/java/de/pixart/messenger/ui/ShowFullscreenMessageActivity.java index 83928d0cd..d4528f962 100644 --- a/src/main/java/de/pixart/messenger/ui/ShowFullscreenMessageActivity.java +++ b/src/main/java/de/pixart/messenger/ui/ShowFullscreenMessageActivity.java @@ -10,12 +10,12 @@ import android.media.MediaMetadataRetriever; import android.net.Uri; import android.os.Bundle; import android.preference.PreferenceManager; -import android.support.v7.app.AppCompatActivity; +import android.support.design.widget.FloatingActionButton; +import android.support.v7.app.ActionBar; import android.util.Log; import android.view.View; import android.view.WindowManager; import android.webkit.MimeTypeMap; -import android.widget.ImageButton; import android.widget.ImageView; import android.widget.Toast; @@ -39,7 +39,7 @@ import de.pixart.messenger.utils.ExifHelper; import static de.pixart.messenger.persistance.FileBackend.close; -public class ShowFullscreenMessageActivity extends AppCompatActivity { +public class ShowFullscreenMessageActivity extends XmppActivity { Integer oldOrientation; PhotoView mImage; @@ -47,7 +47,7 @@ public class ShowFullscreenMessageActivity extends AppCompatActivity { ImageView mFullscreenbutton; Uri mFileUri; File mFile; - ImageButton mFAB; + FloatingActionButton fab; int height = 0; int width = 0; int rotation = 0; @@ -55,6 +55,14 @@ public class ShowFullscreenMessageActivity extends AppCompatActivity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + this.mTheme = findTheme(); + setTheme(this.mTheme); + + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null && actionBar.isShowing()) { + actionBar.hide(); + } + oldOrientation = getRequestedOrientation(); WindowManager.LayoutParams layout = getWindow().getAttributes(); @@ -63,17 +71,15 @@ public class ShowFullscreenMessageActivity extends AppCompatActivity { } getWindow().setAttributes(layout); getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); + getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); setContentView(R.layout.activity_fullscreen_message); mImage = findViewById(R.id.message_image_view); mVideo = findViewById(R.id.message_video_view); mFullscreenbutton = findViewById(R.id.vcv_img_fullscreen); - mFAB = findViewById(R.id.imageButton); - mFAB.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - mVideo.reset(); - shareWith(mFile); - } + fab = findViewById(R.id.fab); + fab.setOnClickListener(v -> { + mVideo.reset(); + shareWith(mFile); }); } @@ -105,6 +111,11 @@ public class ShowFullscreenMessageActivity extends AppCompatActivity { } @Override + protected void refreshUiReal() { + + } + + @Override protected void onStart() { super.onStart(); Intent intent = getIntent(); @@ -227,7 +238,7 @@ public class ShowFullscreenMessageActivity extends AppCompatActivity { } @Override - protected void onResume() { + public void onResume() { WindowManager.LayoutParams layout = getWindow().getAttributes(); if (useMaxBrightness()) { layout.screenBrightness = 1; @@ -239,7 +250,7 @@ public class ShowFullscreenMessageActivity extends AppCompatActivity { } @Override - protected void onPause() { + public void onPause() { mVideo.reset(); WindowManager.LayoutParams layout = getWindow().getAttributes(); if (useMaxBrightness()) { @@ -264,6 +275,11 @@ public class ShowFullscreenMessageActivity extends AppCompatActivity { super.onStop(); } + @Override + void onBackendConnected() { + + } + public boolean useMaxBrightness() { return getPreferences().getBoolean("use_max_brightness", getResources().getBoolean(R.bool.use_max_brightness)); } diff --git a/src/main/res/layout/activity_fullscreen_message.xml b/src/main/res/layout/activity_fullscreen_message.xml index bc6eeb850..c1a1bc619 100644 --- a/src/main/res/layout/activity_fullscreen_message.xml +++ b/src/main/res/layout/activity_fullscreen_message.xml @@ -2,37 +2,36 @@ <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" - android:orientation="vertical" - android:background="@android:color/black"> - - <com.github.chrisbanes.photoview.PhotoView - android:id="@id/message_image_view" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:adjustViewBounds="true" - android:visibility="gone" /> - - <com.github.rtoshiro.view.video.FullscreenVideoLayout - android:id="@id/message_video_view" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:visibility="gone" /> + android:background="@android:color/black" + android:orientation="vertical"> <FrameLayout + android:id="@+id/frameLayout" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_alignParentEnd="true" android:layout_alignParentRight="true" - android:layout_alignParentTop="true" - android:id="@+id/frameLayout"> + android:layout_alignParentTop="true"> + + <com.github.chrisbanes.photoview.PhotoView + android:id="@id/message_image_view" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:adjustViewBounds="true" + android:visibility="gone" /> + + <com.github.rtoshiro.view.video.FullscreenVideoLayout + android:id="@id/message_video_view" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:visibility="gone" /> - <ImageButton - android:layout_margin="15dp" - android:layout_width="40dp" - android:layout_height="40dp" - android:src="@drawable/ic_share_white_24dp" - android:background="@drawable/circle" - android:id="@+id/imageButton" - android:layout_gravity="right|top" /> + <android.support.design.widget.FloatingActionButton + android:id="@+id/fab" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="right|top" + android:layout_margin="16dp" + android:src="?attr/icon_share" /> </FrameLayout> </RelativeLayout>
\ No newline at end of file diff --git a/src/main/res/values/themes.xml b/src/main/res/values/themes.xml index 8a7113b16..eb2038a69 100644 --- a/src/main/res/values/themes.xml +++ b/src/main/res/values/themes.xml @@ -78,10 +78,6 @@ <item name="TextSizeHeadline">18sp</item> </style> - <style name="ConversationsTheme.NoActionBar.FullScreen" parent="Theme.AppCompat.Light.NoActionBar"> - <item name="android:windowFullscreen">true</item> - </style> - <style name="ConversationsTheme.FullScreen" parent="@style/Theme.AppCompat.Light"> <item name="android:windowNoTitle">true</item> <item name="android:windowActionBar">false</item> |