LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_STATIC_ANDROID_LIBRARIES := \
+ androidx-constraintlayout_constraintlayout \
androidx.slice_slice-builders \
androidx.slice_slice-core \
androidx.slice_slice-view \
ims-common
LOCAL_STATIC_JAVA_LIBRARIES := \
+ androidx-constraintlayout_constraintlayout-solver \
androidx.lifecycle_lifecycle-runtime \
androidx.lifecycle_lifecycle-extensions \
guava \
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/root"
android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical">
-
- <include layout="@layout/wifi_dpp_fragment_header"/>
-
- <com.android.settings.wifi.qrcode.QrPreviewLayout
- android:layout_width="@dimen/qrcode_preview_size"
- android:layout_height="@dimen/qrcode_preview_size"
- android:layout_gravity="center">
- <TextureView
- android:id="@+id/preview_view"
- android:layout_width="wrap_content"
- android:layout_height="match_parent"/>
- <com.android.settings.wifi.qrcode.QrDecorateView
- android:id="@+id/decorate_view"
- android:layout_width="wrap_content"
- android:layout_height="match_parent"/>
- </com.android.settings.wifi.qrcode.QrPreviewLayout>
-
- <TextView android:id="@+id/error_message"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center"/>
+ android:layout_height="match_parent">
+
+ <ScrollView
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical"
+ android:gravity="center_horizontal">
+
+ <include layout="@layout/wifi_dpp_fragment_header"/>
+
+ <com.android.settings.wifi.qrcode.QrPreviewLayout
+ android:layout_width="@dimen/qrcode_preview_size"
+ android:layout_height="@dimen/qrcode_preview_size">
+ <TextureView
+ android:id="@+id/preview_view"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"/>
+ <com.android.settings.wifi.qrcode.QrDecorateView
+ android:id="@+id/decorate_view"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"/>
+ </com.android.settings.wifi.qrcode.QrPreviewLayout>
+
+ <TextView android:id="@+id/error_message"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"/>
+
+ </LinearLayout>
+
+ </ScrollView>
</LinearLayout>
limitations under the License.
-->
-<ScrollView
+<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/root"
android:layout_width="match_parent"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
-</ScrollView>
+</LinearLayout>
limitations under the License.
-->
-<LinearLayout
+<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/root"
android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical">
+ android:layout_height="match_parent">
- <include layout="@layout/wifi_dpp_fragment_header"/>
-
- <ImageView
- android:id="@+id/wifi_ap_picture_view"
+ <ScrollView
android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_gravity="center"/>
+ android:layout_height="match_parent">
- <TextView
- android:id="@+id/choose_different_network"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center"
- android:layout_marginTop="8dp"
- android:text="@string/wifi_dpp_choose_different_network"/>
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:gravity="center_horizontal"
+ android:orientation="vertical">
+
+ <include layout="@layout/wifi_dpp_fragment_header"/>
+
+ <ImageView
+ android:id="@+id/wifi_ap_picture_view"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ app:layout_constraintTop_toBottomOf="@+id/header"/>
+
+ <Button
+ android:id="@+id/choose_different_network"
+ style="@style/SuwGlifButton.Secondary"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ app:layout_constraintTop_toBottomOf="@+id/wifi_ap_picture_view"
+ android:layout_marginTop="8dp"
+ android:text="@string/wifi_dpp_choose_different_network"/>
- <include layout="@layout/wifi_dpp_fragment_footer"
- android:gravity="center|bottom"/>
+ </LinearLayout>
+
+ </ScrollView>
+
+ <include
+ layout="@layout/wifi_dpp_fragment_footer"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ app:layout_constraintBottom_toBottomOf="parent"/>
-</LinearLayout>
+</androidx.constraintlayout.widget.ConstraintLayout>
limitations under the License.
-->
-<LinearLayout
+<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/root"
android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical">
+ android:layout_height="match_parent">
- <include layout="@layout/wifi_dpp_fragment_header"/>
-
- <ListView android:id="@+id/saved_wifi_network_list"
+ <ScrollView
android:layout_width="match_parent"
- android:layout_height="wrap_content"/>
+ android:layout_height="match_parent">
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:gravity="center_horizontal"
+ android:orientation="vertical">
+
+ <include layout="@layout/wifi_dpp_fragment_header"/>
+
+ <ListView android:id="@+id/saved_wifi_network_list"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ app:layout_constraintTop_toBottomOf="@+id/header"/>
- <include layout="@layout/wifi_dpp_fragment_footer"
- android:gravity="center|bottom"/>
+ </LinearLayout>
+
+ </ScrollView>
+
+ <include
+ layout="@layout/wifi_dpp_fragment_footer"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ app:layout_constraintBottom_toBottomOf="parent"/>
-</LinearLayout>
+</androidx.constraintlayout.widget.ConstraintLayout>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="horizontal">
+ android:layout_height="wrap_content"
+ style="@style/SuwGlifButtonBar">
<Button
android:id="@+id/button_left"
+ style="@style/SuwGlifButton.Secondary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_gravity="bottom|start"
- android:text="left"
- style="?android:attr/borderlessButtonStyle"/>
+ android:layout_gravity="start"/>
<Space
android:layout_width="0dp"
<Button
android:id="@+id/button_right"
+ style="@style/SuwGlifButton.Primary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_gravity="bottom|end"
- android:text="right"/>
+ android:layout_gravity="end"/>
</LinearLayout>
android:layout_height="match_parent"
android:orientation="vertical">
- <include layout="@layout/wifi_dpp_fragment_header"/>
-
- <ImageView
- android:id="@+id/qrcode_view"
- android:layout_width="@dimen/qrcode_size"
- android:layout_height="@dimen/qrcode_size"
- android:src="@android:color/transparent"
- android:layout_gravity="center"/>
+ <ScrollView
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:gravity="center_horizontal"
+ android:orientation="vertical">
+
+ <include layout="@layout/wifi_dpp_fragment_header"/>
+
+ <ImageView
+ android:id="@+id/qrcode_view"
+ android:layout_width="@dimen/qrcode_size"
+ android:layout_height="@dimen/qrcode_size"
+ android:src="@android:color/transparent"/>
+
+ </LinearLayout>
+
+ </ScrollView>
</LinearLayout>
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/root"
android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical">
+ android:layout_height="match_parent">
- <include layout="@layout/wifi_dpp_fragment_header"/>
-
- <com.android.settings.wifi.qrcode.QrPreviewLayout
+ <ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
- <TextureView
- android:id="@+id/preview_view"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="center"/>
- <com.android.settings.wifi.qrcode.QrDecorateView
- android:id="@+id/decorate_view"
+
+ <LinearLayout
android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="center"/>
- </com.android.settings.wifi.qrcode.QrPreviewLayout>
-
- <TextView
- android:id="@+id/error_message"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center"
- android:layout_marginTop="8dp"
- android:text="@string/wifi_dpp_could_not_detect_valid_qr_code"
- android:visibility="invisible"
- android:textColor="?android:attr/colorError"/>
+ android:layout_height="match_parent"
+ android:orientation="vertical"
+ android:gravity="center_horizontal">
+
+ <include layout="@layout/wifi_dpp_fragment_header"/>
+
+ <com.android.settings.wifi.qrcode.QrPreviewLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+ <TextureView
+ android:id="@+id/preview_view"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"/>
+ <com.android.settings.wifi.qrcode.QrDecorateView
+ android:id="@+id/decorate_view"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"/>
+ </com.android.settings.wifi.qrcode.QrPreviewLayout>
+
+ <TextView
+ android:id="@+id/error_message"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="8dp"
+ android:text="@string/wifi_dpp_could_not_detect_valid_qr_code"
+ android:visibility="invisible"
+ android:textColor="?android:attr/colorError"/>
+
+ </LinearLayout>
+
+ </ScrollView>
</LinearLayout>
import android.widget.Button;
import android.widget.ImageView;
import android.widget.ProgressBar;
-import android.widget.TextView;
import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
private static final String TAG = "WifiDppAddDeviceFragment";
private ImageView mWifiApPictureView;
- private TextView mChooseDifferentNetwork;
+ private Button mChooseDifferentNetwork;
private Button mButtonLeft;
private Button mButtonRight;
wifiNetworkConfig.getSsid()));
mWifiApPictureView = view.findViewById(R.id.wifi_ap_picture_view);
+
mChooseDifferentNetwork = view.findViewById(R.id.choose_different_network);
+ mChooseDifferentNetwork.setOnClickListener(v -> getFragmentManager().popBackStack());
+
mButtonLeft = view.findViewById(R.id.button_left);
mButtonLeft.setText(R.string.cancel);
- mButtonLeft.setOnClickListener(v -> getFragmentManager().popBackStack());
+ mButtonLeft.setOnClickListener(v -> {
+ getActivity().setResult(Activity.RESULT_CANCELED);
+ getActivity().finish();
+ });
mButtonRight = view.findViewById(R.id.button_right);
mButtonRight.setText(R.string.wifi_dpp_share_wifi);
// Key for Bundle usage
private static final String KEY_PUBLIC_URI = "key_public_uri";
+ private static final String KEY_IS_CONFIGURATOR_MODE = "key_is_configurator_mode";
private QrCamera mCamera;
private TextureView mTextureView;
private TextView mErrorMessage;
/** true if the fragment working for configurator, false enrollee*/
- private final boolean mIsConfiguratorMode;
+ private boolean mIsConfiguratorMode;
/** The SSID of the Wi-Fi network which the user specify to enroll */
private String mSsid;
private WifiQrCode mWifiQrCode;
@Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ if (savedInstanceState != null) {
+ mIsConfiguratorMode = savedInstanceState.getBoolean(KEY_IS_CONFIGURATOR_MODE);
+ }
+ }
+
+ @Override
public int getMetricsCategory() {
if (mIsConfiguratorMode) {
return MetricsProto.MetricsEvent.SETTINGS_WIFI_DPP_CONFIGURATOR;
}
}
};
+
+ @Override
+ public void onSaveInstanceState(Bundle outState) {
+ outState.putBoolean(KEY_IS_CONFIGURATOR_MODE, mIsConfiguratorMode);
+
+ super.onSaveInstanceState(outState);
+ }
}
$(SETTINGS_AOSP_PATH)/res
LOCAL_STATIC_ANDROID_LIBRARIES := \
+ androidx-constraintlayout_constraintlayout \
androidx.slice_slice-builders \
androidx.slice_slice-core \
androidx.slice_slice-view \
ims-common
LOCAL_STATIC_JAVA_LIBRARIES := \
+ androidx-constraintlayout_constraintlayout-solver \
androidx.lifecycle_lifecycle-runtime \
androidx.lifecycle_lifecycle-extensions \
guava \