new profile ui #134

Merged
s416084 merged 5 commits from newProfile into develop 2019-01-06 21:14:51 +01:00
7 changed files with 54 additions and 36 deletions

View File

@ -29,7 +29,7 @@
</value>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8 (1)" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">

View File

@ -10,8 +10,8 @@ android {
applicationId "com.uam.wmi.findmytutor"
minSdkVersion 22
targetSdkVersion 27
versionCode 37
versionName "0.9.6-beta"
versionCode 40
versionName "1.0.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}

View File

@ -266,7 +266,6 @@ public abstract class BaseActivity
setUpNav();
actionBarDrawerToggle.syncState();
}
@Override
@ -423,7 +422,7 @@ public abstract class BaseActivity
}
private void updateNavigationBarState() {
public void updateNavigationBarState() {
int actionId = getNavigationMenuItemId();
selectBottomNavigationBarItem(actionId);
}

View File

@ -6,6 +6,7 @@ import android.app.FragmentTransaction;
import android.app.TimePickerDialog;
import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.preference.ListPreference;
import android.preference.Preference;
@ -270,11 +271,10 @@ public class SharingFragment extends PreferenceFragment implements SharedPrefere
FragmentTransaction fragmentTransaction = getFragmentManager().beginTransaction();
fragmentTransaction.hide(SharingFragment.this);
fragmentTransaction.commit();
((MapActivity) getActivity()).updateNavigationBarState();
return true;
});
statusSwitch.setOnPreferenceChangeListener((preference, newValue) -> {
return true;
});
statusSwitch.setOnPreferenceChangeListener((preference, newValue) -> true);
/** Status list change listener **/
statusList.setOnPreferenceChangeListener((preference, newValue) -> {
ListPreference lp = (ListPreference) preference;

View File

@ -231,6 +231,7 @@ public class UsersListFragment extends Fragment {
List<User> list = new ArrayList<User>();
list.add(user);
((MapActivity) getActivity()).filterMarkers(list);
((MapActivity) getActivity()).updateNavigationBarState();
});
}
alertDialog = alertDialogBuilderUserInput.create();

View File

@ -17,15 +17,38 @@ public class RightButtonPreference extends Preference {
public RightButtonPreference(Context context, AttributeSet attrs) {
super(context, attrs);
setWidgetLayoutResource(R.layout.preference_button_widget);
init(context, attrs);
}
private void init(Context context, AttributeSet attrs){
for (int i=0;i<attrs.getAttributeCount();i++) {
String attr = attrs.getAttributeName(i);
try {
if(attr.equalsIgnoreCase("key")){
Log.e("BUTTON_ERR",attr);
String val = attrs.getAttributeValue(i);
if (attr.equalsIgnoreCase("text")) {
buttonText = context.getResources().getString(Integer.parseInt(val.substring(1)));
switch (val) {
case "remove_manual_status":
buttonText = context.getResources().getString(R.string.preference_manual_location_button_remove);
break;
case "manual_location_button":
buttonText = context.getResources().getString(R.string.preference_manual_location_button);
break;
case "remove_manual_location":
buttonText = context.getResources().getString(R.string.preference_manual_location_button_remove);
break;
}
}
} catch (Exception e) {
buttonText = "";
Log.e("BUTTON_ERR", String.valueOf(e));
}
}
}
public void setText(String text){
prefButton.setText(text);
}

View File

@ -1,20 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/pref_screen"
android:fontFamily="@font/lato_regular"
android:layout_height="match_parent">
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fontFamily="@font/lato_regular">
<PreferenceCategory
android:title="@string/settings_category_location"
android:key="category_sharing">
android:key="category_sharing"
android:title="@string/settings_category_location">
<SwitchPreference
android:defaultValue="false"
android:disableDependentsState="false"
android:key="key_sharing_enabled"
android:persistent="true"
android:title="@string/title_sharing"/>
android:title="@string/title_sharing" />
<ListPreference
android:defaultValue="2"
android:dialogTitle="@string/settings_location_level"
@ -25,19 +24,17 @@
android:title="@string/title_location_level" />
<ListPreference
android:defaultValue="0"
android:key="key_manual_location_value"
android:summary="%s"
android:entries="@array/manual_location_entries"
android:entryValues="@array/manual_location_values"
android:key="key_manual_location_value"
android:summary="%s"
android:title="@string/title_list_manual_location" />
<com.uam.wmi.findmytutor.utils.RightButtonPreference
android:key="manual_location_button"
android:text="@string/preference_manual_location_button"
/>
android:text="@string/preference_manual_location_button" />
<com.uam.wmi.findmytutor.utils.RightButtonPreference
android:key="remove_manual_location"
android:text="@string/preference_manual_location_button_remove"
/>
android:text="@string/preference_manual_location_button_remove" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/settings_category_status">
@ -46,24 +43,22 @@
android:disableDependentsState="false"
android:key="key_status_enabled"
android:persistent="true"
android:title="@string/status_switch_title"/>
android:title="@string/status_switch_title" />
<ListPreference
android:defaultValue="0"
android:key="@string/key_status_value"
android:summary="%s"
android:entries="@array/status_entries"
android:entryValues="@array/status_values"
android:key="@string/key_status_value"
android:summary="%s"
android:title="@string/status_list_title" />
<EditTextPreference
android:key="key_manual_status"
android:selectAllOnFocus="true"
android:singleLine="true"
android:title="@string/title_manual_status"
/>
android:title="@string/title_manual_status" />
<com.uam.wmi.findmytutor.utils.RightButtonPreference
android:key="remove_manual_status"
android:text="@string/preference_manual_status_button_remove"
/>
android:text="@string/preference_manual_status_button_remove" />
</PreferenceCategory>
</PreferenceScreen>