Theming for giphy activity.

This commit is contained in:
Anton Chekulaev 2020-08-26 19:02:40 +10:00
parent 2cd9b3b3c0
commit 81d58dabe6
5 changed files with 41 additions and 19 deletions

View File

@ -348,7 +348,7 @@
<activity <activity
android:name="org.thoughtcrime.securesms.giph.ui.GiphyActivity" android:name="org.thoughtcrime.securesms.giph.ui.GiphyActivity"
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize" android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"
android:theme="@style/TextSecure.LightNoActionBar" android:theme="@style/Theme.TextSecure.DayNight.NoActionBar"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:windowSoftInputMode="stateHidden" /> android:windowSoftInputMode="stateHidden" />
<activity <activity

View File

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M3,13h8L11,3L3,3v10zM3,21h8v-6L3,15v6zM13,21h8L21,11h-8v10zM13,3v6h8L21,3h-8z"/>
</vector>

View File

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M4,18h17v-6H4v6zM4,5v6h17V5H4z"/>
</vector>

View File

@ -1,9 +1,13 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android"> <merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:context="org.thoughtcrime.securesms.giph.ui.GiphyActivity">
<LinearLayout android:layout_width="match_parent" <LinearLayout android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="horizontal"> android:orientation="horizontal"
tools:layout_height="80dp"
tools:theme="@style/Theme.TextSecure.DayNight.NoActionBar">
<ImageView android:id="@+id/action_icon" <ImageView android:id="@+id/action_icon"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -12,7 +16,7 @@
android:gravity="center_vertical" android:gravity="center_vertical"
android:clickable="true" android:clickable="true"
android:background="@drawable/circle_touch_highlight_background" android:background="@drawable/circle_touch_highlight_background"
android:src="@drawable/ic_search_white_24dp" /> android:src="@drawable/ic_baseline_search_24" />
<LinearLayout android:id="@+id/toggle_container" <LinearLayout android:id="@+id/toggle_container"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -25,8 +29,8 @@
android:layout_weight="1" android:layout_weight="1"
android:layout_marginStart="6dp" android:layout_marginStart="6dp"
android:hint="@string/giphy_activity_toolbar__search_gifs_and_stickers" android:hint="@string/giphy_activity_toolbar__search_gifs_and_stickers"
android:textColor="@color/text" android:textColor="?android:textColorPrimary"
android:textColorHint="@color/text" android:textColorHint="?android:textColorTertiary"
android:textCursorDrawable="@drawable/session_edit_text_cursor" android:textCursorDrawable="@drawable/session_edit_text_cursor"
android:maxLines="1" android:maxLines="1"
android:singleLine="true" android:singleLine="true"
@ -45,7 +49,7 @@
android:focusable="true" android:focusable="true"
android:visibility="invisible" android:visibility="invisible"
android:background="@drawable/circle_touch_highlight_background" android:background="@drawable/circle_touch_highlight_background"
android:src="@drawable/ic_clear_white_24dp" /> android:src="@drawable/ic_baseline_clear_24" />
<org.thoughtcrime.securesms.components.AnimatingToggle <org.thoughtcrime.securesms.components.AnimatingToggle
android:id="@+id/button_toggle" android:id="@+id/button_toggle"
@ -65,7 +69,7 @@
android:visibility="visible" android:visibility="visible"
android:focusable="true" android:focusable="true"
android:background="@drawable/circle_touch_highlight_background" android:background="@drawable/circle_touch_highlight_background"
android:src="@drawable/ic_dashboard_white_24dp" /> android:src="@drawable/ic_baseline_dashboard_24" />
<ImageView android:id="@+id/view_stream" <ImageView android:id="@+id/view_stream"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -76,7 +80,7 @@
android:clickable="true" android:clickable="true"
android:focusable="true" android:focusable="true"
android:background="@drawable/circle_touch_highlight_background" android:background="@drawable/circle_touch_highlight_background"
android:src="@drawable/ic_view_stream_white_24dp" /> android:src="@drawable/ic_baseline_view_stream_24" />
</org.thoughtcrime.securesms.components.AnimatingToggle> </org.thoughtcrime.securesms.components.AnimatingToggle>

View File

@ -1,35 +1,35 @@
package org.thoughtcrime.securesms.giph.ui; package org.thoughtcrime.securesms.giph.ui;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.net.Uri; import android.net.Uri;
import android.os.AsyncTask; import android.os.AsyncTask;
import android.os.Bundle; import android.os.Bundle;
import android.view.View;
import android.widget.Toast;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import com.google.android.material.tabs.TabLayout;
import androidx.fragment.app.Fragment; import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager; import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter; import androidx.fragment.app.FragmentPagerAdapter;
import androidx.viewpager.widget.ViewPager; import androidx.viewpager.widget.ViewPager;
import org.thoughtcrime.securesms.logging.Log;
import android.view.View; import com.google.android.material.tabs.TabLayout;
import android.widget.Toast;
import org.thoughtcrime.securesms.PassphraseRequiredActionBarActivity; import org.thoughtcrime.securesms.PassphraseRequiredActionBarActivity;
import network.loki.messenger.R; import org.thoughtcrime.securesms.logging.Log;
import org.thoughtcrime.securesms.providers.BlobProvider; import org.thoughtcrime.securesms.providers.BlobProvider;
import org.thoughtcrime.securesms.util.DynamicLanguage; import org.thoughtcrime.securesms.util.DynamicLanguage;
import org.thoughtcrime.securesms.util.DynamicNoActionBarTheme;
import org.thoughtcrime.securesms.util.DynamicTheme;
import org.thoughtcrime.securesms.util.MediaUtil; import org.thoughtcrime.securesms.util.MediaUtil;
import org.thoughtcrime.securesms.util.ViewUtil; import org.thoughtcrime.securesms.util.ViewUtil;
import java.io.IOException; import java.io.IOException;
import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutionException;
import network.loki.messenger.R;
public class GiphyActivity extends PassphraseRequiredActionBarActivity public class GiphyActivity extends PassphraseRequiredActionBarActivity
implements GiphyActivityToolbar.OnLayoutChangedListener, implements GiphyActivityToolbar.OnLayoutChangedListener,
GiphyActivityToolbar.OnFilterChangedListener, GiphyActivityToolbar.OnFilterChangedListener,
@ -42,7 +42,6 @@ public class GiphyActivity extends PassphraseRequiredActionBarActivity
public static final String EXTRA_WIDTH = "extra_width"; public static final String EXTRA_WIDTH = "extra_width";
public static final String EXTRA_HEIGHT = "extra_height"; public static final String EXTRA_HEIGHT = "extra_height";
private final DynamicTheme dynamicTheme = new DynamicNoActionBarTheme();
private final DynamicLanguage dynamicLanguage = new DynamicLanguage(); private final DynamicLanguage dynamicLanguage = new DynamicLanguage();
private GiphyGifFragment gifFragment; private GiphyGifFragment gifFragment;
@ -53,7 +52,6 @@ public class GiphyActivity extends PassphraseRequiredActionBarActivity
@Override @Override
public void onPreCreate() { public void onPreCreate() {
dynamicTheme.onCreate(this);
dynamicLanguage.onCreate(this); dynamicLanguage.onCreate(this);
} }