Add divider line in Preference for scan QR code button and share hotspot button
Bug: 128940862 Test: manual test Change-Id: If576f0840cc8924b63348f04fe12c3a0d4edcb89
This commit is contained in:
@@ -54,6 +54,10 @@
|
|||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<include
|
||||||
|
layout="@layout/preference_two_target_divider"
|
||||||
|
android:visibility="gone"/>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@android:id/widget_frame"
|
android:id="@android:id/widget_frame"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
@@ -20,7 +20,6 @@ import android.content.Context;
|
|||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.View;
|
|
||||||
import android.widget.ImageButton;
|
import android.widget.ImageButton;
|
||||||
|
|
||||||
import androidx.annotation.DrawableRes;
|
import androidx.annotation.DrawableRes;
|
||||||
@@ -63,10 +62,6 @@ public class AddWifiNetworkPreference extends Preference {
|
|||||||
getContext().startActivity(
|
getContext().startActivity(
|
||||||
WifiDppUtils.getEnrolleeQrCodeScannerIntent(/* ssid */ null));
|
WifiDppUtils.getEnrolleeQrCodeScannerIntent(/* ssid */ null));
|
||||||
});
|
});
|
||||||
|
|
||||||
final View divider = (View) holder.findViewById(
|
|
||||||
com.android.settingslib.R.id.two_target_divider);
|
|
||||||
divider.setVisibility(View.INVISIBLE);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -39,6 +39,7 @@ public class WifiTetherSsidPreference extends ValidatedEditTextPreference {
|
|||||||
|
|
||||||
private ImageButton mImageButton;
|
private ImageButton mImageButton;
|
||||||
private Drawable mButtonIcon;
|
private Drawable mButtonIcon;
|
||||||
|
private View mDivider;
|
||||||
private View.OnClickListener mClickListener;
|
private View.OnClickListener mClickListener;
|
||||||
private boolean mVisible;
|
private boolean mVisible;
|
||||||
|
|
||||||
@@ -68,6 +69,8 @@ public class WifiTetherSsidPreference extends ValidatedEditTextPreference {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void initialize() {
|
private void initialize() {
|
||||||
|
// TODO(b/129019971): use methods of divider line in parent object
|
||||||
|
setLayoutResource(R.layout.preference);
|
||||||
setWidgetLayoutResource(R.layout.wifi_button_preference_widget);
|
setWidgetLayoutResource(R.layout.wifi_button_preference_widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -82,13 +85,17 @@ public class WifiTetherSsidPreference extends ValidatedEditTextPreference {
|
|||||||
getContext().getString(R.string.wifi_dpp_share_hotspot));
|
getContext().getString(R.string.wifi_dpp_share_hotspot));
|
||||||
setButtonIcon(R.drawable.ic_qrcode_24dp);
|
setButtonIcon(R.drawable.ic_qrcode_24dp);
|
||||||
mImageButton.setImageDrawable(mButtonIcon);
|
mImageButton.setImageDrawable(mButtonIcon);
|
||||||
|
|
||||||
|
mDivider = holder.findViewById(R.id.two_target_divider);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mVisible) {
|
if (mVisible) {
|
||||||
mImageButton.setOnClickListener(mClickListener);
|
mImageButton.setOnClickListener(mClickListener);
|
||||||
mImageButton.setVisibility(View.VISIBLE);
|
mImageButton.setVisibility(View.VISIBLE);
|
||||||
|
mDivider.setVisibility(View.VISIBLE);
|
||||||
} else {
|
} else {
|
||||||
mImageButton.setVisibility(View.GONE);
|
mImageButton.setVisibility(View.GONE);
|
||||||
|
mDivider.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user