Loading res/layout/nfc_writer.xml +3 −2 Original line number Diff line number Diff line Loading @@ -40,9 +40,10 @@ <ImageView android:id="@+id/nfc_writer_image" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_width="84dp" android:layout_height="84dp" android:layout_gravity="center" android:tint="@color/theme_accent" android:src="@drawable/nfc_writer" /> <TextView android:id="@+id/touch_tag" Loading res/layout/profile_bluetooth_empty_view.xml 0 → 100644 +35 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/empty" android:layout_width="wrap_content" android:layout_height="match_parent" android:gravity="center"> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center" android:layout_centerInParent="true"> <TextView style="?android:attr/textAppearanceMedium" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="30dip" android:layout_marginEnd="30dip" android:layout_marginBottom="30dip" android:layout_gravity="center" android:text="@string/no_bluetooth_triggers" /> <ImageView android:layout_width="84dp" android:layout_height="84dp" android:layout_gravity="center" android:src="@drawable/ic_settings_bluetooth2" /> </LinearLayout> </RelativeLayout> No newline at end of file res/layout/profile_wifi_empty_view.xml 0 → 100644 +34 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/empty" android:layout_width="wrap_content" android:layout_height="match_parent" android:gravity="center"> <LinearLayout android:orientation="vertical" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center" android:layout_centerInParent="true"> <TextView style="?android:attr/textAppearanceMedium" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="30dip" android:layout_marginEnd="30dip" android:layout_marginBottom="30dip" android:layout_gravity="center" android:text="@string/no_wifi_triggers" /> <ImageView android:layout_width="84dp" android:layout_height="84dp" android:layout_gravity="center" android:src="@drawable/ic_wifi_signal_4_teal" /> </LinearLayout> </RelativeLayout> No newline at end of file res/values/cm_strings.xml +2 −2 Original line number Diff line number Diff line Loading @@ -249,8 +249,8 @@ <string name="profile_setup_actions_title">Step 2: Setup actions</string> <string name="profile_setup_actions_title_config">Reconfigure actions</string> <string name="no_bluetooth_triggers">No Bluetooth triggers available</string> <string name="no_wifi_triggers">No Wi-Fi triggers available</string> <string name="no_bluetooth_triggers">No Bluetooth devices paired.\nTap to pair Bluetooth device before configuring triggers.</string> <string name="no_wifi_triggers">No Wi-Fi access points configured.\nTap to connect Wi-Fi before configuring triggers.</string> <string name="profile_setup_setup_triggers_description">Please select triggers which will activate this profile</string> <string name="profile_setup_actions_description">Now configure what happens when the profile is activated</string> Loading src/com/android/settings/profiles/triggers/BluetoothTriggerFragment.java +29 −1 Original line number Diff line number Diff line Loading @@ -24,8 +24,10 @@ import android.bluetooth.BluetoothClass; import android.bluetooth.BluetoothDevice; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.res.Resources; import android.os.Bundle; import android.provider.Settings; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; Loading @@ -34,6 +36,7 @@ import android.widget.ImageView; import android.widget.ListView; import android.widget.TextView; import com.android.settings.R; import com.android.settings.Utils; import com.android.settings.profiles.ProfilesSettings; import java.util.ArrayList; Loading @@ -48,6 +51,8 @@ public class BluetoothTriggerFragment extends ListFragment { Profile mProfile; ProfileManager mProfileManager; private View mEmptyView; private List<BluetoothTrigger> mTriggers = new ArrayList<BluetoothTrigger>(); private BluetoothTriggerAdapter mListAdapter; Loading Loading @@ -150,13 +155,36 @@ public class BluetoothTriggerFragment extends ListFragment { .show(); } @Override public void onStart() { super.onStart(); getListView().setEmptyView(mEmptyView); } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { mEmptyView = inflater.inflate(R.layout.profile_bluetooth_empty_view, container, false); mEmptyView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent bluetoothSettings = new Intent(); bluetoothSettings.setAction( Settings.ACTION_BLUETOOTH_SETTINGS); startActivity(bluetoothSettings); } }); ViewGroup view = (ViewGroup) super.onCreateView(inflater, container, savedInstanceState); view.addView(mEmptyView); return view; } @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); reloadTriggerListItems(); mListAdapter = new BluetoothTriggerAdapter(getActivity()); setListAdapter(mListAdapter); setEmptyText(getString(R.string.no_bluetooth_triggers)); } private void removeTrigger(List<Trigger> triggers, int value) { Loading Loading
res/layout/nfc_writer.xml +3 −2 Original line number Diff line number Diff line Loading @@ -40,9 +40,10 @@ <ImageView android:id="@+id/nfc_writer_image" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_width="84dp" android:layout_height="84dp" android:layout_gravity="center" android:tint="@color/theme_accent" android:src="@drawable/nfc_writer" /> <TextView android:id="@+id/touch_tag" Loading
res/layout/profile_bluetooth_empty_view.xml 0 → 100644 +35 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/empty" android:layout_width="wrap_content" android:layout_height="match_parent" android:gravity="center"> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center" android:layout_centerInParent="true"> <TextView style="?android:attr/textAppearanceMedium" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="30dip" android:layout_marginEnd="30dip" android:layout_marginBottom="30dip" android:layout_gravity="center" android:text="@string/no_bluetooth_triggers" /> <ImageView android:layout_width="84dp" android:layout_height="84dp" android:layout_gravity="center" android:src="@drawable/ic_settings_bluetooth2" /> </LinearLayout> </RelativeLayout> No newline at end of file
res/layout/profile_wifi_empty_view.xml 0 → 100644 +34 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/empty" android:layout_width="wrap_content" android:layout_height="match_parent" android:gravity="center"> <LinearLayout android:orientation="vertical" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center" android:layout_centerInParent="true"> <TextView style="?android:attr/textAppearanceMedium" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="30dip" android:layout_marginEnd="30dip" android:layout_marginBottom="30dip" android:layout_gravity="center" android:text="@string/no_wifi_triggers" /> <ImageView android:layout_width="84dp" android:layout_height="84dp" android:layout_gravity="center" android:src="@drawable/ic_wifi_signal_4_teal" /> </LinearLayout> </RelativeLayout> No newline at end of file
res/values/cm_strings.xml +2 −2 Original line number Diff line number Diff line Loading @@ -249,8 +249,8 @@ <string name="profile_setup_actions_title">Step 2: Setup actions</string> <string name="profile_setup_actions_title_config">Reconfigure actions</string> <string name="no_bluetooth_triggers">No Bluetooth triggers available</string> <string name="no_wifi_triggers">No Wi-Fi triggers available</string> <string name="no_bluetooth_triggers">No Bluetooth devices paired.\nTap to pair Bluetooth device before configuring triggers.</string> <string name="no_wifi_triggers">No Wi-Fi access points configured.\nTap to connect Wi-Fi before configuring triggers.</string> <string name="profile_setup_setup_triggers_description">Please select triggers which will activate this profile</string> <string name="profile_setup_actions_description">Now configure what happens when the profile is activated</string> Loading
src/com/android/settings/profiles/triggers/BluetoothTriggerFragment.java +29 −1 Original line number Diff line number Diff line Loading @@ -24,8 +24,10 @@ import android.bluetooth.BluetoothClass; import android.bluetooth.BluetoothDevice; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.res.Resources; import android.os.Bundle; import android.provider.Settings; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; Loading @@ -34,6 +36,7 @@ import android.widget.ImageView; import android.widget.ListView; import android.widget.TextView; import com.android.settings.R; import com.android.settings.Utils; import com.android.settings.profiles.ProfilesSettings; import java.util.ArrayList; Loading @@ -48,6 +51,8 @@ public class BluetoothTriggerFragment extends ListFragment { Profile mProfile; ProfileManager mProfileManager; private View mEmptyView; private List<BluetoothTrigger> mTriggers = new ArrayList<BluetoothTrigger>(); private BluetoothTriggerAdapter mListAdapter; Loading Loading @@ -150,13 +155,36 @@ public class BluetoothTriggerFragment extends ListFragment { .show(); } @Override public void onStart() { super.onStart(); getListView().setEmptyView(mEmptyView); } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { mEmptyView = inflater.inflate(R.layout.profile_bluetooth_empty_view, container, false); mEmptyView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent bluetoothSettings = new Intent(); bluetoothSettings.setAction( Settings.ACTION_BLUETOOTH_SETTINGS); startActivity(bluetoothSettings); } }); ViewGroup view = (ViewGroup) super.onCreateView(inflater, container, savedInstanceState); view.addView(mEmptyView); return view; } @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); reloadTriggerListItems(); mListAdapter = new BluetoothTriggerAdapter(getActivity()); setListAdapter(mListAdapter); setEmptyText(getString(R.string.no_bluetooth_triggers)); } private void removeTrigger(List<Trigger> triggers, int value) { Loading