added timepicker, email validation, new UI

This commit is contained in:
marcin.jedynski 2019-01-06 20:56:01 +01:00
parent e9f71d5790
commit 489901dca1
12 changed files with 548 additions and 215 deletions

View File

@ -38,11 +38,11 @@
</intent-filter> </intent-filter>
</activity> </activity>
<activity <activity
android:windowSoftInputMode="adjustPan"
android:name=".activity.MapActivity" android:name=".activity.MapActivity"
android:configChanges="keyboardHidden|orientation|screenSize" android:configChanges="keyboardHidden|orientation|screenSize"
android:launchMode="singleTop" android:launchMode="singleTop"
android:screenOrientation="portrait" /> android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan" />
<activity <activity
android:name=".activity.LoginActivity" android:name=".activity.LoginActivity"
android:configChanges="keyboardHidden|orientation|screenSize" android:configChanges="keyboardHidden|orientation|screenSize"
@ -60,9 +60,11 @@
android:enabled="true" android:enabled="true"
android:exported="false" android:exported="false"
android:launchMode="singleTop" /> android:launchMode="singleTop" />
<activity <activity
android:name=".activity.TutorTab" android:name=".activity.TutorTab"
android:configChanges="keyboardHidden|orientation|screenSize" android:configChanges="keyboardHidden|orientation|screenSize"
android:windowSoftInputMode="stateHidden|adjustPan"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:theme="@style/AppTheme" /> android:theme="@style/AppTheme" />
<activity <activity
@ -75,6 +77,7 @@
android:configChanges="keyboardHidden|orientation|screenSize" android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:theme="@style/AppTheme" /> android:theme="@style/AppTheme" />
</application> </application>
</manifest> </manifest>

View File

@ -39,7 +39,8 @@ import io.reactivex.disposables.CompositeDisposable;
import io.reactivex.schedulers.Schedulers; import io.reactivex.schedulers.Schedulers;
import okhttp3.ResponseBody; import okhttp3.ResponseBody;
public class LoginActivity extends AppCompatActivity { public class
LoginActivity extends AppCompatActivity {
private AutoCompleteTextView mLoginNameView; private AutoCompleteTextView mLoginNameView;
private EditText mPasswordView; private EditText mPasswordView;

View File

@ -3,6 +3,7 @@ package com.uam.wmi.findmytutor.activity;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.app.AlertDialog; import android.app.AlertDialog;
import android.app.FragmentTransaction; import android.app.FragmentTransaction;
import android.app.TimePickerDialog;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.os.Bundle; import android.os.Bundle;
@ -16,6 +17,7 @@ import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.TimePicker;
import android.widget.Toast; import android.widget.Toast;
import com.annimon.stream.IntPair; import com.annimon.stream.IntPair;
@ -123,28 +125,6 @@ public class SharingFragment extends PreferenceFragment implements SharedPrefere
String[] stringnames = predefinedLocationsNames.toArray(new String[0]); String[] stringnames = predefinedLocationsNames.toArray(new String[0]);
predefinedLocationsList = new ArrayList<>(Arrays.asList(stringnames)); predefinedLocationsList = new ArrayList<>(Arrays.asList(stringnames));
if (!PrefUtils.getLocationLevel(getApplicationContext()).equals("manual")) {
preferenceCategory.removePreference(manualLocationList);
preferenceCategory.removePreference(removeManualLocation);
preferenceCategory.removePreference(manualLocationButton);
}else{
if(predefinedCoordsList.isEmpty()){
locationSharing.setEnabled(false);
locationSharing.setChecked(false);
PrefUtils.disableSharing(getApplicationContext());
((MapActivity) getActivity()).handleBackgroundTaskLifeCycle();
removeManualLocation.setEnabled(false);
manualLocationList.setEnabled(false);
manualLocationList.setSummary("");
}else{
manualLocationList.setEnabled(true);
manualLocationList.setSummary(PrefUtils.getCurrentManualLocationName(getApplicationContext()));
removeManualLocation.setEnabled(true);
locationSharing.setEnabled(true);
}
}
List<Integer> activesId = Stream.of(coords).indexed() List<Integer> activesId = Stream.of(coords).indexed()
.filter(v -> v.getSecond().getPredefinedCoordinateId().equals(currentCoordId)).map(IntPair::getFirst).toList(); .filter(v -> v.getSecond().getPredefinedCoordinateId().equals(currentCoordId)).map(IntPair::getFirst).toList();
@ -199,10 +179,31 @@ public class SharingFragment extends PreferenceFragment implements SharedPrefere
statusMapping.put(0, "available"); statusMapping.put(0, "available");
statusMapping.put(1, "consultation"); statusMapping.put(1, "consultation");
statusMapping.put(2, "busy"); statusMapping.put(2, "busy");
if (!PrefUtils.getLocationLevel(getApplicationContext()).equals("manual")) {
preferenceCategory.removePreference(manualLocationList);
preferenceCategory.removePreference(removeManualLocation);
preferenceCategory.removePreference(manualLocationButton);
}else{
if(predefinedCoordsList.isEmpty()){
locationSharing.setEnabled(false);
locationSharing.setChecked(false);
PrefUtils.disableSharing(getApplicationContext());
((MapActivity) getActivity()).handleBackgroundTaskLifeCycle();
removeManualLocation.setEnabled(false);
manualLocationList.setEnabled(false);
manualLocationList.setSummary("");
}else{
manualLocationList.setEnabled(true);
manualLocationList.setSummary(PrefUtils.getCurrentManualLocationName(getApplicationContext()));
removeManualLocation.setEnabled(true);
locationSharing.setEnabled(true);
}
}
statusList.setSummary(PrefUtils.getUserStatus(getApplicationContext())); statusList.setSummary(PrefUtils.getUserStatus(getApplicationContext()));
manualLocationList.setSummary(PrefUtils.getCurrentManualLocationName(getApplicationContext())); manualLocationList.setSummary(PrefUtils.getCurrentManualLocationName(getApplicationContext()));
/** Main sharing switch**/ /** Main sharing switch**/
locationSharing.setOnPreferenceChangeListener((buttonView, newValue) -> { locationSharing.setOnPreferenceChangeListener((buttonView, newValue) -> {
PrefUtils.storeEnableSharingLocalization(getApplicationContext(), (Boolean) newValue); PrefUtils.storeEnableSharingLocalization(getApplicationContext(), (Boolean) newValue);
@ -282,7 +283,17 @@ public class SharingFragment extends PreferenceFragment implements SharedPrefere
lp.setSummary(entries[Integer.parseInt((String) newValue)]); lp.setSummary(entries[Integer.parseInt((String) newValue)]);
return true; return true;
}); });
statusList.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference preference) {
if(statusesArray.length == 0)
{
builder.setTitle("nie ma wody na pustyni");
}
return true;
}
});
/** Custom status edittext change listener **/ /** Custom status edittext change listener **/
manualStatus.setOnPreferenceChangeListener((preference, newValue) -> { manualStatus.setOnPreferenceChangeListener((preference, newValue) -> {

View File

@ -7,6 +7,7 @@ import android.content.res.Resources;
import android.os.Bundle; import android.os.Bundle;
import android.support.v7.app.AppCompatActivity; import android.support.v7.app.AppCompatActivity;
import android.util.DisplayMetrics; import android.util.DisplayMetrics;
import android.widget.ScrollView;
import android.widget.Toast; import android.widget.Toast;
@ -30,6 +31,7 @@ public class StartupActivity extends AppCompatActivity {
finish(); finish();
} else { } else {
Intent loginIntent = new Intent(this, LoginActivity.class); Intent loginIntent = new Intent(this, LoginActivity.class);
// Intent loginIntent = new Intent(this, ScrollingActivity.class);
startActivityForResult(loginIntent, AUTHENTICATION_REQUEST_CODE); startActivityForResult(loginIntent, AUTHENTICATION_REQUEST_CODE);
} }

View File

@ -0,0 +1,46 @@
package com.uam.wmi.findmytutor.activity;
import android.app.Dialog;
import android.app.DialogFragment;
import android.app.TimePickerDialog;
import android.os.Bundle;
import android.text.format.DateFormat;
import android.widget.TextView;
import android.widget.TimePicker;
import com.uam.wmi.findmytutor.model.DutyHourViewModel;
import java.util.Calendar;
public class TimePickerFragment extends DialogFragment
implements TimePickerDialog.OnTimeSetListener {
private TextView textView;
private String field;
private DutyHourViewModel duty;
public TimePickerFragment(TextView view, DutyHourViewModel duty, String field){
this.textView = view;
this.duty=duty;
this.field=field;
}
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
// Use the current time as the default values for the picker
final Calendar c = Calendar.getInstance();
int hour = c.get(Calendar.HOUR_OF_DAY);
int minute = c.get(Calendar.MINUTE);
// Create a new instance of TimePickerDialog and return it
return new TimePickerDialog(getActivity(), this, hour, minute,
DateFormat.is24HourFormat(getActivity()));
}
public void onTimeSet(TimePicker view, int hourOfDay, int minute) {
String time = String.format("%d:%02d",hourOfDay,minute);
textView.setText(time);
if(field.equals("start")){
duty.setStart(time);
}else{
duty.setEnd(time);
}
// Do something with the time chosen by the user
}
}

View File

@ -1,14 +1,22 @@
package com.uam.wmi.findmytutor.activity; package com.uam.wmi.findmytutor.activity;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle; import android.os.Bundle;
import android.support.design.widget.TextInputEditText; import android.support.design.widget.TextInputEditText;
import android.support.design.widget.TextInputLayout; import android.support.design.widget.TextInputLayout;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity; import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView; import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.util.Log; import android.util.Log;
import android.view.Gravity;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View; import android.view.View;
import android.widget.Button; import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.PopupWindow;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
@ -28,6 +36,8 @@ import com.uam.wmi.findmytutor.utils.RestApiHelper;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import butterknife.ButterKnife; import butterknife.ButterKnife;
import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.android.schedulers.AndroidSchedulers;
@ -59,12 +69,34 @@ public class TutorTab extends AppCompatActivity {
private DutyHoursAdapter dutyHoursAdapter; private DutyHoursAdapter dutyHoursAdapter;
private RecyclerView.LayoutManager dutyHoursLayoutManager; private RecyclerView.LayoutManager dutyHoursLayoutManager;
private TutorTabViewModel newTab; private TutorTabViewModel newTab;
public boolean isEmailValid(String email)
{
String regExpn =
"^(([\\w-]+\\.)+[\\w-]+|([a-zA-Z]{1}|[\\w-]{2,}))@"
+"((([0-1]?[0-9]{1,2}|25[0-5]|2[0-4][0-9])\\.([0-1]?"
+"[0-9]{1,2}|25[0-5]|2[0-4][0-9])\\."
+"([0-1]?[0-9]{1,2}|25[0-5]|2[0-4][0-9])\\.([0-1]?"
+"[0-9]{1,2}|25[0-5]|2[0-4][0-9])){1}|"
+"([a-zA-Z]+[\\w-]+\\.)+[a-zA-Z]{2,4})$";
CharSequence inputStr = email;
Pattern pattern = Pattern.compile(regExpn,Pattern.CASE_INSENSITIVE);
Matcher matcher = pattern.matcher(inputStr);
if(matcher.matches())
return true;
else
return false;
}
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
setContentView(R.layout.content_tutor_tab); setContentView(R.layout.content_tutor_tab);
Toolbar toolbar = findViewById(R.id.toolbar);
toolbar.setTitle(getString(R.string.profile_activity_title));
setSupportActionBar(toolbar);
ButterKnife.bind(this); ButterKnife.bind(this);
userName = findViewById(R.id.userName); userName = findViewById(R.id.userName);
@ -86,7 +118,7 @@ public class TutorTab extends AppCompatActivity {
getTutorTab(); getTutorTab();
findViewById(R.id.contentTutorTabInfoImageButton).setOnClickListener(v-> InfoHelperUtils.infoPopUp(v,R.layout.info_popup_tutor_tab)); // findViewById(R.id.contentTutorTabInfoImageButton).setOnClickListener(v-> InfoHelperUtils.infoPopUp(v,R.layout.info_popup_tutor_tab));
userName.setText(String.format("%s %s", PrefUtils.getUserFirstName(getApplicationContext()), PrefUtils.getUserLastName(getApplicationContext()))); userName.setText(String.format("%s %s", PrefUtils.getUserFirstName(getApplicationContext()), PrefUtils.getUserLastName(getApplicationContext())));
@ -112,6 +144,34 @@ public class TutorTab extends AppCompatActivity {
scrapButton.setOnClickListener(view -> scrapTutorTab()); scrapButton.setOnClickListener(view -> scrapTutorTab());
} }
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu_profile, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if (item.getItemId()==R.id.action_profile_info_popup){
int layoutID = R.layout.info_popup_tutor_tab;
View popupView = getLayoutInflater().inflate(layoutID,null);
PopupWindow popupWindow = new PopupWindow(popupView,
LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
// If the PopupWindow should be focusable
popupWindow.setFocusable(true);
// If you need the PopupWindow to dismiss when when touched outside
popupWindow.setBackgroundDrawable(new ColorDrawable());
// Get the View's(the one that was clicked in the Fragment) location
View anchorView= getWindow().getDecorView().findViewById(android.R.id.content);
popupWindow.showAtLocation(anchorView,Gravity.TOP|Gravity.END, 0, 0);
}
return super.onOptionsItemSelected(item);
}
private void getTutorTab(){ private void getTutorTab(){
disposable.add( disposable.add(
tutorTabService.apiUsersTutorTabByTutorIdGet(PrefUtils.getUserId(getApplicationContext())) tutorTabService.apiUsersTutorTabByTutorIdGet(PrefUtils.getUserId(getApplicationContext()))
@ -123,7 +183,7 @@ public class TutorTab extends AppCompatActivity {
dutyHourList = tutorTabViewModel.getDutyHours(); dutyHourList = tutorTabViewModel.getDutyHours();
if(dutyHourList != null){ if(dutyHourList != null){
dutyHoursAdapter = new DutyHoursAdapter(getApplicationContext(),dutyHourList); dutyHoursAdapter = new DutyHoursAdapter(getApplicationContext(),dutyHourList, getFragmentManager());
dutyHoursRecycller.setAdapter(dutyHoursAdapter); dutyHoursRecycller.setAdapter(dutyHoursAdapter);
addDutyButton.setOnClickListener(v -> addEmptyDuty(dutyHoursAdapter)); addDutyButton.setOnClickListener(v -> addEmptyDuty(dutyHoursAdapter));
} }
@ -144,7 +204,7 @@ public class TutorTab extends AppCompatActivity {
if( code == 404){ if( code == 404){
ifTutorTabExists = false; ifTutorTabExists = false;
dutyHoursAdapter = new DutyHoursAdapter(getApplicationContext(),new ArrayList<DutyHourViewModel>()); dutyHoursAdapter = new DutyHoursAdapter(getApplicationContext(),new ArrayList<DutyHourViewModel>(), getFragmentManager());
dutyHoursRecycller.setAdapter(dutyHoursAdapter); dutyHoursRecycller.setAdapter(dutyHoursAdapter);
addDutyButton.setOnClickListener(v -> addEmptyDuty(dutyHoursAdapter)); addDutyButton.setOnClickListener(v -> addEmptyDuty(dutyHoursAdapter));
} }
@ -161,6 +221,7 @@ public class TutorTab extends AppCompatActivity {
private void setUpSaveListener(Button button) { private void setUpSaveListener(Button button) {
button.setOnClickListener(view -> { button.setOnClickListener(view -> {
if( isEmailValid(userEmail.getText().toString())){
newTab = new TutorTabViewModel(PrefUtils.getUserId(getApplicationContext()), newTab = new TutorTabViewModel(PrefUtils.getUserId(getApplicationContext()),
userRoom.getText().toString(), userRoom.getText().toString(),
userEmail.getText().toString(), userEmail.getText().toString(),
@ -172,6 +233,10 @@ public class TutorTab extends AppCompatActivity {
postUserTab(newTab); postUserTab(newTab);
ifTutorTabExists=true; ifTutorTabExists=true;
} }
}else{
userEmail.setError(getString(R.string.error_invalid_email));
}
}); });
} }

View File

@ -1,6 +1,9 @@
package com.uam.wmi.findmytutor.adapters; package com.uam.wmi.findmytutor.adapters;
import android.app.DialogFragment;
import android.app.FragmentManager;
import android.content.Context; import android.content.Context;
import android.os.Bundle;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView; import android.support.v7.widget.RecyclerView;
import android.text.Editable; import android.text.Editable;
@ -14,6 +17,7 @@ import android.widget.TextView;
import com.annimon.stream.Collectors; import com.annimon.stream.Collectors;
import com.annimon.stream.Stream; import com.annimon.stream.Stream;
import com.uam.wmi.findmytutor.R; import com.uam.wmi.findmytutor.R;
import com.uam.wmi.findmytutor.activity.TimePickerFragment;
import com.uam.wmi.findmytutor.model.DutyHourViewModel; import com.uam.wmi.findmytutor.model.DutyHourViewModel;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -24,10 +28,12 @@ import butterknife.ButterKnife;
public class DutyHoursAdapter extends RecyclerView.Adapter<DutyHoursAdapter.MyViewHolder> { public class DutyHoursAdapter extends RecyclerView.Adapter<DutyHoursAdapter.MyViewHolder> {
private Context context; private Context context;
private List<DutyHourViewModel> hours; private List<DutyHourViewModel> hours;
private FragmentManager fragmentManager;
public DutyHoursAdapter(Context context, List<DutyHourViewModel> hours) { public DutyHoursAdapter(Context context, List<DutyHourViewModel> hours, FragmentManager fragmentManager) {
this.context = context; this.context = context;
this.hours = new ArrayList<>(hours); this.hours = new ArrayList<DutyHourViewModel>(hours);
this.fragmentManager = fragmentManager;
} }
@ -75,7 +81,7 @@ public class DutyHoursAdapter extends RecyclerView.Adapter<DutyHoursAdapter.MyV
} }
}); });
holder.dutyStart.setText(duty.getStart()); holder.dutyStart.setText(duty.getStart());
holder.dutyStart.addTextChangedListener(new TextWatcher() { /* holder.dutyStart.addTextChangedListener(new TextWatcher() {
@Override @Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) { public void beforeTextChanged(CharSequence s, int start, int count, int after) {
@ -90,9 +96,23 @@ public class DutyHoursAdapter extends RecyclerView.Adapter<DutyHoursAdapter.MyV
public void afterTextChanged(Editable s) { public void afterTextChanged(Editable s) {
duty.setStart(holder.dutyStart.getText().toString()); duty.setStart(holder.dutyStart.getText().toString());
} }
});*/
holder.dutyStart.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
DialogFragment picker = new TimePickerFragment(holder.dutyStart,duty,"start");
picker.show(fragmentManager,"time picker");
}
}); });
holder.dutyStop.setText(duty.getEnd()); holder.dutyStop.setText(duty.getEnd());
holder.dutyStop.addTextChangedListener(new TextWatcher() { holder.dutyStop.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
DialogFragment picker = new TimePickerFragment(holder.dutyStop,duty,"stop");
picker.show(fragmentManager,"time picker");
}
});
/* holder.dutyStop.addTextChangedListener(new TextWatcher() {
@Override @Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) { public void beforeTextChanged(CharSequence s, int start, int count, int after) {
@ -107,7 +127,7 @@ public class DutyHoursAdapter extends RecyclerView.Adapter<DutyHoursAdapter.MyV
public void afterTextChanged(Editable s) { public void afterTextChanged(Editable s) {
duty.setEnd(holder.dutyStop.getText().toString()); duty.setEnd(holder.dutyStop.getText().toString());
} }
}); });*/
holder.deleteRow.setOnClickListener(new View.OnClickListener() { holder.deleteRow.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {

View File

@ -1,186 +1,66 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:mapbox="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:id="@+id/activity_whitelist_container"
tools:context=".activity.WhiteList">
<android.support.design.widget.AppBarLayout
android:id="@+id/app_bar"
android:layout_width="match_parent"
android:layout_height="132dp"
android:fitsSystemWindows="true"
android:theme="@style/AppTheme.AppBarOverlay">
<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/toolbar_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
app:contentScrim="?attr/colorPrimary"
app:expandedTitleGravity="top|right"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
app:toolbarId="@+id/toolbar">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="20dp"
android:gravity="left|bottom"
android:orientation="vertical" android:orientation="vertical"
android:fontFamily="@font/lato_regular" android:padding="10dp"
android:paddingLeft="@dimen/activity_margin" app:layout_collapseMode="parallax">
android:paddingRight="@dimen/activity_margin"
android:paddingTop="@dimen/activity_margin">
<LinearLayout android:layout_width="fill_parent"
android:id="@+id/linearLayout1" android:layout_height="wrap_content">
<Button
android:id="@+id/scrapTutorTab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1.0"
android:text="@string/scrap_tutor_tab" />
<ImageButton
android:id="@+id/contentTutorTabInfoImageButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
mapbox:srcCompat="@drawable/outline_info_24"/>
</LinearLayout>
<TextView <TextView
android:id="@+id/userName" android:id="@+id/userName"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dimen_10" android:layout_alignParentRight="true"
android:fontFamily="sans-serif-medium" android:text="User Name"
android:lineSpacingExtra="8sp" android:textSize="22sp" />
android:textColor="@color/mapboxRedDark"
android:textSize="@dimen/lbl_new_note_title"
android:textStyle="normal" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
>
<TextView
android:id="@+id/personalInfoTitle"
android:textSize="16sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="0dp"
android:paddingBottom="0dp"
android:textColor="@color/mapboxRedDark"
android:text="@string/personalInfoTitle"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<android.support.design.widget.TextInputLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.7">
<android.support.design.widget.TextInputEditText
android:id="@+id/userDepartment"
android:maxLines="1"
android:inputType="text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/hint_department"
android:lineSpacingExtra="8sp"
android:paddingTop="5dp"
android:textColor="@color/note_list_text" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.3">
<android.support.design.widget.TextInputEditText
android:id="@+id/userRoom"
android:maxLines="1"
android:inputType="text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/hint_room"
android:lineSpacingExtra="8sp"
android:paddingTop="5dp"
android:textColor="@color/note_list_text" />
</android.support.design.widget.TextInputLayout>
</LinearLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.design.widget.TextInputEditText
android:id="@+id/userEmail"
android:maxLines="1"
android:inputType="text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:lineSpacingExtra="8sp"
android:paddingTop="5dp"
android:textColor="@color/note_list_text"
android:hint="@string/hint_email"
/>
</android.support.design.widget.TextInputLayout>
</LinearLayout> </LinearLayout>
<android.support.v7.widget.Toolbar
<TextView android:id="@+id/toolbar"
android:id="@+id/dutyTitle"
android:textSize="16sp"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="?attr/actionBarSize"
android:paddingTop="0dp" app:layout_collapseMode="pin"
android:paddingBottom="0dp" app:popupTheme="@style/AppTheme.PopupOverlay" />
android:textColor="@color/mapboxRedDark"
android:text="@string/dutyTitle"/>
<android.support.v7.widget.RecyclerView </android.support.design.widget.CollapsingToolbarLayout>
android:id="@+id/dutyHourView"
android:layout_width="match_parent"
android:layout_height="100dp"
android:scrollbars="vertical" />
<LinearLayout android:layout_width="fill_parent" </android.support.design.widget.AppBarLayout>
android:id="@+id/linearLayout1" android:layout_height="wrap_content">
<include layout="@layout/content_tutor_tab_layout" />
<Button
android:id="@+id/addDuty"
android:layout_width="wrap_content"
android:layout_weight="1.0"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:text="@string/addDuty" />
</LinearLayout>
<TextView
android:textSize="16sp"
android:id="@+id/userNoteTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="0dp"
android:paddingBottom="0dp"
android:textColor="@color/mapboxRedDark"
android:text="@string/userNoteTitle"/>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.design.widget.TextInputEditText
android:id="@+id/userNote"
android:layout_width="match_parent"
android:layout_height="150dp"
android:lineSpacingExtra="8sp"
android:paddingTop="5dp"
android:textColor="@color/note_list_text"
android:hint="@string/tutorTabHint"
android:inputType="textMultiLine"
android:maxLength="1000"
android:maxLines="7"
android:requiresFadingEdge="vertical"
android:scrollbars="vertical"/>
</android.support.design.widget.TextInputLayout>
<Button <!-- A RecyclerView with some commonly used attributes -->
android:id="@+id/saveButon"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/saveButton" />
</LinearLayout>
</ScrollView>
</android.support.design.widget.CoordinatorLayout>

View File

@ -0,0 +1,199 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context=".activity.TutorTab"
tools:showIn="@layout/content_tutor_tab2">
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fontFamily="@font/lato_regular"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context=".activity.TutorTab">
<android.support.design.widget.TextInputLayout
android:id="@+id/userDepartmentLayout"
android:layout_width="189dp"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_marginStart="25dp"
android:layout_marginTop="95dp"
android:layout_marginEnd="30dp"
android:layout_toEndOf="@+id/userRoomLayout">
<android.support.design.widget.TextInputEditText
android:id="@+id/userDepartment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/userDepartmentLayout"
android:hint="@string/hint_department"
android:inputType="text"
android:lineSpacingExtra="8sp"
android:maxLines="1"
android:paddingTop="5dp"
android:textColor="@color/note_list_text" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="@+id/userRoomLayout"
android:layout_width="115dp"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginStart="30dp"
android:layout_marginTop="95dp">
<android.support.design.widget.TextInputEditText
android:id="@+id/userRoom"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/userRoomLayout"
android:layout_alignTop="@+id/userRoomLayout"
android:hint="@string/hint_room"
android:inputType="text"
android:lineSpacingExtra="8sp"
android:maxLines="1"
android:paddingTop="5dp"
android:textColor="@color/note_list_text" />
</android.support.design.widget.TextInputLayout>
<TextView
android:id="@+id/personalInfoTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignStart="@+id/userRoomLayout"
android:layout_alignParentTop="true"
android:layout_marginTop="10dp"
android:text="@string/personalInfoTitle"
android:textColor="@color/mapboxRedDark"
android:textSize="18sp" />
<android.support.design.widget.TextInputLayout
android:id="@+id/userEmailLayout"
android:layout_width="326dp"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_marginStart="30dp"
android:layout_marginTop="50dp"
android:layout_marginEnd="30dp">
<android.support.design.widget.TextInputEditText
android:id="@+id/userEmail"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignStart="@+id/userEmailLayout"
android:hint="@string/hint_email"
android:inputType="textEmailAddress"
android:lineSpacingExtra="8sp"
android:maxLines="1"
android:paddingTop="5dp"
android:textColor="@color/note_list_text" />
</android.support.design.widget.TextInputLayout>
<TextView
android:id="@+id/dutyTitle"
android:layout_width="wrap_content"
android:layout_height="60dp"
android:layout_alignStart="@+id/userRoomLayout"
android:layout_alignParentTop="true"
android:layout_centerVertical="false"
android:layout_marginStart="-1dp"
android:layout_marginTop="141dp"
android:gravity="center"
android:text="@string/dutyTitle"
android:textColor="@color/mapboxRedDark"
android:textSize="18sp" />
<android.support.v7.widget.RecyclerView
android:id="@+id/dutyHourView"
android:layout_width="300dp"
android:layout_height="100dp"
android:layout_below="@+id/dutyTitle"
android:layout_alignParentStart="true"
android:layout_marginStart="30dp"
android:layout_marginEnd="30dp"
android:scrollbars="vertical" />
<TextView
android:id="@+id/userNoteTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/dutyHourView"
android:layout_alignStart="@+id/userRoomLayout"
android:text="@string/userNoteTitle"
android:textColor="@color/mapboxRedDark"
android:textSize="18sp" />
<Button
android:id="@+id/addDuty"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/dutyTitle"
android:layout_marginStart="-1dp"
android:layout_marginBottom="0dp"
android:layout_toEndOf="@+id/personalInfoTitle"
android:text="@string/addDuty" />
<android.support.design.widget.TextInputLayout
android:id="@+id/userNoteLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/userNoteTitle"
android:layout_alignParentStart="true"
android:layout_marginStart="30dp"
android:layout_marginTop="0dp"
app:counterEnabled="true"
app:counterMaxLength="1000">
<android.support.design.widget.TextInputEditText
android:id="@+id/userNote"
android:layout_width="300dp"
android:layout_height="100dp"
android:layout_alignStart="@+id/userNoteLayout"
android:hint="@string/tutorTabHint"
android:inputType="textMultiLine"
android:lineSpacingExtra="8sp"
android:maxLength="1000"
android:maxLines="7"
android:paddingTop="5dp"
android:requiresFadingEdge="vertical"
android:scrollbars="vertical"
android:textColor="@color/note_list_text" />
</android.support.design.widget.TextInputLayout>
<Button
android:id="@+id/scrapTutorTab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_marginTop="0dp"
android:layout_marginEnd="30dp"
android:text="@string/scrap_tutor_tab" />
<Button
android:id="@+id/saveButon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/userNoteLayout"
android:layout_alignEnd="@+id/dutyHourView"
android:text="@string/saveButton" />
</RelativeLayout>
</android.support.v4.widget.NestedScrollView>

View File

@ -33,7 +33,9 @@
android:inputType="text" android:inputType="text"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
tools:text="@tools:sample/date/hhmm" /> tools:text="@tools:sample/date/hhmm"
android:focusableInTouchMode="false"
/>
</android.support.design.widget.TextInputLayout> </android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout <android.support.design.widget.TextInputLayout
@ -48,7 +50,9 @@
android:inputType="text" android:inputType="text"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
tools:text="@tools:sample/date/hhmm" /> tools:text="@tools:sample/date/hhmm"
android:focusableInTouchMode="false"
/>
</android.support.design.widget.TextInputLayout> </android.support.design.widget.TextInputLayout>
<ImageButton <ImageButton

View File

@ -0,0 +1,11 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
tools:context="com.uam.wmi.findmytutor.activity.TutorTab">
<item
android:id="@+id/action_profile_info_popup"
android:orderInCategory="100"
android:title="Popup info icon"
android:icon="@drawable/outline_info_24"
app:showAsAction="ifRoom" />
</menu>

View File

@ -126,7 +126,6 @@
<string name="title_activity_settings2">Settings</string> <string name="title_activity_settings2">Settings</string>
<string name="modal_location_send">SEND</string> <string name="modal_location_send">SEND</string>
<string name="modal_location_hint">Please name choosen location.</string> <string name="modal_location_hint">Please name choosen location.</string>
modal_feedback_send
<!-- Strings related to Settings --> <!-- Strings related to Settings -->
<!-- Example General settings --> <!-- Example General settings -->
@ -310,6 +309,7 @@
<string name="pref_title_acra" translatable="false">App issues reporting</string> <string name="pref_title_acra" translatable="false">App issues reporting</string>
<!--(ENG) Profile Activity strings--> <!--(ENG) Profile Activity strings-->
<string name="profile_activity_title">Profile</string>
<string name="hint_duty_day">Day</string> <string name="hint_duty_day">Day</string>
<string name="hint_duty_start">Start</string> <string name="hint_duty_start">Start</string>
<string name="hint_duty_end">End</string> <string name="hint_duty_end">End</string>
@ -331,7 +331,7 @@
<string name="activity_title_home">Map</string> <string name="activity_title_home">Map</string>
<string name="on">ON</string> <string name="on">ON</string>
<string name="off">OFF</string> <string name="off">OFF</string>
<string name="scrap_tutor_tab">Scrap!</string> <string name="scrap_tutor_tab">Scrap from WMI</string>
<string name="scrap_tutor_msg">Data updated!</string> <string name="scrap_tutor_msg">Data updated!</string>
<!--(ENG) Checkbox online users list --> <!--(ENG) Checkbox online users list -->
@ -351,5 +351,96 @@
<!--(ENG) Blacked/Whited users --> <!--(ENG) Blacked/Whited users -->
<string name="add_user_to_list">User has been added!</string> <string name="add_user_to_list">User has been added!</string>
<string name="user_removed">User removed!</string> <string name="user_removed">User removed!</string>
<string name="title_activity_scrolling">ScrollingActivity</string>
<string name="large_text">
"Material is the metaphor.\n\n"
"A material metaphor is the unifying theory of a rationalized space and a system of motion."
"The material is grounded in tactile reality, inspired by the study of paper and ink, yet "
"technologically advanced and open to imagination and magic.\n"
"Surfaces and edges of the material provide visual cues that are grounded in reality. The "
"use of familiar tactile attributes helps users quickly understand affordances. Yet the "
"flexibility of the material creates new affordances that supercede those in the physical "
"world, without breaking the rules of physics.\n"
"The fundamentals of light, surface, and movement are key to conveying how objects move, "
"interact, and exist in space and in relation to each other. Realistic lighting shows "
"seams, divides space, and indicates moving parts.\n\n"
"Bold, graphic, intentional.\n\n"
"The foundational elements of print based design typography, grids, space, scale, color, "
"and use of imagery guide visual treatments. These elements do far more than please the "
"eye. They create hierarchy, meaning, and focus. Deliberate color choices, edge to edge "
"imagery, large scale typography, and intentional white space create a bold and graphic "
"interface that immerse the user in the experience.\n"
"An emphasis on user actions makes core functionality immediately apparent and provides "
"waypoints for the user.\n\n"
"Motion provides meaning.\n\n"
"Motion respects and reinforces the user as the prime mover. Primary user actions are "
"inflection points that initiate motion, transforming the whole design.\n"
"All action takes place in a single environment. Objects are presented to the user without "
"breaking the continuity of experience even as they transform and reorganize.\n"
"Motion is meaningful and appropriate, serving to focus attention and maintain continuity. "
"Feedback is subtle yet clear. Transitions are efficient yet coherent.\n\n"
"3D world.\n\n"
"The material environment is a 3D space, which means all objects have x, y, and z "
"dimensions. The z-axis is perpendicularly aligned to the plane of the display, with the "
"positive z-axis extending towards the viewer. Every sheet of material occupies a single "
"position along the z-axis and has a standard 1dp thickness.\n"
"On the web, the z-axis is used for layering and not for perspective. The 3D world is "
"emulated by manipulating the y-axis.\n\n"
"Light and shadow.\n\n"
"Within the material environment, virtual lights illuminate the scene. Key lights create "
"directional shadows, while ambient light creates soft shadows from all angles.\n"
"Shadows in the material environment are cast by these two light sources. In Android "
"development, shadows occur when light sources are blocked by sheets of material at "
"various positions along the z-axis. On the web, shadows are depicted by manipulating the "
"y-axis only. The following example shows the card with a height of 6dp.\n\n"
"Resting elevation.\n\n"
"All material objects, regardless of size, have a resting elevation, or default elevation "
"that does not change. If an object changes elevation, it should return to its resting "
"elevation as soon as possible.\n\n"
"Component elevations.\n\n"
"The resting elevation for a component type is consistent across apps (e.g., FAB elevation "
"does not vary from 6dp in one app to 16dp in another app).\n"
"Components may have different resting elevations across platforms, depending on the depth "
"of the environment (e.g., TV has a greater depth than mobile or desktop).\n\n"
"Responsive elevation and dynamic elevation offsets.\n\n"
"Some component types have responsive elevation, meaning they change elevation in response "
"to user input (e.g., normal, focused, and pressed) or system events. These elevation "
"changes are consistently implemented using dynamic elevation offsets.\n"
"Dynamic elevation offsets are the goal elevation that a component moves towards, relative "
"to the components resting state. They ensure that elevation changes are consistent "
"across actions and component types. For example, all components that lift on press have "
"the same elevation change relative to their resting elevation.\n"
"Once the input event is completed or cancelled, the component will return to its resting "
"elevation.\n\n"
"Avoiding elevation interference.\n\n"
"Components with responsive elevations may encounter other components as they move between "
"their resting elevations and dynamic elevation offsets. Because material cannot pass "
"through other material, components avoid interfering with one another any number of ways, "
"whether on a per component basis or using the entire app layout.\n"
"On a component level, components can move or be removed before they cause interference. "
"For example, a floating action button (FAB) can disappear or move off screen before a "
"user picks up a card, or it can move if a snackbar appears.\n"
"On the layout level, design your app layout to minimize opportunities for interference. "
"For example, position the FAB to one side of stream of a cards so the FAB wont interfere "
"when a user tries to pick up one of cards.\n\n"
</string>
</resources> </resources>