Fixed issue with favorite points duplicates

This commit is contained in:
Bars107 2014-11-13 17:42:39 +02:00
parent e83ef8cb51
commit 6b62ef5536
3 changed files with 7 additions and 5 deletions

View file

@ -3,7 +3,7 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent"
android:background="@color/color_white"
android:background="@drawable/dashboard_button"
android:layout_marginTop="1dp"
android:layout_height="50dp">
<ImageView android:id="@+id/icon"

View file

@ -11,7 +11,7 @@
<LinearLayout android:id="@+id/search"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg_cardui"
android:layout_marginBottom="6dp">
@ -22,7 +22,7 @@
android:layout_height="38dp"
android:layout_width="wrap_content"/>
<LinearLayout android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_width="match_parent"
android:background="@color/dashboard_divider"
android:layout_height="90dp">
<Button android:id="@+id/poi"

View file

@ -37,7 +37,7 @@ public class DashboardActivity extends SherlockFragmentActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.dashboard);
getSupportActionBar().setTitle(R.string.app_version);
getSupportActionBar().setTitle(R.string.app_name);
ColorDrawable color = new ColorDrawable(Color.parseColor("#ff8f00"));
getSupportActionBar().setBackgroundDrawable(color);
getSupportActionBar().setIcon(android.R.color.transparent);
@ -64,6 +64,8 @@ public class DashboardActivity extends SherlockFragmentActivity {
private void setupFavorites(){
final FavouritesDbHelper helper = getMyApplication().getFavorites();
final List<FavouritePoint> points = helper.getFavouritePoints();
LinearLayout favorites = (LinearLayout) findViewById(R.id.favorites);
favorites.removeAllViews();
if (points.size() == 0){
(findViewById(R.id.main_fav)).setVisibility(View.GONE);
return;
@ -75,7 +77,7 @@ public class DashboardActivity extends SherlockFragmentActivity {
}
}
LinearLayout favorites = (LinearLayout) findViewById(R.id.favorites);
for (final FavouritePoint point : points) {
LayoutInflater inflater = getLayoutInflater();
View view = inflater.inflate(R.layout.dash_fav_list, null, false);