Merge branch 'shared-settings-handle-background-task' of s416084/find-my-tutor-android into develop
This commit is contained in:
commit
d2b5fbf35d
@ -8,6 +8,14 @@
|
|||||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_COARSE_UPDATES" />
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||||
|
|
||||||
|
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_COARSE_UPDATES" />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
|
@ -53,42 +53,45 @@ public abstract class BaseActivity
|
|||||||
setContentView(getContentViewId());
|
setContentView(getContentViewId());
|
||||||
drawerNavigationView = findViewById(R.id.nav_view);
|
drawerNavigationView = findViewById(R.id.nav_view);
|
||||||
sideDrawer = findViewById(R.id.activity_container);
|
sideDrawer = findViewById(R.id.activity_container);
|
||||||
|
|
||||||
|
|
||||||
drawerNavigationView.setNavigationItemSelectedListener(
|
drawerNavigationView.setNavigationItemSelectedListener(
|
||||||
new NavigationView.OnNavigationItemSelectedListener() {
|
item -> {
|
||||||
@Override
|
String itemName = (String) item.getTitle();
|
||||||
public boolean onNavigationItemSelected(@NonNull MenuItem item) {
|
Intent launchIntent;
|
||||||
String itemName = (String) item.getTitle();
|
if (itemName.equals("Whitelist")) {
|
||||||
Intent launchIntent;
|
/* launchIntent = new Intent(getApplicationContext(), WhitelistActivity.class);
|
||||||
if (itemName.equals("Whitelist")) {
|
startActivity(launchIntent);*/
|
||||||
/* launchIntent = new Intent(getApplicationContext(), WhitelistActivity.class);
|
} else if (itemName.equals("Blacklist")) {
|
||||||
startActivity(launchIntent);*/
|
/* launchIntent = new Intent(getApplicationContext(), BlacklistActivity.class);
|
||||||
} else if (itemName.equals("Blacklist")) {
|
startActivity(launchIntent);*/
|
||||||
/* launchIntent = new Intent(getApplicationContext(), BlacklistActivity.class);
|
} else if (itemName.equals("Profile")) {
|
||||||
startActivity(launchIntent);*/
|
/* launchIntent = new Intent(getApplicationContext(), ProfileActivity.class);
|
||||||
} else if (itemName.equals("Profile")) {
|
startActivity(launchIntent);*/
|
||||||
/* launchIntent = new Intent(getApplicationContext(), ProfileActivity.class);
|
} else if (itemName.equals("Settings")) {
|
||||||
startActivity(launchIntent);*/
|
launchIntent = new Intent(getApplicationContext(), SettingsActivity.class);
|
||||||
} else if (itemName.equals("Settings")) {
|
startActivity(launchIntent);
|
||||||
launchIntent = new Intent(getApplicationContext(), SettingsActivity.class);
|
|
||||||
startActivity(launchIntent);
|
|
||||||
|
|
||||||
} else if (itemName.equals("Log out")) {
|
} else if (itemName.equals("Log out")) {
|
||||||
PrefUtils.cleanUserLocalStorage(getApplicationContext());
|
stopBackgroundLocalizationTask();
|
||||||
Intent i = getBaseContext().getPackageManager()
|
|
||||||
.getLaunchIntentForPackage(getBaseContext().getPackageName());
|
PrefUtils.cleanUserLocalStorage(getApplicationContext());
|
||||||
if (i != null) {
|
Intent i = getBaseContext().getPackageManager()
|
||||||
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
.getLaunchIntentForPackage(getBaseContext().getPackageName());
|
||||||
}
|
if (i != null) {
|
||||||
startActivity(i);
|
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
||||||
finish();
|
|
||||||
}
|
}
|
||||||
|
startActivity(i);
|
||||||
|
finish();
|
||||||
|
|
||||||
sideDrawer.closeDrawers();
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sideDrawer.closeDrawers();
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
navigationView = findViewById(R.id.navigation);
|
navigationView = findViewById(R.id.navigation);
|
||||||
navigationView.setOnNavigationItemSelectedListener(this);
|
navigationView.setOnNavigationItemSelectedListener(this);
|
||||||
sharingFragment = new SharingFragment();
|
sharingFragment = new SharingFragment();
|
||||||
@ -102,6 +105,43 @@ public abstract class BaseActivity
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void stopBackgroundLocalizationTask() {
|
||||||
|
Intent stopIntent = new Intent(getApplicationContext(), BackgroundLocalizationService.class);
|
||||||
|
stopIntent.putExtra("request_stop", true);
|
||||||
|
startService(stopIntent);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void startBackgroundLocalizationTask() {
|
||||||
|
if ((ContextCompat.checkSelfPermission(getApplicationContext(), android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED)) {
|
||||||
|
|
||||||
|
if ((ActivityCompat.shouldShowRequestPermissionRationale(this, android.Manifest.permission.ACCESS_FINE_LOCATION))) {
|
||||||
|
|
||||||
|
} else {
|
||||||
|
ActivityCompat.requestPermissions(this, new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION
|
||||||
|
|
||||||
|
},
|
||||||
|
REQUEST_PERMISSIONS);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
|
||||||
|
Intent startIntent = new Intent(getApplicationContext(), BackgroundLocalizationService.class);
|
||||||
|
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
|
startForegroundService(startIntent);
|
||||||
|
} else {
|
||||||
|
startService(startIntent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void handleBackgroundTaskLifeCycle() {
|
||||||
|
if (PrefUtils.isEnableSharingLocalization(getApplicationContext())) {
|
||||||
|
startBackgroundLocalizationTask();
|
||||||
|
} else {
|
||||||
|
stopBackgroundLocalizationTask();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setContentView(int layoutResID) {
|
public void setContentView(int layoutResID) {
|
||||||
DrawerLayout fullView = (DrawerLayout) getLayoutInflater().inflate(R.layout.base_activity, null);
|
DrawerLayout fullView = (DrawerLayout) getLayoutInflater().inflate(R.layout.base_activity, null);
|
||||||
@ -140,12 +180,12 @@ public abstract class BaseActivity
|
|||||||
|
|
||||||
actionBarDrawerToggle.syncState();
|
actionBarDrawerToggle.syncState();
|
||||||
|
|
||||||
if (isTutor) {
|
/* if (isTutor) {
|
||||||
fn_permission();
|
startLocalizationService();
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
private void fn_permission() {
|
/* public void startLocalizationService() {
|
||||||
if ((ContextCompat.checkSelfPermission(getApplicationContext(), android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED)) {
|
if ((ContextCompat.checkSelfPermission(getApplicationContext(), android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED)) {
|
||||||
|
|
||||||
if ((ActivityCompat.shouldShowRequestPermissionRationale(BaseActivity.this, android.Manifest.permission.ACCESS_FINE_LOCATION))) {
|
if ((ActivityCompat.shouldShowRequestPermissionRationale(BaseActivity.this, android.Manifest.permission.ACCESS_FINE_LOCATION))) {
|
||||||
@ -171,7 +211,7 @@ public abstract class BaseActivity
|
|||||||
Toast.makeText(getApplicationContext(), "Please enable the gps", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getApplicationContext(), "Please enable the gps", Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onConfigurationChanged(Configuration newConfig) {
|
public void onConfigurationChanged(Configuration newConfig) {
|
||||||
|
@ -167,9 +167,10 @@ public class LoginActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
|
|
||||||
private void loginProcess(String email, String password) {
|
private void loginProcess(String email, String password) {
|
||||||
|
Log.e("LOGIN", String.valueOf(PrefUtils.getIsTutor(getApplicationContext())));
|
||||||
|
|
||||||
//Fake validate
|
//Fake validate
|
||||||
LdapUser user = new LdapUser(email, password, "admin", (isTutor) ? "Tutor" : "Student", "string", "string", email);
|
LdapUser user = new LdapUser(email, password, "admin", (PrefUtils.getIsTutor(getApplicationContext())) ? "Tutor" : "Student", "string", "string", email);
|
||||||
|
|
||||||
// ValidateUser user = new ValidateUser(email, password);
|
// ValidateUser user = new ValidateUser(email, password);
|
||||||
|
|
||||||
@ -202,7 +203,6 @@ public class LoginActivity extends AppCompatActivity {
|
|||||||
JWT jwt = new JWT(token);
|
JWT jwt = new JWT(token);
|
||||||
Claim role = jwt.getClaim("nameid");
|
Claim role = jwt.getClaim("nameid");
|
||||||
|
|
||||||
|
|
||||||
PrefUtils.storeIsLoggedIn(getApplicationContext(), true);
|
PrefUtils.storeIsLoggedIn(getApplicationContext(), true);
|
||||||
PrefUtils.storeApiKey(getApplicationContext(), token);
|
PrefUtils.storeApiKey(getApplicationContext(), token);
|
||||||
PrefUtils.storeUserId(getApplicationContext(), role.asString());
|
PrefUtils.storeUserId(getApplicationContext(), role.asString());
|
||||||
|
@ -6,14 +6,11 @@ import android.animation.ValueAnimator;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.content.pm.PackageManager;
|
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.v4.app.ActivityCompat;
|
|
||||||
import android.support.v4.content.ContextCompat;
|
|
||||||
import android.widget.Toast;
|
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import com.mapbox.mapboxsdk.Mapbox;
|
import com.mapbox.mapboxsdk.Mapbox;
|
||||||
import com.mapbox.mapboxsdk.annotations.Marker;
|
import com.mapbox.mapboxsdk.annotations.Marker;
|
||||||
import com.mapbox.mapboxsdk.annotations.MarkerOptions;
|
import com.mapbox.mapboxsdk.annotations.MarkerOptions;
|
||||||
@ -25,7 +22,6 @@ import com.mapbox.mapboxsdk.maps.OnMapReadyCallback;
|
|||||||
import com.uam.wmi.findmytutor.R;
|
import com.uam.wmi.findmytutor.R;
|
||||||
import com.uam.wmi.findmytutor.model.Coordinate;
|
import com.uam.wmi.findmytutor.model.Coordinate;
|
||||||
import com.uam.wmi.findmytutor.network.ApiClient;
|
import com.uam.wmi.findmytutor.network.ApiClient;
|
||||||
import com.uam.wmi.findmytutor.network.RetrofitClientInstance;
|
|
||||||
import com.uam.wmi.findmytutor.service.BackgroundLocalizationService;
|
import com.uam.wmi.findmytutor.service.BackgroundLocalizationService;
|
||||||
import com.uam.wmi.findmytutor.service.CoordinateService;
|
import com.uam.wmi.findmytutor.service.CoordinateService;
|
||||||
import com.uam.wmi.findmytutor.utils.PrefUtils;
|
import com.uam.wmi.findmytutor.utils.PrefUtils;
|
||||||
@ -62,8 +58,6 @@ public class MapActivity extends BaseActivity
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
@ -93,6 +87,9 @@ public class MapActivity extends BaseActivity
|
|||||||
mapView = (MapView) findViewById(R.id.mapView);
|
mapView = (MapView) findViewById(R.id.mapView);
|
||||||
mapView.onCreate(savedInstanceState);
|
mapView.onCreate(savedInstanceState);
|
||||||
mapView.getMapAsync(this);
|
mapView.getMapAsync(this);
|
||||||
|
|
||||||
|
//start background task
|
||||||
|
startBackgroundLocalizationTask();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -239,7 +236,10 @@ public class MapActivity extends BaseActivity
|
|||||||
mapView.onSaveInstanceState(outState);
|
mapView.onSaveInstanceState(outState);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void fn_permission() {
|
|
||||||
|
|
||||||
|
/*@Override
|
||||||
|
public void startLocalizationService() {
|
||||||
if ((ContextCompat.checkSelfPermission(getApplicationContext(), android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED)) {
|
if ((ContextCompat.checkSelfPermission(getApplicationContext(), android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED)) {
|
||||||
|
|
||||||
if ((ActivityCompat.shouldShowRequestPermissionRationale(MapActivity.this, android.Manifest.permission.ACCESS_FINE_LOCATION))) {
|
if ((ActivityCompat.shouldShowRequestPermissionRationale(MapActivity.this, android.Manifest.permission.ACCESS_FINE_LOCATION))) {
|
||||||
@ -265,7 +265,7 @@ public class MapActivity extends BaseActivity
|
|||||||
Toast.makeText(getApplicationContext(), "Please enable the gps", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getApplicationContext(), "Please enable the gps", Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int getContentViewId() {
|
protected int getContentViewId() {
|
||||||
|
@ -1,8 +1,11 @@
|
|||||||
package com.uam.wmi.findmytutor.activity;
|
package com.uam.wmi.findmytutor.activity;
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
|
import android.app.Activity;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.preference.ListPreference;
|
import android.preference.ListPreference;
|
||||||
import android.preference.Preference;
|
import android.preference.Preference;
|
||||||
@ -13,44 +16,42 @@ import android.view.View;
|
|||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
import com.uam.wmi.findmytutor.R;
|
import com.uam.wmi.findmytutor.R;
|
||||||
|
import com.uam.wmi.findmytutor.service.BackgroundLocalizationService;
|
||||||
|
import com.uam.wmi.findmytutor.utils.PrefUtils;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
//public class SharingFragment {
|
import static com.mapbox.mapboxsdk.Mapbox.getApplicationContext;
|
||||||
//}
|
|
||||||
|
|
||||||
public class SharingFragment extends PreferenceFragment {
|
public class SharingFragment extends PreferenceFragment {
|
||||||
|
|
||||||
@SuppressLint("ResourceType")
|
@SuppressLint("ResourceType")
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(final Bundle savedInstanceState) {
|
public void onCreate(final Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
addPreferencesFromResource(R.layout.pref_sharing);
|
addPreferencesFromResource(R.layout.pref_sharing);
|
||||||
Preference manualStatus = findPreference("key_manual_status");
|
Preference manualStatus = findPreference("key_manual_status");
|
||||||
|
Preference locationSharing = findPreference("key_sharing_enabled");
|
||||||
|
|
||||||
manualStatus.setOnPreferenceChangeListener((preference, newValue) -> {
|
manualStatus.setOnPreferenceChangeListener((preference, newValue) -> {
|
||||||
ListPreference lp = (ListPreference) findPreference("key_status_value");
|
ListPreference lp = (ListPreference) findPreference("key_status_value");
|
||||||
updateListPreference(lp, newValue, "manual_statuses");
|
updateListPreference(lp, newValue, "manual_statuses");
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
/* Preference manualLocation = findPreference("key_sharing_enabled");
|
locationSharing.setOnPreferenceChangeListener((buttonView, isChecked) -> {
|
||||||
manualLocation.setOnPreferenceChangeListener((preference, newValue) -> {
|
PrefUtils.storeEnableSharingLocalization(getApplicationContext(), (Boolean) isChecked);
|
||||||
ListPreference lp = (ListPreference) findPreference("key_sharing_enabled");
|
((MapActivity)getActivity()).handleBackgroundTaskLifeCycle();
|
||||||
updateListPreference(lp, newValue, "sharing_enabled");
|
|
||||||
return true;
|
|
||||||
});*/
|
|
||||||
|
|
||||||
Preference sharingLocation = findPreference("key_sharing_enabled");
|
return true;
|
||||||
sharingLocation.setOnPreferenceChangeListener((preference, o) -> {
|
|
||||||
Log.e("change", "1");
|
|
||||||
return false;
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static SharingFragment newInstance() {
|
public static SharingFragment newInstance() {
|
||||||
|
|
||||||
return new SharingFragment();
|
return new SharingFragment();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -58,7 +59,7 @@ public class SharingFragment extends PreferenceFragment {
|
|||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||||
View view = super.onCreateView(inflater, container, savedInstanceState);
|
View view = super.onCreateView(inflater, container, savedInstanceState);
|
||||||
view.setBackgroundColor(getResources().getColor(android.R.color.white));
|
Objects.requireNonNull(view).setBackgroundColor(getResources().getColor(android.R.color.white));
|
||||||
|
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
@ -74,10 +75,10 @@ public class SharingFragment extends PreferenceFragment {
|
|||||||
setListPreferenceData(lp.getKey(),manualStatusArr);
|
setListPreferenceData(lp.getKey(),manualStatusArr);
|
||||||
SharedPreferences.Editor editor = sharedPref.edit();
|
SharedPreferences.Editor editor = sharedPref.edit();
|
||||||
editor.putStringSet(storageKey,manualStatusSet);
|
editor.putStringSet(storageKey,manualStatusSet);
|
||||||
editor.commit();
|
editor.apply();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected ListPreference setListPreferenceData(String lp_name, String [] entries) {
|
protected void setListPreferenceData(String lp_name, String [] entries) {
|
||||||
ListPreference lp = (ListPreference) findPreference(lp_name);
|
ListPreference lp = (ListPreference) findPreference(lp_name);
|
||||||
lp.setEntries(entries);
|
lp.setEntries(entries);
|
||||||
CharSequence[] entryValues = new CharSequence [entries.length];
|
CharSequence[] entryValues = new CharSequence [entries.length];
|
||||||
@ -88,7 +89,5 @@ public class SharingFragment extends PreferenceFragment {
|
|||||||
|
|
||||||
lp.setDefaultValue("1");
|
lp.setDefaultValue("1");
|
||||||
lp.setEntryValues(entryValues);
|
lp.setEntryValues(entryValues);
|
||||||
|
|
||||||
return lp;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -117,7 +117,7 @@ public class UsersListFragment extends Fragment {
|
|||||||
|
|
||||||
private void showNoteDialog(final User user) {
|
private void showNoteDialog(final User user) {
|
||||||
LayoutInflater layoutInflaterAndroid = LayoutInflater.from(getActivity().getApplicationContext());
|
LayoutInflater layoutInflaterAndroid = LayoutInflater.from(getActivity().getApplicationContext());
|
||||||
View view = layoutInflaterAndroid.inflate(R.layout.note_dialog, null);
|
View view = layoutInflaterAndroid.inflate(R.layout.user_list_modal, null);
|
||||||
|
|
||||||
AlertDialog.Builder alertDialogBuilderUserInput = new AlertDialog.Builder(getActivity());
|
AlertDialog.Builder alertDialogBuilderUserInput = new AlertDialog.Builder(getActivity());
|
||||||
alertDialogBuilderUserInput.setView(view);
|
alertDialogBuilderUserInput.setView(view);
|
||||||
@ -128,6 +128,7 @@ public class UsersListFragment extends Fragment {
|
|||||||
|
|
||||||
TextView userName = view.findViewById(R.id.userName);
|
TextView userName = view.findViewById(R.id.userName);
|
||||||
ListView userDutyHours = view.findViewById(R.id.userDutyHours);
|
ListView userDutyHours = view.findViewById(R.id.userDutyHours);
|
||||||
|
TextView userDutyHoursTitle = view.findViewById(R.id.userDutyHoursTitle);
|
||||||
TextView userNote = view.findViewById(R.id.userNote);
|
TextView userNote = view.findViewById(R.id.userNote);
|
||||||
TextView userRoom = view.findViewById(R.id.userRoom);
|
TextView userRoom = view.findViewById(R.id.userRoom);
|
||||||
TextView userEmail = view.findViewById(R.id.userEmail);
|
TextView userEmail = view.findViewById(R.id.userEmail);
|
||||||
@ -150,9 +151,10 @@ public class UsersListFragment extends Fragment {
|
|||||||
userEmail.setText(String.format("%s: %s", getString(R.string.userEmail), tutorTabViewModel.getEmailTutorTab()));
|
userEmail.setText(String.format("%s: %s", getString(R.string.userEmail), tutorTabViewModel.getEmailTutorTab()));
|
||||||
userNote.setText(String.format("%s: %s", getString(R.string.userNote), tutorTabViewModel.getNote()));
|
userNote.setText(String.format("%s: %s", getString(R.string.userNote), tutorTabViewModel.getNote()));
|
||||||
department.setText(String.format("%s: %s", getString(R.string.userDepartment), user.getDepartment()));
|
department.setText(String.format("%s: %s", getString(R.string.userDepartment), user.getDepartment()));
|
||||||
|
userDutyHoursTitle.setText(String.format("%s:", getString(R.string.userDutyHoursHeader)));
|
||||||
|
|
||||||
final ArrayAdapter<String> arrayAdapter = new ArrayAdapter<>(getActivity(),
|
final ArrayAdapter<String> arrayAdapter = new ArrayAdapter<>(getActivity(),
|
||||||
android.R.layout.simple_list_item_activated_1, dutyHoursList);
|
android.R.layout.test_list_item, dutyHoursList);
|
||||||
|
|
||||||
userDutyHours.setAdapter(arrayAdapter);
|
userDutyHours.setAdapter(arrayAdapter);
|
||||||
alertDialog.show();
|
alertDialog.show();
|
||||||
@ -165,6 +167,7 @@ public class UsersListFragment extends Fragment {
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void fetchAllTutors() {
|
private void fetchAllTutors() {
|
||||||
disposable.add(
|
disposable.add(
|
||||||
userService.apiUsersGet()
|
userService.apiUsersGet()
|
||||||
|
@ -6,21 +6,23 @@ import android.app.Notification;
|
|||||||
import android.app.NotificationChannel;
|
import android.app.NotificationChannel;
|
||||||
import android.app.NotificationManager;
|
import android.app.NotificationManager;
|
||||||
import android.app.Service;
|
import android.app.Service;
|
||||||
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
|
import android.location.Criteria;
|
||||||
import android.location.Location;
|
import android.location.Location;
|
||||||
import android.location.LocationManager;
|
import android.location.LocationManager;
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
|
import android.os.HandlerThread;
|
||||||
import android.os.IBinder;
|
import android.os.IBinder;
|
||||||
import android.support.annotation.RequiresApi;
|
import android.support.annotation.RequiresApi;
|
||||||
import android.support.v4.app.ActivityCompat;
|
import android.support.v4.app.ActivityCompat;
|
||||||
import android.support.v4.app.NotificationCompat;
|
import android.support.v4.app.NotificationCompat;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.content.Context;
|
|
||||||
|
|
||||||
import com.jakewharton.retrofit2.adapter.rxjava2.HttpException;
|
import com.jakewharton.retrofit2.adapter.rxjava2.HttpException;
|
||||||
import com.uam.wmi.findmytutor.model.Coordinate;
|
import com.uam.wmi.findmytutor.model.Coordinate;
|
||||||
@ -28,16 +30,8 @@ import com.uam.wmi.findmytutor.network.ApiClient;
|
|||||||
import com.uam.wmi.findmytutor.utils.PrefUtils;
|
import com.uam.wmi.findmytutor.utils.PrefUtils;
|
||||||
import com.uam.wmi.findmytutor.utils.RestApiHelper;
|
import com.uam.wmi.findmytutor.utils.RestApiHelper;
|
||||||
|
|
||||||
import org.json.JSONObject;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InterruptedIOException;
|
|
||||||
import java.lang.reflect.Array;
|
|
||||||
import java.net.SocketTimeoutException;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Timer;
|
|
||||||
import java.util.TimerTask;
|
|
||||||
|
|
||||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||||
import io.reactivex.disposables.CompositeDisposable;
|
import io.reactivex.disposables.CompositeDisposable;
|
||||||
@ -48,64 +42,22 @@ import timber.log.Timber;
|
|||||||
|
|
||||||
public class BackgroundLocalizationService extends Service {
|
public class BackgroundLocalizationService extends Service {
|
||||||
|
|
||||||
public static String str_receiver = "background.location.broadcast";
|
|
||||||
private static final String TAG = "MyLocationService";
|
private static final String TAG = "MyLocationService";
|
||||||
private LocationManager mLocationManager = null;
|
|
||||||
private static final int LOCATION_INTERVAL = 1000;
|
private static final int LOCATION_INTERVAL = 1000;
|
||||||
private static final float LOCATION_DISTANCE = 10f;
|
private static final float LOCATION_DISTANCE = 5f;
|
||||||
|
public static String str_receiver = "background.location.broadcast";
|
||||||
private static long notify_interval = 10000;
|
private static long notify_interval = 10000;
|
||||||
private Handler mHandler = new Handler();
|
|
||||||
|
|
||||||
Location mLastLocation;
|
Location mLastLocation;
|
||||||
Intent intent;
|
|
||||||
|
|
||||||
ArrayList<String> providers = new ArrayList<String>();
|
ArrayList<String> providers = new ArrayList<String>();
|
||||||
LocationListener[] mLocationListeners ;
|
LocationListener[] mLocationListeners;
|
||||||
|
|
||||||
private class LocationListener implements android.location.LocationListener {
|
private LocationManager mLocationManager = null;
|
||||||
|
private Handler mHandler = new Handler();
|
||||||
|
private HandlerThread mHandlerThread = null;
|
||||||
|
private Runnable mStatusChecker;
|
||||||
|
|
||||||
public LocationListener(String provider) {
|
public BackgroundLocalizationService() {
|
||||||
Log.e(TAG, "LocationListener " + provider);
|
|
||||||
mLastLocation = new Location(provider);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onLocationChanged(Location location) {
|
|
||||||
Log.e(TAG, "onLocationChanged: " + location);
|
|
||||||
mLastLocation.set(location);
|
|
||||||
fn_update(mLastLocation);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onProviderDisabled(String provider) {
|
|
||||||
Log.e(TAG, "onProviderDisabled: " + provider);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onProviderEnabled(String provider) {
|
|
||||||
Log.e(TAG, "onProviderEnabled: " + provider);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onStatusChanged(String provider, int status, Bundle extras) {
|
|
||||||
Log.e(TAG, "onStatusChanged: " + provider);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public IBinder onBind(Intent arg0) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int onStartCommand(Intent intent, int flags, int startId) {
|
|
||||||
Log.e(TAG, "onStartCommand");
|
|
||||||
super.onStartCommand(intent, flags, startId);
|
|
||||||
|
|
||||||
return START_STICKY;
|
|
||||||
}
|
|
||||||
|
|
||||||
public BackgroundLocalizationService(){
|
|
||||||
providers.add(LocationManager.GPS_PROVIDER);
|
providers.add(LocationManager.GPS_PROVIDER);
|
||||||
providers.add(LocationManager.NETWORK_PROVIDER);
|
providers.add(LocationManager.NETWORK_PROVIDER);
|
||||||
providers.add(LocationManager.PASSIVE_PROVIDER);
|
providers.add(LocationManager.PASSIVE_PROVIDER);
|
||||||
@ -117,10 +69,36 @@ public class BackgroundLocalizationService extends Service {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IBinder onBind(Intent arg0) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int onStartCommand(Intent intent, int flags, int startId) {
|
||||||
|
Log.e(TAG, "onStartCommand");
|
||||||
|
super.onStartCommand(intent, flags, startId);
|
||||||
|
|
||||||
|
//call startForeground first
|
||||||
|
boolean stopService = false;
|
||||||
|
|
||||||
|
if (intent != null) {
|
||||||
|
stopService = intent.getBooleanExtra("request_stop", false);
|
||||||
|
}
|
||||||
|
if (stopService) {
|
||||||
|
stopForeground(true);
|
||||||
|
stopSelf();
|
||||||
|
return START_STICKY;
|
||||||
|
}
|
||||||
|
|
||||||
|
return START_STICKY;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate() {
|
public void onCreate() {
|
||||||
Log.e(TAG, "onCreate");
|
Log.e(TAG, "onCreate");
|
||||||
|
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
|
||||||
startMyOwnForeground();
|
startMyOwnForeground();
|
||||||
else {
|
else {
|
||||||
@ -141,6 +119,7 @@ public class BackgroundLocalizationService extends Service {
|
|||||||
LOCATION_DISTANCE,
|
LOCATION_DISTANCE,
|
||||||
listener
|
listener
|
||||||
);
|
);
|
||||||
|
|
||||||
} catch (java.lang.SecurityException ex) {
|
} catch (java.lang.SecurityException ex) {
|
||||||
Log.i(TAG, "fail to request location update, ignore", ex);
|
Log.i(TAG, "fail to request location update, ignore", ex);
|
||||||
} catch (IllegalArgumentException ex) {
|
} catch (IllegalArgumentException ex) {
|
||||||
@ -150,11 +129,15 @@ public class BackgroundLocalizationService extends Service {
|
|||||||
providerIndex++;
|
providerIndex++;
|
||||||
}
|
}
|
||||||
|
|
||||||
Timer mTimer = new Timer();
|
mStatusChecker = () -> {
|
||||||
mTimer.schedule(new TimerTaskToGetLocation(), 5, notify_interval);
|
try {
|
||||||
intent = new Intent(str_receiver);
|
fn_getlocation();
|
||||||
|
} finally {
|
||||||
|
mHandler.postDelayed(mStatusChecker, notify_interval);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
fn_getlocation();
|
AsyncTask.execute(mStatusChecker);
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresApi(api = Build.VERSION_CODES.O)
|
@RequiresApi(api = Build.VERSION_CODES.O)
|
||||||
@ -178,7 +161,6 @@ public class BackgroundLocalizationService extends Service {
|
|||||||
startForeground(2, notification);
|
startForeground(2, notification);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void fn_getlocation() {
|
private void fn_getlocation() {
|
||||||
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
|
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
|
||||||
// TODO: Consider calling
|
// TODO: Consider calling
|
||||||
@ -194,14 +176,17 @@ public class BackgroundLocalizationService extends Service {
|
|||||||
List<String> providers1 = mLocationManager.getProviders(true);
|
List<String> providers1 = mLocationManager.getProviders(true);
|
||||||
Location bestLocation = null;
|
Location bestLocation = null;
|
||||||
|
|
||||||
|
|
||||||
for (String provider : providers1) {
|
for (String provider : providers1) {
|
||||||
Location location = mLocationManager.getLastKnownLocation(provider);
|
Location location = mLocationManager.getLastKnownLocation(provider);
|
||||||
|
|
||||||
if (location == null) {
|
if (location == null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (bestLocation == null || location.getAccuracy() < bestLocation.getAccuracy()) {
|
if (bestLocation == null || location.getAccuracy() < bestLocation.getAccuracy()) {
|
||||||
bestLocation = location;
|
bestLocation = location;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.e("Best localization:", String.valueOf(bestLocation));
|
Log.e("Best localization:", String.valueOf(bestLocation));
|
||||||
@ -210,13 +195,6 @@ public class BackgroundLocalizationService extends Service {
|
|||||||
fn_update(bestLocation);
|
fn_update(bestLocation);
|
||||||
}
|
}
|
||||||
|
|
||||||
private class TimerTaskToGetLocation extends TimerTask {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
mHandler.post(BackgroundLocalizationService.this::fn_getlocation);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void fn_update(Location location) {
|
private void fn_update(Location location) {
|
||||||
new Task(location).execute();
|
new Task(location).execute();
|
||||||
}
|
}
|
||||||
@ -226,6 +204,9 @@ public class BackgroundLocalizationService extends Service {
|
|||||||
Log.e(TAG, "onDestroy");
|
Log.e(TAG, "onDestroy");
|
||||||
|
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
|
mHandler.removeCallbacks(mStatusChecker);
|
||||||
|
|
||||||
|
|
||||||
if (mLocationManager != null) {
|
if (mLocationManager != null) {
|
||||||
for (LocationListener listener : mLocationListeners) {
|
for (LocationListener listener : mLocationListeners) {
|
||||||
try {
|
try {
|
||||||
@ -233,6 +214,8 @@ public class BackgroundLocalizationService extends Service {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
mLocationManager.removeUpdates(listener);
|
mLocationManager.removeUpdates(listener);
|
||||||
|
Log.i(TAG, "Removed");
|
||||||
|
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
Log.i(TAG, "fail to remove location listener, ignore", ex);
|
Log.i(TAG, "fail to remove location listener, ignore", ex);
|
||||||
}
|
}
|
||||||
@ -248,6 +231,35 @@ public class BackgroundLocalizationService extends Service {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private class LocationListener implements android.location.LocationListener {
|
||||||
|
|
||||||
|
public LocationListener(String provider) {
|
||||||
|
Log.e(TAG, "LocationListener " + provider);
|
||||||
|
mLastLocation = new Location(provider);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onLocationChanged(Location location) {
|
||||||
|
Log.e(TAG, "onLocationChanged: " + location);
|
||||||
|
mLastLocation.set(location);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onProviderDisabled(String provider) {
|
||||||
|
Log.e(TAG, "onProviderDisabled: " + provider);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onProviderEnabled(String provider) {
|
||||||
|
Log.e(TAG, "onProviderEnabled: " + provider);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onStatusChanged(String provider, int status, Bundle extras) {
|
||||||
|
Log.e(TAG, "onStatusChanged: " + provider);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private class Task extends AsyncTask {
|
private class Task extends AsyncTask {
|
||||||
private Double latitude;
|
private Double latitude;
|
||||||
private Double longitude;
|
private Double longitude;
|
||||||
|
@ -61,7 +61,7 @@ public class MyDividerItemDecoration extends RecyclerView.ItemDecoration {
|
|||||||
.getLayoutParams();
|
.getLayoutParams();
|
||||||
final int top = child.getBottom() + params.bottomMargin;
|
final int top = child.getBottom() + params.bottomMargin;
|
||||||
final int bottom = top + mDivider.getIntrinsicHeight();
|
final int bottom = top + mDivider.getIntrinsicHeight();
|
||||||
mDivider.setBounds(left + dpToPx(margin), top, right - dpToPx(margin), bottom);
|
mDivider.setBounds(left, top, right, bottom);
|
||||||
mDivider.draw(c);
|
mDivider.draw(c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,15 +7,26 @@ import android.util.Log;
|
|||||||
import com.auth0.android.jwt.Claim;
|
import com.auth0.android.jwt.Claim;
|
||||||
import com.auth0.android.jwt.JWT;
|
import com.auth0.android.jwt.JWT;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
public class PrefUtils {
|
public class PrefUtils {
|
||||||
|
|
||||||
public PrefUtils() {
|
public PrefUtils() {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static SharedPreferences getSharedPreferences(Context context) {
|
public static SharedPreferences getSharedPreferences(Context context) {
|
||||||
return context.getSharedPreferences("APP_PREF", Context.MODE_PRIVATE);
|
return context.getSharedPreferences("APP_PREF", Context.MODE_PRIVATE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void getAllKeys(Context context){
|
||||||
|
Map<String,?> keys = getSharedPreferences(context).getAll();
|
||||||
|
|
||||||
|
for(Map.Entry<String,?> entry : keys.entrySet()){
|
||||||
|
Log.d("map values",entry.getKey() + ": " + entry.getValue().toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static void cleanUserLocalStorage(Context context) {
|
public static void cleanUserLocalStorage(Context context) {
|
||||||
SharedPreferences preferences = getSharedPreferences(context);
|
SharedPreferences preferences = getSharedPreferences(context);
|
||||||
SharedPreferences.Editor editor = preferences.edit();
|
SharedPreferences.Editor editor = preferences.edit();
|
||||||
@ -67,14 +78,14 @@ public class PrefUtils {
|
|||||||
return getSharedPreferences(context).getBoolean("IS_LOGGED_IN", false);
|
return getSharedPreferences(context).getBoolean("IS_LOGGED_IN", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void storeIsServiceRunning(Context context, Boolean flag) {
|
public static boolean isEnableSharingLocalization(Context context) {
|
||||||
SharedPreferences.Editor editor = getSharedPreferences(context).edit();
|
return getSharedPreferences(context).getBoolean("IS_ENABLE_SHARING_LOCALIZATION", false);
|
||||||
editor.putBoolean("IS_SERVIS_RUNNING", flag);
|
|
||||||
editor.apply();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean getIsServiceRunning(Context context) {
|
public static void storeEnableSharingLocalization(Context context,Boolean isChecked) {
|
||||||
return getSharedPreferences(context).getBoolean("IS_SERVIS_RUNNING", false);
|
SharedPreferences.Editor editor = getSharedPreferences(context).edit();
|
||||||
|
editor.putBoolean("IS_ENABLE_SHARING_LOCALIZATION", isChecked);
|
||||||
|
editor.apply();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void storeUserFirstName(Context context, String userName) {
|
public static void storeUserFirstName(Context context, String userName) {
|
||||||
|
@ -12,13 +12,12 @@
|
|||||||
android:paddingTop="@dimen/activity_vertical_margin"
|
android:paddingTop="@dimen/activity_vertical_margin"
|
||||||
tools:context=".activity.LoginActivity">
|
tools:context=".activity.LoginActivity">
|
||||||
|
|
||||||
<!-- Login progress -->
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/imageView"
|
android:id="@+id/imageView"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="180dp"
|
android:layout_height="180dp"
|
||||||
android:contentDescription="Logo find my tutor"
|
android:contentDescription="@string/logo_find_my_tutor"
|
||||||
app:srcCompat="@drawable/logo_design_black2" />
|
app:srcCompat="@drawable/logo_design_black2" />
|
||||||
|
|
||||||
<ProgressBar
|
<ProgressBar
|
||||||
@ -48,7 +47,7 @@
|
|||||||
android:id="@+id/email"
|
android:id="@+id/email"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:hint="@string/prompt_email"
|
android:hint="@string/prompt_login"
|
||||||
android:inputType="textEmailAddress"
|
android:inputType="textEmailAddress"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:singleLine="true" />
|
android:singleLine="true" />
|
||||||
@ -85,11 +84,10 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="16dp"
|
android:layout_marginTop="16dp"
|
||||||
android:text="@string/action_sign_in"
|
android:text="@string/action_log_in"
|
||||||
android:textStyle="bold" />
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
@ -1,24 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:padding="10dp">
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/image_view"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="75dp"
|
|
||||||
android:layout_weight="30"
|
|
||||||
android:contentDescription="@string/app_name" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/text"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:layout_weight="70"
|
|
||||||
android:gravity="center"
|
|
||||||
android:text=""
|
|
||||||
android:textStyle="bold" />
|
|
||||||
</LinearLayout>
|
|
@ -1,5 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
|
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
|
||||||
<PreferenceCategory android:title="@string/settings_category_general">
|
<PreferenceCategory android:title="@string/settings_category_general">
|
||||||
|
@ -4,9 +4,9 @@
|
|||||||
android:layout_height="90dp"
|
android:layout_height="90dp"
|
||||||
android:clickable="true"
|
android:clickable="true"
|
||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
android:paddingLeft="@dimen/activity_margin"
|
android:paddingLeft="10dp"
|
||||||
android:paddingTop="@dimen/dimen_10"
|
android:paddingTop="@dimen/dimen_10"
|
||||||
android:paddingRight="@dimen/activity_margin"
|
android:paddingRight="10dp"
|
||||||
android:paddingBottom="@dimen/dimen_10">
|
android:paddingBottom="@dimen/dimen_10">
|
||||||
|
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
android:fontFamily="sans-serif-medium"
|
android:fontFamily="sans-serif-medium"
|
||||||
android:lineSpacingExtra="8sp"
|
android:lineSpacingExtra="8sp"
|
||||||
android:text="@string/lbl_new_note_title"
|
android:text="@string/lbl_new_note_title"
|
||||||
android:textColor="@color/note_list_text"
|
android:textColor="@color/colorAccent"
|
||||||
android:textSize="@dimen/lbl_new_note_title"
|
android:textSize="@dimen/lbl_new_note_title"
|
||||||
android:textStyle="normal" />
|
android:textStyle="normal" />
|
||||||
|
|
||||||
@ -23,6 +23,8 @@
|
|||||||
android:id="@+id/userDepartment"
|
android:id="@+id/userDepartment"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:lineSpacingExtra="8sp"
|
||||||
|
android:paddingTop="5dp"
|
||||||
android:textColor="@color/note_list_text"
|
android:textColor="@color/note_list_text"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@ -30,6 +32,8 @@
|
|||||||
android:id="@+id/userRoom"
|
android:id="@+id/userRoom"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:lineSpacingExtra="8sp"
|
||||||
|
android:paddingTop="5dp"
|
||||||
android:textColor="@color/note_list_text"
|
android:textColor="@color/note_list_text"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@ -37,13 +41,16 @@
|
|||||||
android:id="@+id/userEmail"
|
android:id="@+id/userEmail"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:lineSpacingExtra="8sp"
|
||||||
|
android:paddingTop="5dp"
|
||||||
android:textColor="@color/note_list_text" />
|
android:textColor="@color/note_list_text" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/userDutyHoursTitle"
|
android:id="@+id/userDutyHoursTitle"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/userDutyHoursHeader"
|
android:lineSpacingExtra="8sp"
|
||||||
|
android:paddingTop="5dp"
|
||||||
android:textColor="@color/note_list_text"
|
android:textColor="@color/note_list_text"
|
||||||
tools:text="@string/dutyHours" />
|
tools:text="@string/dutyHours" />
|
||||||
|
|
||||||
@ -51,12 +58,17 @@
|
|||||||
android:id="@+id/userDutyHours"
|
android:id="@+id/userDutyHours"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textColor="@color/note_list_text" />
|
android:paddingTop="0dp"
|
||||||
|
android:paddingBottom="0dp"
|
||||||
|
android:paddingStart="@dimen/activity_margin"
|
||||||
|
android:textColor="@color/colorAccent" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/userNote"
|
android:id="@+id/userNote"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:lineSpacingExtra="8sp"
|
||||||
|
android:paddingTop="5dp"
|
||||||
android:textColor="@color/note_list_text" />
|
android:textColor="@color/note_list_text" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
@ -1,7 +1,7 @@
|
|||||||
<resources>
|
<resources>
|
||||||
<string name="app_name" translatable="false">FindMyTutor</string>
|
<string name="app_name" translatable="false">FindMyTutor</string>
|
||||||
<string name="title_activity_login">Sign in</string>
|
<string name="title_activity_login">Sign in</string>
|
||||||
<string name="title_activity_startup" translatable="false">StartUp Activity</string>
|
<string name="title_activity_startup" translatable="false">Find My Tutor</string>
|
||||||
|
|
||||||
<!-- Menu -->
|
<!-- Menu -->
|
||||||
<string name="nav_map">Map</string>
|
<string name="nav_map">Map</string>
|
||||||
@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
<!-- Strings related to login -->
|
<!-- Strings related to login -->
|
||||||
<string name="prompt_email" translatable="false">Email</string>
|
<string name="prompt_email" translatable="false">Email</string>
|
||||||
<string name="prompt_password">Password (optional)</string>
|
<string name="prompt_password">Password</string>
|
||||||
<string name="action_sign_in">Sign in or register</string>
|
<string name="action_sign_in">Sign in or register</string>
|
||||||
<string name="action_sign_out">Sign out</string>
|
<string name="action_sign_out">Sign out</string>
|
||||||
<string name="action_sign_in_short">Sign in</string>
|
<string name="action_sign_in_short">Sign in</string>
|
||||||
@ -204,13 +204,16 @@ functionality.</string>
|
|||||||
|
|
||||||
<string name="there_is_no_users_in_system">There is no users in system</string>
|
<string name="there_is_no_users_in_system">There is no users in system</string>
|
||||||
<string name="cancel">Close</string>
|
<string name="cancel">Close</string>
|
||||||
<string name="userRoom">Pokój</string>
|
<string name="userRoom"><b>Pokój</b></string>
|
||||||
<string name="userEmail">Email</string>
|
<string name="userEmail"><b>Email</b></string>
|
||||||
<string name="userNote">Notatka</string>
|
<string name="userNote"><b>Notatka</b></string>
|
||||||
<string name="userDutyHoursHeader">Dyżury</string>
|
<string name="userDutyHoursHeader"><b>Dyżury</b></string>
|
||||||
<string name="dutyHours">Dyżury</string>
|
<string name="dutyHours"> <b>Dyżury</b></string>
|
||||||
<string name="error_invalid_login_name">Invalid format login. Use s11111 format</string>
|
<string name="error_invalid_login_name">Invalid format login. Use s11111 format</string>
|
||||||
<string name="userDepartment">Zakład</string>
|
<string name="userDepartment">Zakład</string>
|
||||||
<string name="loading">Loading ...</string>
|
<string name="loading">Loading ...</string>
|
||||||
|
<string name="logo_find_my_tutor">Logo find my tutor</string>
|
||||||
|
<string name="prompt_login">Login (sXXXXXX)</string>
|
||||||
|
<string name="action_log_in">Log in </string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
Loading…
Reference in New Issue
Block a user