Merge branch 'fix-tutor-tab-develop' of s416084/find-my-tutor-android into develop
This commit is contained in:
commit
cae8a22c25
@ -1,17 +1,25 @@
|
||||
package com.uam.wmi.findmytutor.activity;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.support.design.widget.TextInputEditText;
|
||||
import android.support.design.widget.TextInputLayout;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.support.v7.widget.LinearLayoutManager;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.Adapter;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
import com.jakewharton.retrofit2.adapter.rxjava2.HttpException;
|
||||
import com.uam.wmi.findmytutor.R;
|
||||
import com.uam.wmi.findmytutor.adapters.DutyHoursAdapter;
|
||||
import com.uam.wmi.findmytutor.model.DutyHour;
|
||||
import com.uam.wmi.findmytutor.model.DutyHourViewModel;
|
||||
import com.uam.wmi.findmytutor.model.TutorTabViewModel;
|
||||
import com.uam.wmi.findmytutor.model.User;
|
||||
@ -22,6 +30,7 @@ import com.uam.wmi.findmytutor.utils.InfoHelperUtils;
|
||||
import com.uam.wmi.findmytutor.utils.PrefUtils;
|
||||
import com.uam.wmi.findmytutor.utils.RestApiHelper;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@ -38,32 +47,41 @@ public class TutorTab extends AppCompatActivity {
|
||||
private CompositeDisposable disposable = new CompositeDisposable();
|
||||
private TextView userName;
|
||||
private TextView userDutyHours;
|
||||
private EditText userNote;
|
||||
private TextInputEditText userNote;
|
||||
private TextView userRoom;
|
||||
private TextView userEmail;
|
||||
private TextView department;
|
||||
private Button addDutyButton;
|
||||
private Button saveButon;
|
||||
private Boolean ifTutorTabExists = true;
|
||||
private List<DutyHourViewModel> dutyHourList;
|
||||
private RecyclerView dutyHoursRecycller;
|
||||
private DutyHoursAdapter dutyHoursAdapter;
|
||||
private RecyclerView.LayoutManager dutyHoursLayoutManager;
|
||||
private TutorTabViewModel newTab;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.content_tutor_tab);
|
||||
|
||||
userName = findViewById(R.id.userName);
|
||||
userNote = (TextInputEditText) findViewById(R.id.userNote);
|
||||
userRoom = findViewById(R.id.userRoom);
|
||||
userEmail = findViewById(R.id.userEmail);
|
||||
department = findViewById(R.id.userDepartment);
|
||||
saveButon = findViewById(R.id.saveButon);
|
||||
addDutyButton = findViewById(R.id.addDuty);
|
||||
dutyHoursRecycller = (RecyclerView) findViewById(R.id.dutyHourView);
|
||||
dutyHoursLayoutManager = new LinearLayoutManager(this);
|
||||
dutyHoursRecycller.setLayoutManager(dutyHoursLayoutManager);
|
||||
|
||||
|
||||
tutorTabService = ApiClient.getClient(getApplicationContext())
|
||||
.create(TutorTabApi.class);
|
||||
userService = ApiClient.getClient(getApplicationContext())
|
||||
.create(UserService.class);
|
||||
setContentView(R.layout.content_tutor_tab);
|
||||
TextView userName = findViewById(R.id.userName);
|
||||
TextView userDutyHours = findViewById(R.id.userDutyHours);
|
||||
EditText userNote = findViewById(R.id.userNote);
|
||||
TextView userRoom = findViewById(R.id.userRoom);
|
||||
TextView userEmail = findViewById(R.id.userEmail);
|
||||
TextView department = findViewById(R.id.userDepartment);
|
||||
Button saveButon = findViewById(R.id.saveButon);
|
||||
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())));
|
||||
disposable.add(
|
||||
tutorTabService.apiUsersTutorTabByTutorIdGet(PrefUtils.getUserId(getApplicationContext()))
|
||||
.subscribeOn(Schedulers.io())
|
||||
@ -72,26 +90,52 @@ public class TutorTab extends AppCompatActivity {
|
||||
@Override
|
||||
public void onSuccess(TutorTabViewModel tutorTabViewModel) {
|
||||
|
||||
List<String> dutyHoursList = Stream.of(tutorTabViewModel.getDutyHours())
|
||||
.map(DutyHourViewModel::getSummary).toList();
|
||||
|
||||
userRoom.setText(String.format("%s: %s", getString(R.string.userRoom), tutorTabViewModel.getRoom()));
|
||||
userEmail.setText(String.format("%s: %s", getString(R.string.userEmail), tutorTabViewModel.getEmailTutorTab()));
|
||||
dutyHourList = tutorTabViewModel.getDutyHours();
|
||||
if(dutyHourList == null){
|
||||
}else{
|
||||
dutyHoursAdapter = new DutyHoursAdapter(getApplicationContext(),dutyHourList);
|
||||
dutyHoursRecycller.setAdapter(dutyHoursAdapter);
|
||||
addDutyButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
addEmptyDuty(dutyHoursAdapter);
|
||||
}
|
||||
});
|
||||
}
|
||||
userRoom.setText(String.format("%s", tutorTabViewModel.getRoom()));
|
||||
userEmail.setText(String.format("%s", tutorTabViewModel.getEmailTutorTab()));
|
||||
if (!tutorTabViewModel.getNote().equals("")) {
|
||||
userNote.setText(String.format("%s", tutorTabViewModel.getNote()));
|
||||
}
|
||||
userDutyHours.setText(String.format("%s: %s", getString(R.string.userDutyHoursHeader), Arrays.toString(dutyHoursList.toArray())));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
int code = ((HttpException) e).response().code();
|
||||
if( code == 404){
|
||||
ifTutorTabExists = false;
|
||||
dutyHoursAdapter = new DutyHoursAdapter(getApplicationContext(),new ArrayList<DutyHourViewModel>());
|
||||
dutyHoursRecycller.setAdapter(dutyHoursAdapter);
|
||||
addDutyButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
addEmptyDuty(dutyHoursAdapter);
|
||||
}
|
||||
});
|
||||
}
|
||||
showError(e);
|
||||
}
|
||||
}));
|
||||
|
||||
|
||||
|
||||
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())));
|
||||
|
||||
disposable.add(
|
||||
|
||||
userService.getUserById(PrefUtils.getUserId(getApplicationContext()))
|
||||
userService.getUserById(PrefUtils.getUserId(getApplicationContext()))
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribeWith(new DisposableSingleObserver<User>() {
|
||||
@ -104,31 +148,56 @@ public class TutorTab extends AppCompatActivity {
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
|
||||
showError(e);
|
||||
}
|
||||
}));
|
||||
setUpSaveListener(saveButon, userNote);
|
||||
setUpSaveListener(saveButon);
|
||||
}
|
||||
private void addEmptyDuty(DutyHoursAdapter adapter){
|
||||
adapter.addDuty(new DutyHourViewModel());
|
||||
adapter.notifyItemInserted(adapter.getItemCount());
|
||||
dutyHoursRecycller.scrollToPosition(adapter.getItemCount()-1);
|
||||
}
|
||||
|
||||
private void setUpSaveListener(Button button, EditText note) {
|
||||
private void setUpSaveListener(Button button) {
|
||||
button.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
newTab = new TutorTabViewModel(PrefUtils.getUserId(getApplicationContext()),note.getText().toString());
|
||||
putUserTab(newTab);
|
||||
newTab = new TutorTabViewModel(PrefUtils.getUserId(getApplicationContext()),
|
||||
userRoom.getText().toString(),
|
||||
userEmail.getText().toString(),
|
||||
userNote.getText().toString(),
|
||||
dutyHoursAdapter.getDutyList());
|
||||
if(ifTutorTabExists){
|
||||
putUserTab(newTab);
|
||||
}else{
|
||||
postUserTab(newTab);
|
||||
ifTutorTabExists=true;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private void putUserTab(TutorTabViewModel tutorTabViewModel) {
|
||||
disposable.add(tutorTabService.apiUsersTutorTabByTutorIdPut(PrefUtils.getUserId(getApplicationContext()), tutorTabViewModel)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(this::handleResponse, this::handleError));
|
||||
.subscribe(this::handleResponsePut, this::handleError));
|
||||
}
|
||||
private void postUserTab(TutorTabViewModel tutorTabViewModel) {
|
||||
disposable.add(tutorTabService.apiUsersTutorTabByTutorIdPost(PrefUtils.getUserId(getApplicationContext()), tutorTabViewModel)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(this::handleResponsePost, this::handleError));
|
||||
}
|
||||
|
||||
private void handleResponse(TutorTabViewModel tutorTabViewModel) {
|
||||
Toast.makeText(getApplicationContext(), getApplicationContext().getString(R.string.modal_feedback_thankyou), Toast.LENGTH_SHORT).show();
|
||||
private void handleResponsePut(Response<Void> resp) {
|
||||
Toast.makeText(getApplicationContext(), getApplicationContext().getString(R.string.updateToast), Toast.LENGTH_SHORT).show();
|
||||
|
||||
}
|
||||
private void handleResponsePost(TutorTabViewModel tutorTabViewModel ) {
|
||||
Toast.makeText(getApplicationContext(), getApplicationContext().getString(R.string.updateToast), Toast.LENGTH_SHORT).show();
|
||||
|
||||
}
|
||||
|
||||
@ -155,9 +224,6 @@ public class TutorTab extends AppCompatActivity {
|
||||
} else {
|
||||
message = "Network Error!";
|
||||
}
|
||||
|
||||
// Snackbar.make(coordinatorLayout, message, Snackbar.LENGTH_LONG)
|
||||
// .show();
|
||||
Toast.makeText(getApplicationContext(), message, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,163 @@
|
||||
package com.uam.wmi.findmytutor.adapters;
|
||||
|
||||
import android.content.Context;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.annimon.stream.Collectors;
|
||||
import com.annimon.stream.Stream;
|
||||
import com.uam.wmi.findmytutor.R;
|
||||
import com.uam.wmi.findmytutor.model.DutyHourViewModel;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
|
||||
|
||||
public class DutyHoursAdapter extends RecyclerView.Adapter<DutyHoursAdapter.MyViewHolder> {
|
||||
private Context context;
|
||||
private List<DutyHourViewModel> hours;
|
||||
|
||||
public DutyHoursAdapter(Context context, List<DutyHourViewModel> hours) {
|
||||
this.context = context;
|
||||
this.hours = new ArrayList<DutyHourViewModel>(hours);
|
||||
}
|
||||
|
||||
|
||||
public List<DutyHourViewModel> getDutyList(){
|
||||
ArrayList<DutyHourViewModel> notEmpty = Stream.of(hours).filter(DutyHourViewModel::isValid).collect(Collectors.toCollection(ArrayList::new));
|
||||
return notEmpty;
|
||||
}
|
||||
public void addDuty(DutyHourViewModel duty){
|
||||
hours.add(duty);
|
||||
}
|
||||
private void removeDuty(int pos){
|
||||
hours.remove(pos);
|
||||
this.notifyItemRemoved(pos);
|
||||
Log.d("DutyIndex af rm size",Integer.toString(getItemCount()));
|
||||
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public MyViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View itemView = LayoutInflater.from(parent.getContext())
|
||||
.inflate(R.layout.duty_hour_row, parent, false);
|
||||
|
||||
return new MyViewHolder(itemView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull MyViewHolder holder, int position) {
|
||||
DutyHourViewModel duty = hours.get(position);
|
||||
holder.dutyDay.setText(duty.getDay());
|
||||
holder.dutyDay.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
duty.setDay(holder.dutyDay.getText().toString());
|
||||
}
|
||||
});
|
||||
holder.dutyStart.setText(duty.getStart());
|
||||
holder.dutyStart.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
duty.setStart(holder.dutyStart.getText().toString());
|
||||
}
|
||||
});
|
||||
holder.dutyStop.setText(duty.getEnd());
|
||||
holder.dutyStop.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
duty.setEnd(holder.dutyStop.getText().toString());
|
||||
}
|
||||
});
|
||||
holder.deleteRow.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
try{
|
||||
Log.d("DutyIndex bf rm size",Integer.toString(getItemCount()));
|
||||
Log.d("DutyIndex bf rm pos",Integer.toString(holder.getLayoutPosition()));
|
||||
removeDuty(holder.getLayoutPosition());
|
||||
Log.d("DutyIndex af rm pos",Integer.toString(holder.getLayoutPosition()));
|
||||
|
||||
|
||||
}catch(Error e){
|
||||
Log.e("DutyIndex error",e.getMessage());
|
||||
Log.e("DutyIndex size",Integer.toString(getItemCount()));
|
||||
Log.e("DutyIndex pos",Integer.toString(holder.getAdapterPosition()));
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return hours.size();
|
||||
}
|
||||
|
||||
class MyViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
@BindView(R.id.duty_day_value)
|
||||
TextView dutyDay;
|
||||
|
||||
@BindView(R.id.duty_start_value)
|
||||
TextView dutyStart;
|
||||
|
||||
@BindView(R.id.duty_stop_value)
|
||||
TextView dutyStop;
|
||||
|
||||
@BindView(R.id.deleteRow)
|
||||
ImageButton deleteRow;
|
||||
|
||||
MyViewHolder(View view) {
|
||||
super(view);
|
||||
ButterKnife.bind(this, view);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -24,6 +24,20 @@ public class DutyHourViewModel {
|
||||
this.day = day;
|
||||
return this;
|
||||
}
|
||||
public Boolean isValid(){
|
||||
if(this.day.isEmpty()){
|
||||
return false;
|
||||
}else if( !this.start.isEmpty() && this.end.isEmpty() ){
|
||||
return false;
|
||||
}else{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
public DutyHourViewModel(){
|
||||
day="";
|
||||
start="";
|
||||
end="";
|
||||
}
|
||||
|
||||
/**
|
||||
* Get day
|
||||
@ -94,10 +108,11 @@ public class DutyHourViewModel {
|
||||
return Objects.hash(day, start, end);
|
||||
}
|
||||
|
||||
|
||||
public String getSummary() {
|
||||
return this.getDay() + ": " + this.getStart() + " - " + this.getEnd();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
@ -33,11 +33,12 @@ public class TutorTabViewModel {
|
||||
@SerializedName("dutyHours")
|
||||
private List<DutyHourViewModel> dutyHours = null;
|
||||
|
||||
public TutorTabViewModel(String userId, String note){
|
||||
public TutorTabViewModel(String userId, String room, String email, String note, List<DutyHourViewModel> dutyHours){
|
||||
this.userId=userId;
|
||||
// this.room=room;
|
||||
// this.emailTutorTab=emailTutorTab;
|
||||
this.room=room;
|
||||
this.emailTutorTab=email;
|
||||
this.note=note;
|
||||
this.dutyHours = new ArrayList<DutyHourViewModel>(dutyHours);
|
||||
}
|
||||
|
||||
public TutorTabViewModel tutorTabId(UUID tutorTabId) {
|
||||
|
@ -5,6 +5,7 @@ import com.uam.wmi.findmytutor.model.TutorTabViewModel;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import io.reactivex.Single;
|
||||
import retrofit2.Response;
|
||||
import retrofit2.http.*;
|
||||
|
||||
|
||||
@ -40,6 +41,10 @@ public interface TutorTabApi {
|
||||
@retrofit2.http.Path("tutorId") String tutorId
|
||||
);
|
||||
|
||||
@POST("api/users/tutorTab/{tutorId}")
|
||||
Single<TutorTabViewModel> apiUsersTutorTabByTutorIdPost(
|
||||
@retrofit2.http.Path("tutorId") String tutorId, @retrofit2.http.Body TutorTabViewModel tutorTab
|
||||
);
|
||||
/**
|
||||
*
|
||||
*
|
||||
@ -51,7 +56,7 @@ public interface TutorTabApi {
|
||||
"Content-Type:application/json"
|
||||
})
|
||||
@PUT("api/users/tutorTab/{tutorId}")
|
||||
Observable<TutorTabViewModel> apiUsersTutorTabByTutorIdPut(
|
||||
Observable<Response<Void>> apiUsersTutorTabByTutorIdPut(
|
||||
@retrofit2.http.Path("tutorId") String tutorId, @retrofit2.http.Body TutorTabViewModel tutorTab
|
||||
);
|
||||
|
||||
|
@ -1,93 +1,171 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
|
||||
|
||||
<ScrollView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:mapbox="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:orientation="vertical"
|
||||
android:fontFamily="@font/lato_regular"
|
||||
android:paddingLeft="@dimen/activity_margin"
|
||||
android:paddingRight="@dimen/activity_margin"
|
||||
android:paddingTop="@dimen/activity_margin">
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/contentTutorTabInfoImageButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="right"
|
||||
mapbox:srcCompat="@drawable/outline_info_24"/>
|
||||
|
||||
<TextView android:id="@+id/userName"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dimen_10"
|
||||
android:fontFamily="sans-serif-medium"
|
||||
android:lineSpacingExtra="8sp"
|
||||
android:textColor="@color/mapboxRedDark"
|
||||
android:textSize="@dimen/lbl_new_note_title"
|
||||
android:textStyle="normal" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/userDepartment"
|
||||
<LinearLayout
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:lineSpacingExtra="8sp"
|
||||
android:paddingTop="5dp"
|
||||
android:textColor="@color/note_list_text"
|
||||
/>
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:fontFamily="@font/lato_regular"
|
||||
android:paddingLeft="@dimen/activity_margin"
|
||||
android:paddingRight="@dimen/activity_margin"
|
||||
android:paddingTop="@dimen/activity_margin">
|
||||
<ImageButton
|
||||
android:id="@+id/contentTutorTabInfoImageButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="right"
|
||||
mapbox:srcCompat="@drawable/outline_info_24"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/userRoom"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:lineSpacingExtra="8sp"
|
||||
android:paddingTop="5dp"
|
||||
android:textColor="@color/note_list_text"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/userEmail"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:lineSpacingExtra="8sp"
|
||||
android:paddingTop="5dp"
|
||||
android:textColor="@color/note_list_text" />
|
||||
<TextView
|
||||
android:id="@+id/userName"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dimen_10"
|
||||
android:fontFamily="sans-serif-medium"
|
||||
android:lineSpacingExtra="8sp"
|
||||
android:textColor="@color/mapboxRedDark"
|
||||
android:textSize="@dimen/lbl_new_note_title"
|
||||
android:textStyle="normal" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/userDutyHours"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:lineSpacingExtra="8sp"
|
||||
android:paddingTop="5dp"
|
||||
android:textColor="@color/note_list_text"
|
||||
tools:text="@string/dutyHours" />
|
||||
<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">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/userNoteTitle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="0dp"
|
||||
android:paddingBottom="0dp"
|
||||
android:paddingStart="@dimen/activity_margin"
|
||||
android:textColor="@color/note_list_text" />
|
||||
<EditText
|
||||
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.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">
|
||||
|
||||
<Button
|
||||
android:id="@+id/saveButon"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/saveButton" />
|
||||
<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>
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/dutyTitle"
|
||||
android:textSize="16sp"
|
||||
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="0dp"
|
||||
android:paddingBottom="0dp"
|
||||
android:textColor="@color/mapboxRedDark"
|
||||
android:text="@string/dutyTitle"/>
|
||||
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:id="@+id/dutyHourView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="100dp"
|
||||
android:scrollbars="vertical" />
|
||||
|
||||
|
||||
|
||||
<Button
|
||||
android:id="@+id/addDuty"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/addDuty"
|
||||
android:layout_gravity="end"/>
|
||||
|
||||
<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
|
||||
android:id="@+id/saveButon"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/saveButton" />
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
|
||||
</LinearLayout>
|
@ -0,0 +1,61 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout 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="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<android.support.design.widget.TextInputLayout
|
||||
android:id="@+id/duty_day"
|
||||
android:layout_width="95dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/hint_duty_day">
|
||||
|
||||
<android.support.design.widget.TextInputEditText
|
||||
android:id="@+id/duty_day_value"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:inputType="text"
|
||||
android:maxLines="1"
|
||||
tools:text="@tools:sample/date/day_of_week" />
|
||||
</android.support.design.widget.TextInputLayout>
|
||||
|
||||
<android.support.design.widget.TextInputLayout
|
||||
android:id="@+id/duty_start"
|
||||
android:layout_width="65dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/hint_duty_start">
|
||||
|
||||
<android.support.design.widget.TextInputEditText
|
||||
android:id="@+id/duty_start_value"
|
||||
android:maxLines="1"
|
||||
android:inputType="text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:text="@tools:sample/date/hhmm" />
|
||||
</android.support.design.widget.TextInputLayout>
|
||||
|
||||
<android.support.design.widget.TextInputLayout
|
||||
android:id="@+id/duty_stop"
|
||||
android:layout_width="65dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/hint_duty_end">
|
||||
|
||||
<android.support.design.widget.TextInputEditText
|
||||
android:id="@+id/duty_stop_value"
|
||||
android:maxLines="1"
|
||||
android:inputType="text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:text="@tools:sample/date/hhmm" />
|
||||
</android.support.design.widget.TextInputLayout>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/deleteRow"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleX="0.7"
|
||||
android:scaleY="0.7"
|
||||
app:srcCompat="@android:drawable/ic_delete" />
|
||||
</LinearLayout>
|
@ -94,7 +94,7 @@
|
||||
<string name="assembly_c">Skrzydło C</string>
|
||||
<string name="passage_d">ŁącznikD</string>
|
||||
|
||||
<string name="key_language">LOCALE</string>
|
||||
<string name="key_language">key_language</string>
|
||||
<string name="title_activity_settings2">Ustawienia</string>
|
||||
|
||||
<!-- Example General settings -->
|
||||
@ -147,7 +147,7 @@
|
||||
<string name="remove_manual_location">Usuń manualną lokację</string>
|
||||
<string name="title_activity_tutor_tab">Profil</string>
|
||||
<string name="saveButton">Zapisz!</string>
|
||||
<string name="tutorTabHint">Tutaj możesz dodać swoją notatkę. Będzie widoczna dla innych użytkowników.</string>
|
||||
<string name="tutorTabHint">Edytuj swoją notatkę. Będzie widoczna dla innych.</string>
|
||||
<string name="modal_location_send">WYŚLIJ</string>
|
||||
<string name="modal_location_hint">Proszę nazwać wybraną lokację.</string>
|
||||
<string name="manual_modal_title">Czy chcesz zapisać tę lokalizację?</string>
|
||||
@ -172,9 +172,9 @@
|
||||
<string name="map_info_text_p1">Na mapie wyświetlane są markery reprezentujące profesorów udostępniających w tej chwili swoją lokalizację.</string>
|
||||
<string name="map_info_text_p2">Po kliknięciu w marker możemy sprawdzić kto udostępnia lokalizację, oraz status opisowy (jeśli profesor go ustawił).</string>
|
||||
<string name="map_info_text_p3">W aplikacji dostępne są 3 rodzaje lokalizacji, które reprezentowane są przez markery różnego koloru.</string>
|
||||
<string name="map_info_text_marker_exact">- lokalizacja dokładna\n(udostępniana z GPS telefonu)</string>
|
||||
<string name="map_info_text_marker_approximated">- lokalizacja przybliżona</string>
|
||||
<string name="map_info_text_marker_manual">- lokalizacja manualna (wybrana ręcznie)</string>
|
||||
<string name="map_info_text_marker_exact">lokalizacja dokładna (udostępniana z GPS telefonu)</string>
|
||||
<string name="map_info_text_marker_approximated">lokalizacja przybliżona</string>
|
||||
<string name="map_info_text_marker_manual"> lokalizacja manualna (wybrana ręcznie)</string>
|
||||
|
||||
<!--(PL) Blacklist info helper-->
|
||||
<string name="info_icon_blacklist_p1">W tym panelu możesz dodać użytkowników do swojej czarnej listy. Użytkownicy z czarnej listy nie będą widzieć żadnych danych które udostępniasz - lokalizacji, twojego statusu online, czy informacji o obecności.</string>
|
||||
@ -204,26 +204,16 @@
|
||||
<string name="info_icon_sharing_tab_p5">Udostępnianie w dowolnym momencie można wyłączyć za pomocą przełącznika.</string>
|
||||
<string name="info_icon_sharing_tab_p6">Dodatkowo, do Twojej lokalizacji możesz dodać status opisowy (będzie on widoczny dla użytkowników po kliknięciu w marker).</string>
|
||||
<string name="info_icon_sharing_tab_p7">Zarówno manualne lokalizacje jak i statusy możesz dodać do listy, które potem możesz wybrać w wygodny sposób.</string>
|
||||
|
||||
<!--(PL) Userlist Tab info helper-->
|
||||
<string name="info_icon_userlist_tab_p1">W tym panelu znajduje się listę profesorów.</string>
|
||||
<string name="info_icon_userlist_tab_p2">Ich status symbolizowany jest przez kolorowe kropki:</string>
|
||||
<string name="info_icon_userlist_tab_level_status_online">- użytkownik jest obecnie online</string>
|
||||
<string name="info_icon_userlist_tab_level_status_offline">- użytkownik jest obecnie offline</string>
|
||||
<string name="info_icon_userlist_tab_level_status_inactive">- użytkownik jest nieaktywny</string>
|
||||
<string name="info_icon_userlist_tab_level_status_inactive_tip">(nie udostępnił żadnych danych o lokalizacji od co najmniej tygodnia)</string>
|
||||
<string name="info_icon_userlist_tab_level_status_inactive_tip">(nie udostępnił żadnych danych o lokalizacji od conajmniej tygodnia)</string>
|
||||
<string name="info_icon_userlist_summary">Po kliknięciu w imię i nazwisko, wyświetli się karta zawierająca dokładne informacje o profesorze.</string>
|
||||
|
||||
|
||||
<string name="lack_of_status">Użytkownik nie zdefiniował statusu.</string>
|
||||
|
||||
|
||||
<string name="possitive_dialog_button">Tak</string>
|
||||
<string name="negative_dialog_button">Nie</string>
|
||||
<string name="enable_sharing_question">Aby skorzystać z tej funkcji musisz pozwolić na udostępnianie lokalizacji. Zgadzasz sie?</string>
|
||||
<string name="sharing_modal_title">Udostępnianie</string>
|
||||
|
||||
|
||||
|
||||
<!--ACRA ON/OFF switch-->
|
||||
<string name="pref_acra_disabled" translatable="false">Pozwól na wysyłanie raportów o błędach.</string>
|
||||
@ -231,6 +221,24 @@
|
||||
<string name="pref_title_acra" translatable="false">Raportowanie błędów.</string>
|
||||
<string name="acra_toast_text" translatable="false">Błąd aplikacji. Informacje o błędzie zostanie wysłana do twórców.</string>
|
||||
|
||||
|
||||
<string name="hint_duty_day">Dzień</string>
|
||||
<string name="hint_duty_start">Start</string>
|
||||
<string name="hint_duty_end">Koniec</string>
|
||||
<string name="hint_department">Zakład</string>
|
||||
<string name="hint_room">Pokój</string>
|
||||
<string name="addDuty">DODAJ DYŻUR</string>
|
||||
<string name="dutyTitle">Godziny dyżurów</string>
|
||||
<string name="personalInfoTitle">Dane kontaktowe</string>
|
||||
<string name="userNoteTitle">Twoja notka</string>
|
||||
<string name="updateToast">Dziękujemy za aktualizację profilu</string>
|
||||
<string name="error_location_fetch">Błąd podczas pobierania lokalizacji.</string>
|
||||
|
||||
<string name="lack_of_status">Użytkownik nie zdefiniował statusu.</string>
|
||||
<string name="possitive_dialog_button">Tak</string>
|
||||
<string name="negative_dialog_button">Nie</string>
|
||||
<string name="enable_sharing_question">Aby skorzystać z tej funkcji musisz pozwolić na udostępnianie lokalizacji. Zgadzasz sie?</string>
|
||||
<string name="sharing_modal_title">Udostępnianie</string>
|
||||
</resources>
|
||||
|
||||
|
||||
|
@ -88,7 +88,8 @@
|
||||
|
||||
<string name="settings_description">Descrition</string>
|
||||
<string name="saveButton">Save</string>
|
||||
<string name="tutorTabHint">Here you can add your note. It will be visible to the other users.</string>
|
||||
<string name="tutorTabHint">Edit your note. It will be shown in the users list.</string>
|
||||
|
||||
|
||||
<string name="key_description">key_description</string>
|
||||
|
||||
@ -109,7 +110,7 @@
|
||||
<string name="lang_eng">English</string>
|
||||
<string name="lang_pol">Polish</string>
|
||||
<string name="settings_language">Choose language</string>
|
||||
<string name="key_language">LOCALE</string>
|
||||
<string name="key_language">key_language</string>
|
||||
|
||||
|
||||
<string name="pref_header_about">About</string>
|
||||
@ -233,8 +234,12 @@
|
||||
<string name="network_error">Network Error!</string>
|
||||
<string name="manual_status_error">Error handling status fetch</string>
|
||||
<string name="error_status_fetch">Error handling status fetch</string>
|
||||
<string name="error_location_fetch" translatable="false">Error handling status fetch</string>
|
||||
<string name="error_location_fetch">Error handling status fetch</string>
|
||||
|
||||
<!--<string name="pref_acra_disabled" translatable="false">Auto reporting on issue is OFF</string>-->
|
||||
<!--<string name="pref_acra_enabled" translatable="false">Auto reporting on issue is ON</string>-->
|
||||
<!--<string name="pref_disable_acra" translatable="false">ACRA reporting tool</string>-->
|
||||
<string name="acra_toast_text" translatable="false">Sorry, the application crashed. A report will be sent to the developers</string>
|
||||
<string name="notification_text">Sorry, the application crashed. A report will be sent to the developers</string>
|
||||
<string name="notification_title" translatable="false">FMT Issue</string>
|
||||
<string name="notification_channel" translatable="false">FMT</string>
|
||||
@ -244,18 +249,17 @@
|
||||
<string name="mockup_location_string" translatable="false">mock location string</string>
|
||||
|
||||
<!--ACRA ON/OFF switch-->
|
||||
<string name="pref_acra_disabled" translatable="false">Allow to send report to developers is ON</string>
|
||||
<string name="pref_acra_enabled" translatable="false">Allow to send report to developers is OFF</string>
|
||||
<string name="pref_title_acra" translatable="false">App issues reporting</string>
|
||||
<string name="acra_toast_text" translatable="false">Sorry, the application crashed. A report will be sent to the developers</string>
|
||||
<string name="pref_acra_disabled" translatable="false">Allow to send raport to developers is ON</string>
|
||||
<string name="pref_acra_enabled" translatable="false">Allow to send raport to developers is OFF</string>
|
||||
<string name="pref_disable_acra" translatable="false">App issues reporting</string>
|
||||
|
||||
<!--(ENG) Map Activity info helper-->
|
||||
<string name="map_info_text_p1">On the map there are markers which represents tutors sharing their location right now.</string>
|
||||
<string name="map_info_text_p2">After clicking on a marker, you can check who is sharing it and the descriptive status (if the tutor have set one).</string>
|
||||
<string name="map_info_text_p3">In the app there are 3 possible types of localization, represented by various colors.</string>
|
||||
<string name="map_info_text_marker_exact">- exact localization (from mobile GPS)</string>
|
||||
<string name="map_info_text_marker_approximated">- approximated localization</string>
|
||||
<string name="map_info_text_marker_manual">- manual localization (manually picked)</string>
|
||||
<string name="map_info_text_marker_exact">exact localization (from mobile GPS)</string>
|
||||
<string name="map_info_text_marker_approximated">approximated localization</string>
|
||||
<string name="map_info_text_marker_manual">manual localization (manually picked)</string>
|
||||
|
||||
<!--(ENG) Blacklist info helper-->
|
||||
<string name="info_icon_blacklist_p1">In this panel you can add users to your blacklist. Users from the blacklist can’t see any data that you share - localization, online status, or information about presence.</string>
|
||||
@ -295,12 +299,24 @@
|
||||
<string name="info_icon_userlist_tab_level_status_inactive_tip">(didn’t share any localization data since 7 days)</string>
|
||||
<string name="info_icon_userlist_summary">After clicking on a name, the tutor tab will pop up, containing details about selected tutor.</string>
|
||||
|
||||
<string name="possitive_dialog_button">yes</string>
|
||||
<string name="possitive_dialog_button">Yes</string>
|
||||
|
||||
<string name="pref_title_acra" translatable="false">App issues reporting</string>
|
||||
|
||||
<!--(ENG) Profile Activity strings-->
|
||||
<string name="hint_duty_day">Day</string>
|
||||
<string name="hint_duty_start">Start</string>
|
||||
<string name="hint_duty_end">End</string>
|
||||
<string name="hint_department">Department</string>
|
||||
<string name="hint_room">Room</string>
|
||||
<string name="hint_email" translatable="false">Email</string>
|
||||
<string name="addDuty">ADD DUTY</string>
|
||||
<string name="dutyTitle">Duty hours</string>
|
||||
<string name="personalInfoTitle">Personal info</string>
|
||||
<string name="userNoteTitle">Your note</string>
|
||||
<string name="updateToast">Thank you for updating your profile.</string>
|
||||
<string name="negative_dialog_button">No</string>
|
||||
<string name="enable_sharing_question">In order to use this function, you have to enable localization sharing. May I do it for you?</string>
|
||||
<string name="sharing_modal_title">Sharing</string>
|
||||
|
||||
<string name="lack_of_status">The user hasn\'t defined a status.</string>
|
||||
|
||||
|
||||
</resources>
|
||||
|
Loading…
Reference in New Issue
Block a user