Skip to content

Commit e6602b3

Browse files
committed
Before implementing material design
1 parent c136e7f commit e6602b3

File tree

6 files changed

+84
-43
lines changed

6 files changed

+84
-43
lines changed

app/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ dependencies {
2626
implementation fileTree(dir: "libs", include: ["*.jar"])
2727
implementation 'androidx.appcompat:appcompat:1.1.0'
2828
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
29+
implementation 'com.google.android.material:material:1.2.0-alpha05'
2930
testImplementation 'junit:junit:4.12'
3031
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
3132
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'

app/src/main/java/com/citrix/taskshiftonandroid/MainActivity.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,29 +25,29 @@ protected void onCreate(Bundle savedInstanceState) {
2525
List<Map<String, Object>> list = new ArrayList<Map<String,Object>>();
2626
Map<String, Object> map = new HashMap<String,Object>();
2727
map.put("logo",R.drawable.jira);
28-
map.put("storyType", "epic");
28+
map.put("ticketId","TS-6");
29+
map.put("storyType", R.drawable.epic);
2930
map.put("storySummary", "Investigate how blue tooth works on Android");
30-
map.put("storyOperater", "Li Tian");
3131
list.add(map);
3232

3333
map = new HashMap<String,Object>();
3434
map.put("logo",R.drawable.jira);
35-
map.put("storyType", "story");
35+
map.put("ticketId","TS-11");
36+
map.put("storyType", R.drawable.story);
3637
map.put("storySummary", "Develop task list UI");
37-
map.put("storyOperater", "Yuhan Lu");
3838
list.add(map);
3939

4040
map = new HashMap<String,Object>();
4141
map.put("logo",R.drawable.jira);
42-
map.put("storyType", "story");
42+
map.put("ticketId","TS-13");
43+
map.put("storyType", R.drawable.story);
4344
map.put("storySummary", "Get tickets from Jira service from Android application");
44-
map.put("storyOperater", "Haoran Li");
4545
list.add(map);
4646

4747
//adapter
4848
SimpleAdapter adapter = new SimpleAdapter(this,list,R.layout.singletask,
49-
new String[] {"logo", "storyType","storySummary","storyOperater"},
50-
new int[] {R.id.taskPicture,R.id.taskType, R.id.taskSummary, R.id.taskOperater}
49+
new String[] {"logo","ticketId", "storyType","storySummary"},
50+
new int[] {R.id.taskPicture,R.id.taskTicketId,R.id.taskType, R.id.taskSummary}
5151
);
5252

5353
taskList.setAdapter(adapter);

app/src/main/res/drawable/epic.xml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:width="16dp"
3+
android:height="16dp"
4+
android:viewportWidth="16"
5+
android:viewportHeight="16">
6+
<path
7+
android:pathData="M3,1L13,1A2,2 0,0 1,15 3L15,13A2,2 0,0 1,13 15L3,15A2,2 0,0 1,1 13L1,3A2,2 0,0 1,3 1z"
8+
android:strokeWidth="1"
9+
android:fillColor="#904EE2"
10+
android:fillType="evenOdd"
11+
android:strokeColor="#00000000"/>
12+
<path
13+
android:pathData="M10.9233,7.7566L10.9213,7.7526C10.9673,7.6776 11.0003,7.5946 11.0003,7.4996C11.0003,7.2236 10.7763,6.9996 10.5003,6.9996L8.0003,6.9996L8.0003,4.4996C8.0003,4.2236 7.7763,3.9996 7.5003,3.9996C7.3283,3.9996 7.1853,4.0916 7.0953,4.2226C7.0673,4.2636 7.0443,4.3056 7.0293,4.3526L5.0813,8.2366L5.0833,8.2396C5.0353,8.3166 5.0003,8.4026 5.0003,8.4996C5.0003,8.7766 5.2243,8.9996 5.5003,8.9996L8.0003,8.9996L8.0003,11.4996C8.0003,11.7766 8.2243,11.9996 8.5003,11.9996C8.6793,11.9996 8.8293,11.9006 8.9183,11.7586L8.9213,11.7596L8.9343,11.7336C8.9453,11.7126 8.9573,11.6936 8.9653,11.6716L10.9233,7.7566Z"
14+
android:strokeWidth="1"
15+
android:fillColor="#FFFFFF"
16+
android:fillType="evenOdd"
17+
android:strokeColor="#00000000"/>
18+
</vector>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:width="16dp"
3+
android:height="16dp"
4+
android:viewportWidth="16"
5+
android:viewportHeight="16">
6+
<path
7+
android:pathData="M3,1L13,1A2,2 0,0 1,15 3L15,13A2,2 0,0 1,13 15L3,15A2,2 0,0 1,1 13L1,3A2,2 0,0 1,3 1z"
8+
android:strokeWidth="1"
9+
android:fillColor="#63BA3C"
10+
android:fillType="evenOdd"
11+
android:strokeColor="#00000000"/>
12+
<path
13+
android:pathData="M10,4L6,4C5.448,4 5,4.448 5,5L5,11.5C5,11.776 5.224,12 5.5,12C5.675,12 5.821,11.905 5.91,11.769L5.914,11.77L7.84,9.54C7.92,9.434 8.08,9.434 8.16,9.54L10.086,11.77L10.09,11.769C10.179,11.905 10.325,12 10.5,12C10.776,12 11,11.776 11,11.5L11,5C11,4.448 10.552,4 10,4"
14+
android:strokeWidth="1"
15+
android:fillColor="#FFFFFF"
16+
android:fillType="evenOdd"
17+
android:strokeColor="#00000000"/>
18+
</vector>

app/src/main/res/layout/singletask.xml

Lines changed: 37 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,36 @@
1515

1616
<ImageView
1717
android:id="@+id/taskPicture"
18-
android:layout_width="85dp"
19-
android:layout_height="82dp"
18+
android:layout_width="51dp"
19+
android:layout_height="46dp"
2020
android:layout_alignParentLeft="true"
2121
android:layout_alignParentBottom="true"
22-
android:layout_marginLeft="-1dp"
23-
android:layout_marginBottom="7dp"
22+
android:layout_marginLeft="2dp"
23+
android:layout_marginBottom="34dp"
2424
app:srcCompat="@drawable/jira" />
2525

26+
<TextView
27+
android:id="@+id/taskTicketId"
28+
android:layout_width="77dp"
29+
android:layout_height="wrap_content"
30+
android:layout_alignParentEnd="true"
31+
android:layout_alignParentRight="true"
32+
android:layout_alignParentBottom="true"
33+
android:layout_marginLeft="0dp"
34+
android:layout_marginEnd="212dp"
35+
android:layout_marginRight="212dp"
36+
android:layout_marginBottom="61dp"
37+
android:layout_toRightOf="@id/taskType"
38+
android:text="TextView"
39+
android:textSize="16sp" />
40+
2641
<TextView
2742
android:id="@+id/taskSummary"
28-
android:layout_width="197dp"
29-
android:layout_height="54dp"
43+
android:layout_width="196dp"
44+
android:layout_height="50dp"
3045
android:layout_alignParentBottom="true"
31-
android:layout_marginLeft="-1dp"
32-
android:layout_marginBottom="6dp"
46+
android:layout_marginLeft="10dp"
47+
android:layout_marginBottom="7dp"
3348
android:layout_toRightOf="@+id/taskPicture"
3449
android:ellipsize="end"
3550
android:maxLines="2"
@@ -38,40 +53,27 @@
3853
android:textColor="#3F51B5"
3954
android:textSize="18sp" />
4055

41-
<TextView
56+
<ImageView
4257
android:id="@+id/taskType"
43-
android:layout_width="86dp"
44-
android:layout_height="29dp"
45-
android:layout_marginStart="-2dp"
46-
android:layout_marginLeft="-2dp"
47-
android:layout_toEndOf="@+id/taskPicture"
48-
android:layout_toRightOf="@+id/taskPicture"
49-
android:text="TextView"
50-
android:textColor="#E91E63"
51-
android:textSize="18sp" />
52-
53-
<TextView
54-
android:id="@+id/taskOperater"
55-
android:layout_width="90dp"
56-
android:layout_height="41dp"
57-
android:layout_alignParentEnd="true"
58-
android:layout_alignParentRight="true"
58+
android:layout_width="30dp"
59+
android:layout_height="31dp"
60+
android:layout_alignParentStart="true"
61+
android:layout_alignParentLeft="true"
5962
android:layout_alignParentBottom="true"
60-
android:layout_marginEnd="1dp"
61-
android:layout_marginRight="1dp"
62-
android:layout_marginBottom="18dp"
63-
android:text="TextView"
64-
android:textSize="18sp" />
63+
android:layout_marginStart="63dp"
64+
android:layout_marginLeft="63dp"
65+
android:layout_marginBottom="55dp"
66+
app:srcCompat="@drawable/epic" />
6567

6668
</RelativeLayout>
6769

6870
<RelativeLayout
6971
android:id="@+id/buttonGroup"
7072
android:layout_width="match_parent"
71-
android:layout_height="70dp"
72-
android:layout_centerHorizontal="true"
73-
android:layout_centerVertical="true"
74-
android:gravity="center">
73+
android:layout_height="61dp"
74+
android:layout_centerHorizontal="false"
75+
android:layout_centerVertical="false"
76+
android:gravity="right">
7577

7678
<Button
7779
android:id="@+id/startBut"
@@ -84,7 +86,7 @@
8486
android:id="@+id/doneBut"
8587
android:layout_width="wrap_content"
8688
android:layout_height="wrap_content"
87-
android:layout_marginLeft="61dp"
89+
android:layout_marginLeft="19dp"
8890
android:layout_toRightOf="@id/startBut"
8991
android:text="Done" />
9092
</RelativeLayout>

build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ buildscript {
77
dependencies {
88
classpath "com.android.tools.build:gradle:4.0.0"
99

10+
11+
1012
// NOTE: Do not place your application dependencies here; they belong
1113
// in the individual module build.gradle files
1214
}

0 commit comments

Comments
 (0)