Project

General

Profile

« Previous | Next » 

Revision f48b2bd0

Added by Leszek Koltunski 1 day ago

progress with remembering solves.

View differences:

src/main/java/org/distorted/main/MainSolvesPopup.java
10 10
package org.distorted.main;
11 11

  
12 12
import android.content.Context;
13
import android.content.res.Resources;
14
import android.graphics.drawable.ColorDrawable;
13 15
import android.util.TypedValue;
14 16
import android.view.Gravity;
15 17
import android.view.LayoutInflater;
......
58 60
    mPopup = new PopupWindow(act);
59 61
    mPopup.setContentView(layout);
60 62
    mPopup.setFocusable(true);
61
    mLayout= layout.findViewById(R.id.dialog_scrollable_main_layout);
62 63

  
64
    mLayout= layout.findViewById(R.id.dialog_scrollable_main_layout);
63 65
    fillLayout(act,array);
64 66
    }
65 67

  
......
83 85
        {
84 86
        JSONObject object = array.getJSONObject(s);
85 87
        long time = object.getLong("time");
86
        View pane = createOldPane(act, time, pL, pT);
88
        View pane = createOldPane(act, s, time, pL, pT);
87 89
        mLayout.addView(pane);
88 90
        }
89 91
      }
......
114 116

  
115 117
///////////////////////////////////////////////////////////////////////////////////////////////////
116 118

  
117
  private View createOldPane(MainActivity act, long time, LinearLayout.LayoutParams pView, LinearLayout.LayoutParams pText)
119
  private View createOldPane(MainActivity act, int index, long time, LinearLayout.LayoutParams pView, LinearLayout.LayoutParams pText)
118 120
    {
119 121
    View view = act.getLayoutInflater().inflate(R.layout.dialog_solve_old_pane, null);
120 122
    TextView title = view.findViewById(R.id.solves_pane_title);
......
143 145
        @Override
144 146
        public void onClick(View v)
145 147
          {
146
          android.util.Log.e("D", "DELETE");
148
          mLayout.removeViewAt(index);
147 149
          }
148 150
        });
149 151

  
src/main/res/layout/dialog_scrollable_solves.xml
13 13
        android:id="@+id/dialog_scrollable_main_layout"
14 14
        android:layout_width="match_parent"
15 15
        android:layout_height="wrap_content"
16
        android:background="?veryDarkC"
16
        android:backgroundTint="?darkC"
17 17
        android:orientation="vertical">
18 18
    </LinearLayout>
19 19

  
src/main/res/layout/dialog_solve_new_pane.xml
36 36
             android:id="@+id/solves_pane_play"
37 37
             android:layout_width="match_parent"
38 38
             android:layout_height="match_parent"
39
             android:backgroundTint="?veryDarkC"
39
             android:backgroundTint="?darkC"
40 40
             android:insetTop="0dp"
41 41
             android:insetBottom="0dp"
42 42
             android:text="@string/play"/>
src/main/res/layout/dialog_solve_old_pane.xml
53 53
             android:layout_width="match_parent"
54 54
             android:layout_height="0dp"
55 55
             android:layout_weight="1.0"
56
             android:backgroundTint="?veryDarkC"
56
             android:backgroundTint="?darkC"
57 57
             android:insetTop="0dp"
58 58
             android:text="@string/delete"/>
59 59

  
......
62 62
             android:layout_width="match_parent"
63 63
             android:layout_height="0dp"
64 64
             android:layout_weight="1.0"
65
             android:backgroundTint="?veryDarkC"
65
             android:backgroundTint="?darkC"
66 66
             android:insetBottom="0dp"
67 67
             android:text="@string/resume"/>
68 68

  

Also available in: Unified diff