Page Menu
Home
GitPull.it
Search
Configure Global Search
Log In
Files
F13365676
D17.1779724702.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Authored By
Unknown
Size
5 KB
Referenced Files
None
Subscribers
None
D17.1779724702.diff
View Options
diff --git a/res/drawable-hdpi/ic_star_orange.png b/res/drawable-hdpi/ic_star_orange.png
new file mode 100644
diff --git a/res/drawable-hdpi/ic_star_outline_orange.png b/res/drawable-hdpi/ic_star_outline_orange.png
new file mode 100644
diff --git a/res/drawable-mdpi/ic_star_orange.png b/res/drawable-mdpi/ic_star_orange.png
new file mode 100644
diff --git a/res/drawable-mdpi/ic_star_outline_orange.png b/res/drawable-mdpi/ic_star_outline_orange.png
new file mode 100644
diff --git a/res/drawable-xhdpi/ic_star_orange.png b/res/drawable-xhdpi/ic_star_orange.png
new file mode 100644
diff --git a/res/drawable-xhdpi/ic_star_outline_orange.png b/res/drawable-xhdpi/ic_star_outline_orange.png
new file mode 100644
diff --git a/res/drawable-xxhdpi/ic_star_orange.png b/res/drawable-xxhdpi/ic_star_orange.png
new file mode 100644
diff --git a/res/drawable-xxhdpi/ic_star_outline_orange.png b/res/drawable-xxhdpi/ic_star_outline_orange.png
new file mode 100644
diff --git a/res/drawable-xxxhdpi/ic_star_orange.png b/res/drawable-xxxhdpi/ic_star_orange.png
new file mode 100644
diff --git a/res/drawable-xxxhdpi/ic_star_outline_orange.png b/res/drawable-xxxhdpi/ic_star_outline_orange.png
new file mode 100644
diff --git a/res/layout/fragment_list_view.xml b/res/layout/fragment_list_view.xml
--- a/res/layout/fragment_list_view.xml
+++ b/res/layout/fragment_list_view.xml
@@ -4,18 +4,36 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
>
+
<TextView
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_marginEnd="16dp"
- android:layout_marginLeft="16dp"
- android:layout_marginRight="16dp"
- android:layout_marginStart="16dp"
- android:layout_marginTop="10dp"
- android:id="@+id/messageTextView" android:gravity="center_vertical"
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:minHeight="48dp"
- android:layout_marginBottom="10dp" />
+ android:id="@+id/messageTextView"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="16dp"
+ android:layout_marginLeft="16dp"
+ android:layout_marginTop="10dp"
+ android:layout_marginEnd="307dp"
+ android:layout_marginRight="10dp"
+ android:layout_marginBottom="10dp"
+ android:layout_toStartOf="@+id/addToFavorites"
+ android:layout_toLeftOf="@+id/addToFavorites"
+ android:gravity="center_vertical"
+ android:minHeight="48dp"
+ android:textAppearance="?android:attr/textAppearanceMedium" />
+
+ <ImageButton
+ android:id="@+id/addToFavorites"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_above="@+id/resultsListView"
+ android:layout_alignParentRight="true"
+ android:layout_marginLeft="16dp"
+ android:layout_marginTop="10dp"
+ android:layout_marginRight="16dp"
+ android:layout_marginBottom="16dp"
+ android:background="@android:color/transparent"
+ fab:srcCompat="@android:drawable/btn_star_big_off" />
+
<ListView
android:layout_below="@id/messageTextView"
android:id="@+id/resultsListView"
diff --git a/src/it/reyboz/bustorino/fragments/ResultListFragment.java b/src/it/reyboz/bustorino/fragments/ResultListFragment.java
--- a/src/it/reyboz/bustorino/fragments/ResultListFragment.java
+++ b/src/it/reyboz/bustorino/fragments/ResultListFragment.java
@@ -59,6 +59,7 @@
private boolean adapterSet = false;
protected FragmentListener mListener;
private TextView messageTextView;
+ private ImageButton addToFavorites;
private FloatingActionButton fabutton;
private ListView resultsListView;
@@ -125,6 +126,7 @@
Bundle savedInstanceState) {
View root = inflater.inflate(R.layout.fragment_list_view, container, false);
messageTextView = (TextView) root.findViewById(R.id.messageTextView);
+ addToFavorites = (ImageButton) root.findViewById(R.id.addToFavorites);
if (adapterKind != null) {
resultsListView = (ListView) root.findViewById(R.id.resultsListView);
@@ -294,8 +296,8 @@
switch (adapterKind) {
case ARRIVALS:
final ActivityMain activ = (ActivityMain) getActivity();
- messageTextView.setClickable(true);
- messageTextView.setOnClickListener(new View.OnClickListener() {
+ addToFavorites.setClickable(true);
+ addToFavorites.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mListener.addLastStopToFavorites();
@@ -303,10 +305,10 @@
});
break;
case STOPS:
- messageTextView.setClickable(false);
+ addToFavorites.setClickable(false);
break;
}
messageTextView.setVisibility(View.VISIBLE);
}
-}
+}
\ No newline at end of file
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, May 25, 17:58 (15 h, 24 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1920811
Default Alt Text
D17.1779724702.diff (5 KB)
Attached To
Mode
D17: Added favorites button
Attached
Detach File
Event Timeline