Updated views of share management. Refactoring. Removed unused code.
lbs-gitea/maptology/master This commit looks good

This commit is contained in:
Sarah Theußen
2018-02-01 18:55:11 +01:00
parent 5d2dba2074
commit aa7edcb6bf
11 changed files with 266 additions and 380 deletions
@@ -1,6 +1,5 @@
package com.maptology.android.app.IncomingShare;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.GridLayoutManager;
@@ -62,10 +61,9 @@ public class IncomingSharesFragment extends AbstractFragment {
@Override
public boolean onContextItemSelected(MenuItem item) {
//ShareAdapterIncoming.getItemSelected(item);
CharSequence i = item.getTitle();
if (i.equals(ShareAdapterIncoming.DELETE)) {
//regenerate the link again...
// TODO: delete
deleteShareFromDatabase();
}
return super.onContextItemSelected(item);
@@ -7,6 +7,7 @@ import android.view.ContextMenu;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.maptology.android.app.OutgoingShare.ILongClickListener;
import com.maptology.android.app.R;
@@ -34,7 +35,7 @@ public class ShareAdapterIncoming extends RecyclerView.Adapter<ShareAdapterIncom
@Override
public ViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
LayoutInflater inf = LayoutInflater.from(viewGroup.getContext());
View v = inf.inflate(R.layout.view_share_incoming, viewGroup, false);
View v = inf.inflate(R.layout.view_share, viewGroup, false);
ViewHolder vh = new ViewHolder(v);
return vh;
}
@@ -45,23 +46,18 @@ public class ShareAdapterIncoming extends RecyclerView.Adapter<ShareAdapterIncom
String expTime = cursor.getString(cursor.getColumnIndex(InShareContract.Share.EXPIRATION_TIME));
String shareMessage = cursor.getString(cursor.getColumnIndex(InShareContract.Share.SHARE_MESSAGE));
String shareDestination = cursor.getString(cursor.getColumnIndex(InShareContract.Share.SHARE_DESTINATION));
String shareAvalibility = cursor.getString(cursor.getColumnIndex(InShareContract.Share.AVAILABILITY));
String shareLongitude = cursor.getString(cursor.getColumnIndex(InShareContract.Share.LONGITUDE));
String shareLatitude = cursor.getString(cursor.getColumnIndex(InShareContract.Share.LATITUDE));
String shareTimestamp = cursor.getString(cursor.getColumnIndex(InShareContract.Share.TIMESTAMP));
id = Integer.parseInt(cursor.getString(cursor.getColumnIndex(InShareContract.Share.ID)));
long expTimeInt = Long.parseLong(expTime);
Calendar exp = Calendar.getInstance();
exp.setTimeInMillis(expTimeInt);
viewHolder.setExpTime(app.getApplicationContext().getString(R.string.until) + ": " + DateFormatUtil.getDateTimeFormat().format(exp.getTime()));
exp.setTimeInMillis(Long.parseLong(expTime));
Calendar start = Calendar.getInstance();
start.setTimeInMillis(Long.parseLong(shareTimestamp));
viewHolder.setExpTime(DateFormatUtil.getDateTimeFormat().format(exp.getTime()));
viewHolder.setShareMessage(shareMessage);
viewHolder.setDestination(shareDestination);
viewHolder.setAvailabilityView(shareAvalibility);
viewHolder.setLongitudeView(shareLongitude);
viewHolder.setLatitudeView(shareLatitude);
viewHolder.setTimeStampView(shareTimestamp);
viewHolder.setTimeStampView(DateFormatUtil.getDateTimeFormat().format(start.getTime()));
}
viewHolder.setLongClickListener(new ILongClickListener() {
@@ -116,20 +112,18 @@ public class ShareAdapterIncoming extends RecyclerView.Adapter<ShareAdapterIncom
private TextView shareMessageView;
private TextView shareDestinationView;
private TextView timeStampView;
private TextView longitudeView;
private TextView latitudeView;
private TextView availabilityView;
private LinearLayout messageLine;
private LinearLayout destinationLine;
public ViewHolder(View itemView) {
super(itemView);
expirationTimeView = (TextView) itemView.findViewById(R.id.view_share_expTime);
shareMessageView = (TextView) itemView.findViewById(R.id.share_message);
shareDestinationView = (TextView) itemView.findViewById(R.id.share_destination);
timeStampView = (TextView) itemView.findViewById(R.id.share_timestamp);
longitudeView = (TextView) itemView.findViewById(R.id.share_longitude);
latitudeView = (TextView) itemView.findViewById(R.id.share_latitude);
availabilityView = (TextView) itemView.findViewById(R.id.share_availability);
shareMessageView = (TextView) itemView.findViewById(R.id.view_share_message);
shareDestinationView = (TextView) itemView.findViewById(R.id.view_share_destination);
timeStampView = (TextView) itemView.findViewById(R.id.view_share_createTime);
messageLine = (LinearLayout) itemView.findViewById(R.id.message_line);
destinationLine = (LinearLayout) itemView.findViewById(R.id.destination_line);
itemView.setOnLongClickListener(this);
itemView.setOnCreateContextMenuListener(this);
@@ -143,28 +137,24 @@ public class ShareAdapterIncoming extends RecyclerView.Adapter<ShareAdapterIncom
setText(timeStampView, string);
}
public void setLongitudeView(String string) {
setText(longitudeView, string);
}
public void setLatitudeView(String string) {
setText(latitudeView, string);
}
public void setAvailabilityView(String string) {
setText(availabilityView, string);
}
public void setExpTime(String string) {
setText(expirationTimeView, string);
}
public void setShareMessage(String string) {
setText(shareMessageView, string);
if (!string.trim().isEmpty()) {
setText(shareMessageView, string);
} else {
messageLine.setVisibility(View.GONE);
}
}
public void setDestination(String string) {
setText(shareDestinationView, string);
if (!string.trim().isEmpty()) {
setText(shareDestinationView, string);
} else {
destinationLine.setVisibility(View.GONE);
}
}
private void setText(TextView v, String t) {
@@ -91,9 +91,7 @@ public class OutgoingSharesFragment extends AbstractFragment {
@Override
public boolean onContextItemSelected(MenuItem item) {
CharSequence i = item.getTitle();
if (i.equals(getString(R.string.reshare))) {
// TODO: regenerate the link again...
} else if (i.equals(getString(R.string.edit))) {
if (i.equals(getString(R.string.edit))) {
updateShareInDatabase();
} else if (i.equals(getString(R.string.delete))){
deleteShareFromDatabase();
@@ -7,6 +7,7 @@ import android.view.ContextMenu;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.maptology.android.app.R;
import com.maptology.android.app.util.DateFormatUtil;
@@ -33,7 +34,7 @@ public class ShareAdapterOutgoing extends RecyclerView.Adapter<ShareAdapterOutgo
@Override
public ViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
LayoutInflater inf = LayoutInflater.from(viewGroup.getContext());
View v = inf.inflate(R.layout.view_share_outgoing, viewGroup, false);
View v = inf.inflate(R.layout.view_share, viewGroup, false);
return new ViewHolder(v);
}
@@ -52,12 +53,11 @@ public class ShareAdapterOutgoing extends RecyclerView.Adapter<ShareAdapterOutgo
Calendar creation = Calendar.getInstance();
creation.setTimeInMillis(Long.parseLong(creationTime));
viewHolder.setCreationTime(DateFormatUtil.getDateTimeFormat().format(creation.getTime()));
viewHolder.setExpTime(app.getApplicationContext().getString(R.string.until) + ": " + DateFormatUtil.getDateTimeFormat().format(exp.getTime()));
viewHolder.setExpTime(DateFormatUtil.getDateTimeFormat().format(exp.getTime()));
viewHolder.setShareMessage(shareMessage);
viewHolder.setDestination(shareDestination);
}
viewHolder.setLongClickListener(new ILongClickListener() {
@Override
public void onItemClicklistener(int position) {
@@ -108,14 +108,18 @@ public class ShareAdapterOutgoing extends RecyclerView.Adapter<ShareAdapterOutgo
private TextView expirationTimeView;
private TextView shareMessageView;
private TextView shareDestinationView;
private LinearLayout messageLine;
private LinearLayout destinationLine;
public ViewHolder(View itemView) {
super(itemView);
creationTimeView = (TextView) itemView.findViewById(R.id.view_share_createTime);
expirationTimeView = (TextView) itemView.findViewById(R.id.view_share_expTime);
shareMessageView = (TextView) itemView.findViewById(R.id.share_message);
shareDestinationView = (TextView) itemView.findViewById(R.id.share_destination);
shareMessageView = (TextView) itemView.findViewById(R.id.view_share_message);
shareDestinationView = (TextView) itemView.findViewById(R.id.view_share_destination);
messageLine = (LinearLayout) itemView.findViewById(R.id.message_line);
destinationLine = (LinearLayout) itemView.findViewById(R.id.destination_line);
itemView.setOnLongClickListener(this);
itemView.setOnCreateContextMenuListener(this);
@@ -134,11 +138,17 @@ public class ShareAdapterOutgoing extends RecyclerView.Adapter<ShareAdapterOutgo
}
public void setShareMessage(String string) {
setText(shareMessageView, string);
if(!string.trim().isEmpty())
setText(shareMessageView, string);
else
messageLine.setVisibility(View.GONE);
}
public void setDestination(String string) {
setText(shareDestinationView, string);
if(!string.trim().isEmpty())
setText(shareDestinationView, string);
else
destinationLine.setVisibility(View.GONE);
}
private void setText(TextView v, String t) {
@@ -151,7 +161,6 @@ public class ShareAdapterOutgoing extends RecyclerView.Adapter<ShareAdapterOutgo
public void onCreateContextMenu(ContextMenu menu, View view, ContextMenu.ContextMenuInfo menuInfo) {
menu.setHeaderTitle(view.getContext().getString(R.string.select_an_action));
menu.setHeaderIcon(R.drawable.ic_accessibility_black_24dp);
menu.add(view.getContext().getString(R.string.reshare)).setIcon(R.drawable.ic_compare_arrows_black_24dp).setTitle(view.getContext().getString(R.string.reshare));
menu.add(view.getContext().getString(R.string.edit)).setIcon(R.drawable.ic_border_color_black_24dp).setTitle(view.getContext().getString(R.string.edit));
menu.add(view.getContext().getString(R.string.delete)).setIcon(R.drawable.ic_delete_black_24dp).setTitle(view.getContext().getString(R.string.delete));
}
@@ -1,17 +1,16 @@
package com.maptology.android.app.fragment;
import android.content.DialogInterface;
import android.database.Cursor;
import android.os.Bundle;
import android.os.Handler;
import android.support.design.widget.FloatingActionButton;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.AlertDialog;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.locoslab.api.data.maps.model.Box;
@@ -29,7 +28,6 @@ import com.locoslab.capi.android.leafless.tile.TileLayerOptions;
import com.maptology.android.app.IncomingShare.InShareContract;
import com.maptology.android.app.R;
import com.maptology.android.app.map.IconManager;
import com.maptology.android.app.repository.AsyncError;
import com.maptology.android.app.repository.AsyncInteraction;
import com.maptology.android.app.repository.IValueListener;
import com.maptology.android.app.repository.Repository;
@@ -39,7 +37,6 @@ import com.maptology.android.app.util.IncomingShareDataModel;
import com.maptology.android.app.util.UpdateUITask;
import com.maptology.android.feign.model.Coordinate;
import java.text.DateFormat;
import java.util.HashMap;
import java.util.Map;
@@ -88,19 +85,16 @@ public class MapFragment extends AbstractFragment {
private IconManager iconManager = new IconManager();
private Marker userMarker;
private Marker shareMarker;
private ShareFragment shareFragment;
private FloatingActionButton floatingActionButtonShare;
private FloatingActionButton floatingActionButtonPosition;
private AlertDialog dialog;
private TextView destinationLabel;
private TextView messageLabel;
private TextView expirationLabel;
private TextView destinationValue;
private TextView messageValue;
private TextView expirationValue;
private TextView messageValue;
private TextView destinationValue;
private LinearLayout messageLine;
private LinearLayout destinationLine;
private RelativeLayout relativeLayout;
private Handler handler = new Handler();
@@ -114,17 +108,16 @@ public class MapFragment extends AbstractFragment {
private double lastKnownLat;
private HashMap<String, IncomingShareDataModel> incomingSharesHash = new HashMap<>();
private HashMap<String,Marker> incomingSharesMarkerHash = new HashMap<>();
private HashMap<String, Marker> incomingSharesMarkerHash = new HashMap<>();
private Runnable startNewTask = new Runnable() {
@Override
public void run() {
UpdateUITask update = new UpdateUITask(getApp());
update.execute();
}
};
private IValueListener<AsyncInteraction> updateListener = new IValueListener<AsyncInteraction>() {
@Override
public void onValueChanged(Value<AsyncInteraction> source, AsyncInteraction oldValue, AsyncInteraction newValue) {
@@ -138,10 +131,9 @@ public class MapFragment extends AbstractFragment {
}
}
}
};
private IValueListener<Coordinate> locationListener = new IValueListener<Coordinate>() {
@Override
public void onValueChanged(Value<Coordinate> source, Coordinate oldValue, Coordinate newValue) {
@@ -176,13 +168,11 @@ public class MapFragment extends AbstractFragment {
floatingActionButtonShare = (FloatingActionButton) view.findViewById(R.id.floatingActionButtonShare);
relativeLayout = (RelativeLayout) view.findViewById(R.id.shareViewDetails);
destinationLabel = (TextView) view.findViewById(R.id.shareDestLabel);
messageLabel = (TextView) view.findViewById(R.id.shareMestLabel);
expirationLabel = (TextView) view.findViewById(R.id.shareExpTimeLabel);
destinationValue = (TextView) view.findViewById(R.id.shareDestValue);
messageValue = (TextView) view.findViewById(R.id.shareMestValue);
expirationValue = (TextView) view.findViewById(R.id.shareExpTimeValue);
messageValue = (TextView) view.findViewById(R.id.shareMestValue);
destinationValue = (TextView) view.findViewById(R.id.shareDestValue);
messageLine = (LinearLayout) view.findViewById(R.id.message_line);
destinationLine = (LinearLayout) view.findViewById(R.id.destination_line);
floatingActionButtonShare.setOnClickListener(new View.OnClickListener() {
@Override
@@ -210,8 +200,8 @@ public class MapFragment extends AbstractFragment {
} else {
taskRunning = false;
floatingActionButtonPosition.setImageResource(R.drawable.ic_gps_not_fixed_black_24dp);
if(incomingSharesMarkerHash!=null && incomingSharesMarkerHash.size()>=1){
for(Marker marker : incomingSharesMarkerHash.values() ){
if (incomingSharesMarkerHash != null && incomingSharesMarkerHash.size() >= 1) {
for (Marker marker : incomingSharesMarkerHash.values()) {
map.removeMarker(marker);
}
}
@@ -240,7 +230,7 @@ public class MapFragment extends AbstractFragment {
map.addShortTapListener(new ITouchListener() {
@Override
public void onEvent(TouchEvent event) {
if(relativeLayout.getVisibility()==View.VISIBLE){
if (relativeLayout.getVisibility() == View.VISIBLE) {
relativeLayout.setVisibility(View.GONE);
}
}
@@ -259,7 +249,6 @@ public class MapFragment extends AbstractFragment {
userMarker = new Marker(new MarkerOptions(iconManager.getPinIcon()));
return view;
}
@@ -269,17 +258,17 @@ public class MapFragment extends AbstractFragment {
setMapBoarders();
}
private HashMap<String,IncomingShareDataModel> getIncomingShares() {
IncomingShareDataModel share;
Cursor cursor = getApp().getInShareStore().getShares();
if(cursor!=null){
if(cursor.moveToFirst()){
do {
String secretToken=cursor.getString(cursor.getColumnIndex(InShareContract.Share.SECRET_ID));
long expTime=cursor.getLong(cursor.getColumnIndex(InShareContract.Share.EXPIRATION_TIME));
if(incomingSharesMarkerHash.size()==0){
if(System.currentTimeMillis()<=expTime){
incomingSharesMarkerHash.put(secretToken,new Marker(new MarkerOptions(iconManager.getNormalIcon())));
private HashMap<String, IncomingShareDataModel> getIncomingShares() {
IncomingShareDataModel share;
Cursor cursor = getApp().getInShareStore().getShares();
if (cursor != null) {
if (cursor.moveToFirst()) {
do {
String secretToken = cursor.getString(cursor.getColumnIndex(InShareContract.Share.SECRET_ID));
long expTime = cursor.getLong(cursor.getColumnIndex(InShareContract.Share.EXPIRATION_TIME));
if (incomingSharesMarkerHash.size() == 0) {
if (System.currentTimeMillis() <= expTime) {
incomingSharesMarkerHash.put(secretToken, new Marker(new MarkerOptions(iconManager.getNormalIcon())));
share = new IncomingShareDataModel();
share.setId(cursor.getInt(cursor.getColumnIndex(InShareContract.Share.ID)));
share.setSecretToken(cursor.getString(cursor.getColumnIndex(InShareContract.Share.SECRET_ID)));
@@ -288,9 +277,9 @@ public class MapFragment extends AbstractFragment {
share.setExpirationTime(cursor.getLong(cursor.getColumnIndex(InShareContract.Share.EXPIRATION_TIME)));
share.setLongitude(cursor.getDouble(cursor.getColumnIndex(InShareContract.Share.LONGITUDE)));
share.setLatitude(cursor.getDouble(cursor.getColumnIndex(InShareContract.Share.LATITUDE)));
incomingSharesHash.put(secretToken,share);
incomingSharesHash.put(secretToken, share);
}
}else {
} else {
if (!incomingSharesMarkerHash.containsKey(secretToken)) {
if (System.currentTimeMillis() <= expTime) {
incomingSharesMarkerHash.put(secretToken, new Marker(new MarkerOptions(iconManager.getNormalIcon())));
@@ -306,13 +295,13 @@ public class MapFragment extends AbstractFragment {
}
}
}
}while (cursor.moveToNext());
}
cursor.close();
}
//incomingShares.add(shares);
return incomingSharesHash;
}
} while (cursor.moveToNext());
}
cursor.close();
}
return incomingSharesHash;
}
public void setMapBoarders() {
if (map != null) {
if (incomingSharesHash != null && incomingSharesHash.size() > 1) {
@@ -336,20 +325,30 @@ public class MapFragment extends AbstractFragment {
public void drawMarkersOnMap() {
if (map != null) {
if(incomingSharesMarkerHash!=null && incomingSharesMarkerHash.size()>=1){
for (Map.Entry<String,Marker> entry : incomingSharesMarkerHash.entrySet() ){
for(final IncomingShareDataModel model : incomingSharesHash.values()){
if(entry.getKey().equals(model.getSecretToken())){
if (incomingSharesMarkerHash != null && incomingSharesMarkerHash.size() >= 1) {
for (Map.Entry<String, Marker> entry : incomingSharesMarkerHash.entrySet()) {
for (final IncomingShareDataModel model : incomingSharesHash.values()) {
if (entry.getKey().equals(model.getSecretToken())) {
entry.getValue().addShortTapListener(new ITouchListener() {
@Override
public void onEvent(TouchEvent event) {
relativeLayout.setVisibility(View.VISIBLE);
destinationValue.setText(model.getDestination());
messageValue.setText(model.getMessage());
expirationValue.setText(DateFormatUtil.getDateTimeFormat().format(model.getExpirationTime()));
if (!model.getMessage().trim().isEmpty()) {
messageValue.setText(model.getMessage());
messageLine.setVisibility(View.VISIBLE);
} else {
messageLine.setVisibility(View.GONE);
}
if (!model.getDestination().trim().isEmpty()) {
destinationValue.setText(model.getDestination());
destinationLine.setVisibility(View.VISIBLE);
} else {
destinationLine.setVisibility(View.VISIBLE);
}
}
});
if(entry.getValue().getCoordinate().getLatitude()!=model.getLatitude()
if (entry.getValue().getCoordinate().getLatitude() != model.getLatitude()
&& entry.getValue().getCoordinate().getLongitude() != model.getLongitude()) {
entry.getValue().setLongitude(model.getLongitude());
entry.getValue().setLatitude(model.getLatitude());
@@ -362,62 +361,6 @@ public class MapFragment extends AbstractFragment {
}
}
public void setIncomingShareMarkers(double longitude, double latitude, ITouchListener listener) {
final Marker shareMarker = new Marker(new MarkerOptions(iconManager.getNormalIcon()));
shareMarker.setLongitude(longitude);
shareMarker.setLatitude(latitude);
shareMarker.addShortTapListener(listener);
map.addMarker(shareMarker);
}
private void onUpdateInteraction(AsyncInteraction interaction) {
if (interaction == null) {
setEnabled(true);
hideDialog();
} else if (!interaction.isComplete()) {
setEnabled(false);
hideDialog();
} else if (interaction.hasError()) {
AsyncError e = interaction.getError();
String text = e.getMessage(getActivity());
if (text != null) {
showDialog(interaction, text);
}
setEnabled(true);
}
}
public void setEnabled(boolean b) {
if (getApp().getApplicationContext() != null) {
floatingActionButtonPosition.setEnabled(b);
floatingActionButtonShare.setEnabled(b);
map.setEnabled(b);
}
}
private void showDialog(final AsyncInteraction interaction, String text) {
AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
builder.setMessage(text);
builder.setPositiveButton(R.string.ok, null);
if (interaction.canRetry()) {
builder.setNeutralButton(R.string.retry, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
interaction.retry();
}
});
}
dialog = builder.create();
dialog.show();
}
private void hideDialog() {
if (dialog != null) {
dialog.dismiss();
dialog = null;
}
}
@Override
public void onResume() {
super.onResume();
@@ -465,12 +408,4 @@ public class MapFragment extends AbstractFragment {
angle = map.getAngle();
}
public String formatDetailMessage(String message, String destination, long expTime) {
String date = DateFormat.getDateInstance(DateFormat.DEFAULT).format(expTime);
String time = DateFormat.getTimeInstance(DateFormat.SHORT).format(expTime);
return getResources().getText(R.string.share_message) + ": " + message + "\n"
+ getResources().getText(R.string.share_destination) + ": " + destination + "\n"
+ getResources().getText(R.string.expiration_time) + ": " + date + " " + time;
}
}
@@ -1,61 +1,80 @@
<merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res/com.maptology.android.app">
xmlns:app="http://schemas.android.com/apk/res/com.maptology.android.app"
xmlns:tools="http://schemas.android.com/tools">
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent" android:weightSum="1"
android:background="@color/colorPrimary"
android:padding="@dimen/cardCorner">
android:layout_height="match_parent"
android:background="@color/colorPrimary">
<ImageView android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/icon_header"
android:scaleType="centerCrop"
/>
android:scaleType="centerCrop"/>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent" android:weightSum="1">
android:layout_height="wrap_content"
android:padding="@dimen/cardCorner">
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="vertical" android:layout_weight="0.5"
android:layout_margin="@dimen/cardCorner">
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/share_message"
android:id="@+id/shareMestLabel"
style="@style/text_small_inverse"/>
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_weight="0.3"
android:text="@string/expiration_time"
android:id="@+id/shareExpTimeLabel"
style="@style/text_small_inverse"/>
<TextView android:layout_width="wrap_content"
<TextView android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_weight="0.7"
tools:text="12/12/12 10:30"
android:id="@+id/shareExpTimeValue"
style="@style/text_small_inverse"/>
</LinearLayout>
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:id="@+id/message_line">
<TextView android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_weight="0.3"
android:text="@string/share_message"
android:id="@+id/shareMestLabel"
style="@style/text_small_inverse"/>
<TextView android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_weight="0.7"
tools:text="Message"
android:id="@+id/shareMestValue"
style="@style/text_small_inverse"/>
</LinearLayout>
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:id="@+id/destination_line">
<TextView android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_weight="0.3"
android:text="@string/share_destination"
android:id="@+id/shareDestLabel"
style="@style/text_small_inverse"/>
</LinearLayout>
<LinearLayout android:layout_width="match_parent"
<TextView android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="vertical" android:layout_weight="0.5">
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:id="@+id/shareMestValue"
style="@style/text_small_inverse"/>
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:id="@+id/shareExpTimeValue"
style="@style/text_small_inverse"/>
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:orientation="horizontal"
android:layout_weight="0.7"
tools:text="Destination"
android:id="@+id/shareDestValue"
style="@style/text_small_inverse"/>
</LinearLayout>
</LinearLayout>
</RelativeLayout>
</merge>
</merge>
@@ -0,0 +1,109 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:auto="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.CardView
android:id="@+id/card_view"
android:layout_gravity="center"
auto:cardCornerRadius="@dimen/cardCorner"
auto:cardElevation="@dimen/cardElevation"
auto:cardUseCompatPadding="true"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:baselineAligned="true"
android:weightSum="1">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="@dimen/globalPaddingLeft">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<TextView
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="@string/start"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.3"/>
<TextView
android:id="@+id/view_share_createTime"
android:textAppearance="?android:attr/textAppearanceSmall"
tools:text="12/12/12 10:30"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.7"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<TextView
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="@string/until"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.3"/>
<TextView
android:id="@+id/view_share_expTime"
android:textAppearance="?android:attr/textAppearanceSmall"
tools:text="12/12/12 10:30"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.7"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:id="@+id/message_line">
<TextView
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="@string/share_message"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.3"/>
<TextView
android:id="@+id/view_share_message"
android:textAppearance="?android:attr/textAppearanceSmall"
tools:text="Message"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.7"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:id="@+id/destination_line">
<TextView
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="@string/share_destination"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.3"/>
<TextView
android:id="@+id/view_share_destination"
android:textAppearance="?android:attr/textAppearanceSmall"
tools:text="Destination"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.7"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
</FrameLayout>
@@ -1,95 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:auto="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.CardView
android:id="@+id/card_view"
android:layout_gravity="center"
auto:cardCornerRadius="@dimen/cardCorner"
auto:cardElevation="@dimen/cardElevation"
auto:cardUseCompatPadding="true"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:baselineAligned="true"
android:weightSum="1">
<LinearLayout
android:orientation="vertical"
android:padding="@dimen/globalPaddingLeft"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.2">
<TextView
android:id="@+id/view_share_expTime"
android:textAppearance="?android:attr/textAppearanceSmall"
tools:text="12/12/12 10:30"
android:gravity="center_horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<TextView
tools:text="this is a share message!"
android:gravity="center_horizontal"
android:id="@+id/share_message"
android:textAppearance="?android:attr/textAppearanceSmall"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<TextView
tools:text="this is a destination"
android:gravity="center_horizontal"
android:textAppearance="?android:attr/textAppearanceSmall"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/share_destination"/>
<TextView
tools:text="this is a Longitude"
android:gravity="center_horizontal"
android:textAppearance="?android:attr/textAppearanceSmall"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/share_longitude"/>
<TextView
tools:text="this is a latitude"
android:gravity="center_horizontal"
android:textAppearance="?android:attr/textAppearanceSmall"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/share_latitude"/>
<TextView
tools:text="this is a availability"
android:gravity="center_horizontal"
android:textAppearance="?android:attr/textAppearanceSmall"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/share_availability"/>
<TextView
tools:text="this is a timestamp"
android:gravity="center_horizontal"
android:textAppearance="?android:attr/textAppearanceSmall"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/share_timestamp"/>
</LinearLayout>
<LinearLayout android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.8"
android:orientation="vertical">
<android.support.v7.widget.AppCompatImageView android:layout_width="wrap_content"
android:layout_height="match_parent"
android:contentDescription=""
android:layout_gravity="center_horizontal|center_vertical"
android:src="@drawable/ic_location_on_black_24dp"
android:id="@+id/positionImageView"/>
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
</FrameLayout>
@@ -1,75 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:auto="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.CardView
android:id="@+id/card_view"
android:layout_gravity="center"
auto:cardCornerRadius="@dimen/cardCorner"
auto:cardElevation="@dimen/cardElevation"
auto:cardUseCompatPadding="true"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:baselineAligned="true"
android:weightSum="1">
<LinearLayout
android:orientation="vertical"
android:padding="@dimen/globalPaddingLeft"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.25">
<TextView
android:id="@+id/view_share_createTime"
android:textAppearance="?android:attr/textAppearanceSmall"
tools:text="12/12/12 10:30"
android:gravity="center_horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<TextView
android:id="@+id/view_share_expTime"
android:textAppearance="?android:attr/textAppearanceSmall"
tools:text="12/12/12 10:30"
android:gravity="center_horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<TextView
tools:text="this is a share message!"
android:gravity="center_horizontal"
android:id="@+id/share_message"
android:textAppearance="?android:attr/textAppearanceSmall"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<TextView
tools:text="this is a destination"
android:gravity="center_horizontal"
android:textAppearance="?android:attr/textAppearanceSmall"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/share_destination"/>
</LinearLayout>
<LinearLayout android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.75"
android:orientation="horizontal">
<android.support.v7.widget.AppCompatImageView android:layout_width="wrap_content"
android:layout_height="match_parent"
android:src="@drawable/ic_play_arrow_black_24dp"
android:id="@+id/playImageView"/>
<android.support.v7.widget.AppCompatImageView android:layout_width="wrap_content"
android:layout_height="match_parent"
android:paddingLeft="@dimen/globalPaddingLeft"
android:paddingStart="@dimen/globalPaddingLeft"
android:src="@drawable/ic_stop_black_24dp"
android:id="@+id/stopImageView"/>
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
</FrameLayout>
@@ -51,11 +51,12 @@
<string name="view_notice_modification_title">Zuletzt geändert:</string>
<string name="zoom_angle">Zoom: %1$d Winkel: %2$g</string>
<string name="notice_notification_title">Maptology News</string>
<string name="until">bis</string>
<string name="until">Bis</string>
<string name="drawer_title">Navigation</string>
<string name="drawer_close">Navigation schließen</string>
<string name="drawer_open">Navigation öffnen</string>
<string name="gps_off">Keine GPS, Bitte einschalten</string>
<string name="link">Link</string>
<string name="send">Senden</string>
<string name="start">Von</string>
</resources>
+2 -5
View File
@@ -44,7 +44,6 @@
<string name="nav_user_none">Not signed in</string>
<string name="nav_user_error">Not connected</string>
<!--Share Fragment-->
<string name="share_message">Message</string>
<string name="share_destination">Destination</string>
@@ -75,11 +74,9 @@
<string name="share_database_error">database error, Try again later</string>
<string name="expiration_time">Expiration Time</string>
<string name="share_to">Share to</string>
<string name="until">until</string>
<string name="until">Until</string>
<string name="select_an_action">Select an action</string>
<string name="start">From</string>
<!-- Settings -->
<string name="setting_category_privacy">Privacy</string>