login screen for phone layout (portrait) should be finished

This commit is contained in:
Peter Siegmund committed 2015-08-11 12:26:43 +02:00
1 parent a690c90fdb
commit 8995fda313
9 files changed
+329 -69

No files matched your search

@@ -29,7 +29,6 @@
android:layout_alignParentBottom="true"
android:background="@drawable/gradient"
android:padding="@dimen/default_padding"
android:shadowColor="@color/constant_black"
android:text="@string/login_text"
android:textColor="@color/constant_white"
android:textSize="@dimen/textSize_40"/>
@@ -45,7 +44,6 @@
android:drawablePadding="@dimen/default_padding_half"
android:gravity="center_vertical"
android:padding="@dimen/default_padding"
android:shadowColor="@color/constant_black"
android:text="@string/login_sub_text"
android:textColor="@color/constant_white"
android:textSize="@dimen/textSize_40"/>
@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="@dimen/listView_row_height"
android:background="?sap_gray_black_30">
<ImageView
android:id="@+id/checked"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:paddingRight="@dimen/default_padding"
android:src="?check_18dp"
android:visibility="invisible"
tools:visibility="visible"/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="@dimen/default_margin"
android:layout_marginRight="@dimen/default_margin"
android:layout_toLeftOf="@id/checked"
android:gravity="center_vertical">
<TextView
android:id="@+id/list_item"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:textColor="?white"
android:textSize="@dimen/textSize_26"
tools:text="ListItem"/>
<TextView
android:id="@+id/list_item_subtitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@id/list_item"
android:textColor="?sap_light_gray"
android:textSize="@dimen/textSize_18"
android:visibility="gone"
tools:text="ListItemSubtitle"
tools:visibility="visible"/>
</RelativeLayout>
<View
android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_alignParentBottom="true"
android:layout_marginLeft="@dimen/default_margin"
android:layout_marginRight="@dimen/default_margin"
android:background="?sap_gray"/>
</RelativeLayout>
@@ -0,0 +1,181 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?sap_gray">
<RelativeLayout
android:id="@+id/event_header"
android:layout_width="match_parent"
android:layout_height="@dimen/selector_header_height">
<TextView
android:id="@+id/label_event"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:paddingLeft="@dimen/default_padding"
android:paddingRight="@dimen/default_padding"
android:text="@string/label_login_events"
android:textAppearance="?textNormal"/>
<ImageView
android:id="@+id/icon_event"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:paddingLeft="@dimen/default_padding"
android:paddingRight="@dimen/default_padding"
android:src="@drawable/ic_arrow_drop_down_grey600_24dp"/>
<TextView
android:id="@+id/selected_event"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toLeftOf="@id/icon_event"
android:layout_toRightOf="@+id/label_event"
android:gravity="right"
android:textColor="?white"
android:textSize="@dimen/textSize_22"
tools:text="Test-Event"/>
</RelativeLayout>
<View
android:id="@+id/event_line"
android:layout_width="match_parent"
android:layout_height="@dimen/thick_line"
android:layout_below="@id/event_header"
android:background="?black"/>
<FrameLayout
android:id="@+id/event_fragment"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_alignParentEnd="true"
android:layout_below="@id/event_line"
android:background="?sap_gray_black_30"/>
<RelativeLayout
android:id="@+id/area_header"
android:layout_width="match_parent"
android:layout_height="@dimen/selector_header_height"
android:layout_below="@id/event_fragment">
<TextView
android:id="@+id/label_area"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:paddingLeft="@dimen/default_padding"
android:paddingRight="@dimen/default_padding"
android:text="@string/label_login_course_area"
android:textAppearance="?textNormal"/>
<ImageView
android:id="@+id/icon_area"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:paddingLeft="@dimen/default_padding"
android:paddingRight="@dimen/default_padding"
android:src="@drawable/ic_arrow_drop_down_grey600_24dp"/>
<TextView
android:id="@+id/selected_area"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toLeftOf="@id/icon_area"
android:layout_toRightOf="@id/label_area"
android:gravity="right"
android:textColor="?white"
android:textSize="@dimen/textSize_22"
tools:text="Selected Area"/>
</RelativeLayout>
<View
android:id="@+id/area_line"
android:layout_width="match_parent"
android:layout_height="@dimen/thick_line"
android:layout_below="@id/area_header"
android:background="?black"/>
<FrameLayout
android:id="@+id/area_fragment"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_below="@id/area_line"
android:background="?sap_gray_black_30"/>
<RelativeLayout
android:id="@+id/position_header"
android:layout_width="match_parent"
android:layout_height="@dimen/selector_header_height"
android:layout_below="@id/area_fragment">
<TextView
android:id="@+id/label_position"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:paddingLeft="@dimen/default_padding"
android:paddingRight="@dimen/default_padding"
android:text="@string/label_login_position"
android:textAppearance="?textNormal"/>
<ImageView
android:id="@+id/icon_position"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:paddingLeft="@dimen/default_padding"
android:paddingRight="@dimen/default_padding"
android:src="@drawable/ic_arrow_drop_down_grey600_24dp"/>
<TextView
android:id="@+id/selected_position"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toLeftOf="@id/icon_position"
android:layout_toRightOf="@id/label_position"
android:gravity="right"
android:textColor="?white"
android:textSize="@dimen/textSize_22"
tools:text="Viewer"/>
</RelativeLayout>
<View
android:id="@+id/position_line"
android:layout_width="match_parent"
android:layout_height="@dimen/thick_line"
android:layout_below="@id/position_header"
android:background="?black"/>
<FrameLayout
android:id="@+id/position_fragment"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_below="@id/position_line"
android:background="?sap_gray_black_30"/>
<Button
android:id="@+id/login_submit"
style="?attr/buttonSolidNormal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_marginBottom="@dimen/default_margin_twice"
android:layout_marginRight="@dimen/default_margin_twice"
android:enabled="false"
android:text="@string/sign_up"
android:textSize="@dimen/textSize_26"
android:visibility="visible"/>
</RelativeLayout>
@@ -32,30 +32,10 @@
android:paddingLeft="@dimen/default_padding_half"
android:paddingRight="@dimen/default_padding_half"
android:paddingTop="@dimen/default_padding"
android:shadowColor="@color/constant_black"
android:text="@string/login_text"
android:textColor="@color/constant_white"
android:textSize="@dimen/textSize_40"/>
<TextView
android:id="@+id/backdrop_subtitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:alpha="0"
android:background="@drawable/gradient"
android:drawableLeft="@drawable/ic_assignment_white_48dp"
android:drawablePadding="@dimen/default_padding_half"
android:gravity="center_vertical"
android:paddingBottom="@dimen/default_padding"
android:paddingLeft="@dimen/default_padding_half"
android:paddingRight="@dimen/default_padding_half"
android:paddingTop="@dimen/default_padding"
android:shadowColor="@color/constant_black"
android:text="@string/login_sub_text"
android:textColor="@color/constant_white"
android:textSize="@dimen/textSize_40"/>
<LinearLayout
android:id="@+id/button_bar"
android:layout_width="wrap_content"
@@ -78,6 +58,24 @@
android:src="@drawable/ic_more_vert_white_48dp"/>
</LinearLayout>
<TextView
android:id="@+id/backdrop_subtitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:alpha="0"
android:layout_toLeftOf="@id/button_bar"
android:drawableLeft="@drawable/ic_assignment_white_48dp"
android:drawablePadding="@dimen/default_padding_half"
android:gravity="center_vertical"
android:paddingBottom="@dimen/default_padding"
android:paddingLeft="@dimen/default_padding_half"
android:paddingRight="@dimen/default_padding_half"
android:paddingTop="@dimen/default_padding"
android:text="@string/login_sub_text"
android:textColor="@color/constant_white"
android:textSize="@dimen/textSize_40"/>
<View
android:id="@+id/line"
android:layout_width="match_parent"
@@ -3,22 +3,34 @@
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="@dimen/listView_row_height"
android:layout_height="wrap_content"
android:minHeight="@dimen/listView_row_height"
android:background="?sap_gray_black_30">
<ImageView
android:id="@+id/checked"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:paddingRight="@dimen/default_padding_half"
android:src="?check_18dp"
android:visibility="invisible"
tools:visibility="visible"/>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_marginLeft="@dimen/default_margin"
android:layout_marginRight="@dimen/default_margin"
android:gravity="center_vertical">
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/default_margin_half"
android:layout_marginRight="@dimen/default_margin_half"
android:layout_toLeftOf="@id/checked"
android:layout_centerVertical="true">
<TextView
android:id="@+id/list_item"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:textColor="?white"
android:textSize="@dimen/textSize_26"
tools:text="ListItem"/>
@@ -36,22 +48,11 @@
tools:visibility="visible"/>
</RelativeLayout>
<ImageView
android:id="@+id/checked"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:paddingRight="@dimen/default_padding"
android:src="?check_18dp"
android:visibility="invisible"
tools:visibility="visible"/>
<View
android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_alignParentBottom="true"
android:layout_marginLeft="@dimen/default_margin"
android:layout_marginRight="@dimen/default_margin"
android:layout_marginLeft="@dimen/default_margin_half"
android:layout_marginRight="@dimen/default_margin_half"
android:background="?sap_gray"/>
</RelativeLayout>
@@ -16,7 +16,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:paddingLeft="@dimen/default_padding"
android:paddingLeft="@dimen/default_padding_half"
android:paddingRight="@dimen/default_padding_half"
android:text="@string/label_login_events"
android:textAppearance="?textNormal"/>
@@ -26,7 +27,8 @@
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:paddingRight="@dimen/default_padding"
android:paddingLeft="@dimen/default_padding_half"
android:paddingRight="@dimen/default_padding_half"
android:src="@drawable/ic_arrow_drop_down_grey600_24dp"/>
<TextView
@@ -37,7 +39,7 @@
android:layout_toLeftOf="@id/icon_event"
android:layout_toRightOf="@+id/label_event"
android:gravity="right"
android:paddingRight="@dimen/default_padding"
android:singleLine="true"
android:textColor="?white"
android:textSize="@dimen/textSize_22"
tools:text="Test-Event"/>
@@ -69,7 +71,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:paddingLeft="@dimen/default_padding"
android:paddingLeft="@dimen/default_padding_half"
android:paddingRight="@dimen/default_padding_half"
android:text="@string/label_login_course_area"
android:textAppearance="?textNormal"/>
@@ -79,7 +82,8 @@
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:paddingRight="@dimen/default_padding"
android:paddingLeft="@dimen/default_padding_half"
android:paddingRight="@dimen/default_padding_half"
android:src="@drawable/ic_arrow_drop_down_grey600_24dp"/>
<TextView
@@ -90,7 +94,7 @@
android:layout_toLeftOf="@id/icon_area"
android:layout_toRightOf="@id/label_area"
android:gravity="right"
android:paddingRight="@dimen/default_padding"
android:singleLine="true"
android:textColor="?white"
android:textSize="@dimen/textSize_22"
tools:text="Selected Area"/>
@@ -121,7 +125,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:paddingLeft="@dimen/default_padding"
android:paddingLeft="@dimen/default_padding_half"
android:paddingRight="@dimen/default_padding_half"
android:text="@string/label_login_position"
android:textAppearance="?textNormal"/>
@@ -131,7 +136,8 @@
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:paddingRight="@dimen/default_padding"
android:paddingLeft="@dimen/default_padding_half"
android:paddingRight="@dimen/default_padding_half"
android:src="@drawable/ic_arrow_drop_down_grey600_24dp"/>
<TextView
@@ -142,7 +148,7 @@
android:layout_toLeftOf="@id/icon_position"
android:layout_toRightOf="@id/label_position"
android:gravity="right"
android:paddingRight="@dimen/default_padding"
android:singleLine="true"
android:textColor="?white"
android:textSize="@dimen/textSize_22"
tools:text="Viewer"/>
@@ -168,11 +174,9 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginBottom="@dimen/default_margin_twice"
android:layout_marginEnd="@dimen/default_margin_twice"
android:layout_marginRight="@dimen/default_margin_twice"
android:layout_marginBottom="@dimen/default_margin"
android:layout_marginRight="@dimen/default_margin"
android:enabled="false"
android:text="@string/sign_up"
android:textSize="@dimen/textSize_26"
@@ -9,7 +9,7 @@
<dimen name="listView_side_padding">100dp</dimen>
<dimen name="listView_row_padding">20dp</dimen>
<dimen name="listView_row_height">85dp</dimen>
<dimen name="selector_header_height">100dp</dimen>
<dimen name="selector_header_height">75dp</dimen>
<dimen name="preference_margin">0dp</dimen>
@@ -19,14 +19,14 @@
<dimen name="thick_line">2dp</dimen>
<dimen name="logo_size">75dp</dimen>
<dimen name="textSize_14">14sp</dimen> <!-- XXSmall -->
<dimen name="textSize_18">18sp</dimen> <!-- XSmall -->
<dimen name="textSize_20">20sp</dimen>
<dimen name="textSize_22">22sp</dimen> <!-- Small -->
<dimen name="textSize_26">26sp</dimen> <!-- Normal -->
<dimen name="textSize_32">32sp</dimen> <!-- Large -->
<dimen name="textSize_40">24sp</dimen> <!-- XLarge -->
<dimen name="textSize_72">72sp</dimen>
<dimen name="textSize_14">12sp</dimen> <!-- XXSmall -->
<dimen name="textSize_18">14sp</dimen> <!-- XSmall -->
<dimen name="textSize_20">16sp</dimen>
<dimen name="textSize_22">18sp</dimen> <!-- Small -->
<dimen name="textSize_26">22sp</dimen> <!-- Normal -->
<dimen name="textSize_32">24sp</dimen> <!-- Large -->
<dimen name="textSize_40">26sp</dimen> <!-- XLarge -->
<dimen name="textSize_72">32sp</dimen>
<dimen name="setup_text_width">150dp</dimen>
@@ -11,8 +11,10 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import com.sap.sailing.android.shared.util.ViewHelper;
import com.sap.sailing.domain.base.EventBase;
import com.sap.sailing.racecommittee.app.R;
import com.sap.sse.common.Named;
@@ -35,10 +37,11 @@ public class NamedArrayAdapter<T extends Named> extends ArrayAdapter<T> {
LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView = inflater.inflate(R.layout.login_list_item, parent, false);
holder = new ViewHolder();
holder.text = (TextView) convertView.findViewById(R.id.list_item);
holder.subText = (TextView) convertView.findViewById(R.id.list_item_subtitle);
holder.text = ViewHelper.get(convertView, R.id.list_item);
holder.subText = ViewHelper.get(convertView, R.id.list_item_subtitle);
holder.checked = ViewHelper.get(convertView, R.id.checked);
convertView.setTag(holder);
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
@@ -59,6 +62,14 @@ public class NamedArrayAdapter<T extends Named> extends ArrayAdapter<T> {
holder.subText.setVisibility(View.GONE);
}
if (holder.checked != null) {
if (isChecked == position) {
holder.checked.setVisibility(View.VISIBLE);
} else {
holder.checked.setVisibility(View.GONE);
}
}
if (holder.subText != null && item instanceof EventBase) {
EventBase eventBase = (EventBase) item;
String dateString = null;
@@ -73,12 +84,12 @@ public class NamedArrayAdapter<T extends Named> extends ArrayAdapter<T> {
if (startDate.get(Calendar.MONTH) != endDate.get(Calendar.MONTH)) {
end = endDate.getDisplayName(Calendar.MONTH, Calendar.LONG, locale);
}
if (startDate.get(Calendar.DATE) != endDate.get(Calendar.DATE)) {
if (startDate.get(Calendar.MONTH) != endDate.get(Calendar.MONTH) || startDate.get(Calendar.DATE) != endDate.get(Calendar.DATE)) {
end += " " + endDate.get(Calendar.DATE);
}
dateString = String.format("%s %s %s", start , (!TextUtils.isEmpty(end.trim())) ? "-" : "", end.trim());
}
holder.subText.setText(String.format("%s %s %s", eventBase.getVenue().getName().trim(), (!TextUtils.isEmpty(dateString) ? ", " : ""), (!TextUtils.isEmpty(dateString) ? dateString : "")));
holder.subText.setText(String.format("%s%s %s", eventBase.getVenue().getName().trim(), (!TextUtils.isEmpty(dateString) ? ", " : ""), (!TextUtils.isEmpty(dateString) ? dateString : "")));
holder.subText.setAlpha(isEnabled(position) ? 1.0f : 0.2f);
holder.subText.setVisibility(View.VISIBLE);
}
@@ -93,6 +104,7 @@ public class NamedArrayAdapter<T extends Named> extends ArrayAdapter<T> {
static class ViewHolder {
TextView text;
TextView subText;
ImageView checked;
}
}
@@ -105,6 +105,14 @@ public class LoginBackdrop extends Fragment {
Method setVerticalOffset = listPopupClass.getDeclaredMethod("setVerticalOffset", argTypes);
setVerticalOffset.invoke(listPopup, -height);
@SuppressWarnings("unchecked")
int width = (Integer) listPopupClass.getDeclaredMethod("getWidth").invoke(listPopup);
width -= view.getWidth();
// Invoke setHorizontalOffset() with the negative height to move up by that distance
@SuppressWarnings("unchecked")
Method setHorizontalOffset = listPopupClass.getDeclaredMethod("setHorizontalOffset", argTypes);
setHorizontalOffset.invoke(listPopup, -width);
// Invoke show() to update the window's position
@SuppressWarnings("unchecked")
Method show = listPopupClass.getDeclaredMethod("show");