Browse Source

share activity has transparent background so it's invisible

azivner 6 years ago
parent
commit
465b02d247

+ 6 - 1
app/src/main/AndroidManifest.xml

@@ -14,17 +14,22 @@
         <activity
             android:name=".LoginActivity"
             android:label="Trilium connection setup"></activity>
+
         <activity
             android:name=".MainActivity"
             android:label="@string/app_name"
             android:theme="@style/AppTheme.NoActionBar">
+
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
 
                 <category android:name="android.intent.category.LAUNCHER" />
             </intent-filter>
         </activity>
-        <activity android:name=".ShareActivity">
+        <activity
+            android:name=".ShareActivity"
+            android:theme="@style/Theme.AppCompat.Translucent">
+
             <intent-filter>
                 <action android:name="android.intent.action.SEND" />
                 <category android:name="android.intent.category.DEFAULT" />

BIN
app/src/main/ic_launcher-web.png


+ 2 - 0
app/src/main/java/io/github/zadam/triliumsender/ShareActivity.kt

@@ -84,6 +84,8 @@ class ShareActivity : AppCompatActivity() {
             else {
                 Toast.makeText(this@ShareActivity, "Sending to Trilium failed", Toast.LENGTH_LONG).show()
             }
+
+            finish()
         }
 
         override fun onCancelled() {

+ 2 - 1
app/src/main/res/layout/activity_share.xml

@@ -4,6 +4,7 @@
     xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
-    tools:context=".ShareActivity">
+    tools:context=".ShareActivity"
+    android:background="@android:color/transparent">
 
 </android.support.constraint.ConstraintLayout>

BIN
app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png


BIN
app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png


BIN
app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png


BIN
app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png


BIN
app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png


+ 9 - 0
app/src/main/res/values/styles.xml

@@ -17,4 +17,13 @@
 
     <style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
 
+    <style name="Theme.AppCompat.Translucent" parent="Theme.AppCompat.NoActionBar">
+        <item name="android:background">#33000000</item> <!-- Or any transparency or color you need -->
+        <item name="android:windowNoTitle">true</item>
+        <item name="android:windowBackground">@android:color/transparent</item>
+        <item name="android:colorBackgroundCacheHint">@null</item>
+        <item name="android:windowIsTranslucent">true</item>
+        <item name="android:windowAnimationStyle">@android:style/Animation</item>
+    </style>
+
 </resources>