Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1db4bc42 authored by Joey's avatar Joey
Browse files

Add close button to ApplyActivity



Signed-off-by: default avatarJoey <joey@lineageos.org>
parent d0cc88cb
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -54,6 +54,7 @@ public final class ApplyActivity extends AppCompatActivity {
    private TextView mBothView;
    private TextView mHomeView;
    private TextView mLockView;
    private ImageView mCloseView;

    @Override
    protected void onCreate(@Nullable Bundle savedInstance) {
@@ -66,10 +67,12 @@ public final class ApplyActivity extends AppCompatActivity {
        mBothView = findViewById(R.id.apply_both);
        mHomeView = findViewById(R.id.apply_home);
        mLockView = findViewById(R.id.apply_lock);
        mCloseView = findViewById(R.id.apply_close);

        mBothView.setOnClickListener(v -> applyWallpaper(BOTH_FLAG));
        mHomeView.setOnClickListener(v -> applyWallpaper(HOME_FLAG));
        mLockView.setOnClickListener(v -> applyWallpaper(LOCK_FLAG));
        mCloseView.setOnClickListener(v -> finish());

        setup();
    }
@@ -147,6 +150,7 @@ public final class ApplyActivity extends AppCompatActivity {

    private void applyWallpaper(final int flags) {
        hideApplyButton();
        mCloseView.setClickable(false);

        final Drawable drawable = mPreviewView.getDrawable();

+20 −0
Original line number Diff line number Diff line
<!--
  Copyright (C) 2019 The LineageOS Project

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
  -->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="oval">

    <solid android:color="@color/apply_closeBg" />
</shape>
+24 −0
Original line number Diff line number Diff line
<!--
  Copyright (C) 2019 The LineageOS Project

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
  -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="24dp"
    android:height="24dp"
    android:viewportWidth="24.0"
    android:viewportHeight="24.0">
    <path
        android:fillColor="@android:color/white"
        android:pathData="M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z" />
</vector>
+12 −1
Original line number Diff line number Diff line
@@ -27,7 +27,18 @@
        android:fitsSystemWindows="true"
        android:scaleType="centerCrop"
        android:transitionName="transition_shared_preview"
        tools:src="@drawable/nature_night" />
        tools:src="@drawable/space_riseup" />

    <ImageView
        android:id="@+id/apply_close"
        android:layout_width="32dp"
        android:layout_height="32dp"
        android:layout_gravity="top|start"
        android:layout_margin="16dp"
        android:background="@drawable/bg_apply_close"
        android:contentDescription="@string/apply_close"
        android:padding="4dp"
        android:src="@drawable/ic_close" />

    <LinearLayout
        android:id="@+id/apply_button"
+1 −0
Original line number Diff line number Diff line
@@ -26,4 +26,5 @@
    <color name="navigationBar_divider">#1f000000</color>

    <color name="item_nameBg">#1f000000</color>
    <color name="apply_closeBg">#4f000000</color>
</resources>
Loading