Commit 62974157 authored by Bartek Fabiszewski's avatar Bartek Fabiszewski
Browse files

Remove private resources

parent 291feba5
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@ import android.view.View;
import android.widget.TextView;

import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.widget.DialogTitle;
import androidx.preference.DialogPreference;
import androidx.preference.ListPreferenceDialogFragmentCompat;

@@ -40,7 +39,7 @@ public class ListPreferenceDialogWithMessageFragment extends ListPreferenceDialo
        final DialogPreference preference = getPreference();
        @SuppressLint("InflateParams")
        View customTitleView = LayoutInflater.from(getActivity()).inflate(R.layout.alert_dialog_title, null);
        final DialogTitle dialogTitle = customTitleView.findViewById(R.id.customTitle);
        final TextView dialogTitle = customTitleView.findViewById(R.id.customTitle);
        dialogTitle.setText(preference.getDialogTitle());
        final TextView messageView = customTitleView.findViewById(R.id.customMessage);
        messageView.setText(preference.getDialogMessage());
+0 −3
Original line number Diff line number Diff line
@@ -9,7 +9,6 @@

package net.fabiszewski.ulogger;

import android.annotation.SuppressLint;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.res.TypedArray;
@@ -120,10 +119,8 @@ public class ProviderPreferenceDialogFragment extends ListPreferenceDialogWithMe

    /**
     * Get default layout for single choice dialog
     * FIXME: how to do it without private resources?
     * @return Layout resource id
     */
    @SuppressLint("PrivateResource")
    private int getSingleChoiceLayoutResource() {
        int resId = android.R.layout.select_dialog_singlechoice;
        final Context context = getContext();
+6 −5
Original line number Diff line number Diff line
@@ -15,8 +15,7 @@
    android:orientation="vertical"
    android:paddingLeft="?attr/dialogPreferredPadding"
    android:paddingRight="?attr/dialogPreferredPadding"
    android:paddingTop="@dimen/abc_dialog_padding_top_material"
    tools:ignore="PrivateResource">
    android:paddingTop="@dimen/abc_dialog_padding_top_material">

    <LinearLayout
        android:layout_width="match_parent"
@@ -33,7 +32,7 @@
            android:src="@null"
            tools:ignore="ContentDescription" />

        <androidx.appcompat.widget.DialogTitle
        <TextView
            android:id="@+id/customTitle"
            style="?android:attr/windowTitleStyle"
            android:layout_width="match_parent"
@@ -41,7 +40,8 @@
            android:ellipsize="end"
            android:singleLine="true"
            android:textAlignment="viewStart"
            android:gravity="start" />
            android:gravity="start"
            tools:text="Preference title" />
    </LinearLayout>
    <TextView
        android:id="@+id/customMessage"
@@ -50,7 +50,8 @@
        android:layout_marginTop="10dp"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:textColor="?android:attr/textColorSecondary" />
        android:textColor="?android:attr/textColorSecondary"
        tools:text="Message describing preference. Maybe be several lines long."/>

</LinearLayout>
+3 −0
Original line number Diff line number Diff line
@@ -13,5 +13,8 @@
    <style name="AppTheme" parent="Theme.AppCompat.NoActionBar">
        <!-- Customize your theme here. -->
    </style>
    <declare-styleable name="AlertDialog">
        <attr format="reference" name="singleChoiceItemLayout"/>
    </declare-styleable>

</resources>