Skip to content

Commit cb2bebf

Browse files
committed
added welcome screen with three options.
1 parent b82488c commit cb2bebf

38 files changed

+78
-29
lines changed

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

mobile/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ android {
99
targetSdkVersion 25
1010
multiDexEnabled true
1111

12-
versionCode 5
13-
versionName "1.4"
12+
versionCode 6
13+
versionName "1.5"
1414
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
1515
}
1616
buildTypes {

mobile/mobile-release.apk

1.38 KB
Binary file not shown.

mobile/wear-release.apk

-272 Bytes
Binary file not shown.

wear/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ android {
88
minSdkVersion 23
99
targetSdkVersion 25
1010

11-
versionCode 5
12-
versionName "1.4"
11+
versionCode 6
12+
versionName "1.5"
1313
}
1414
buildTypes {
1515
release {

wear/src/main/java/mnf/android/wearnote/Adapter/RecycleAdapterMenu.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import android.view.LayoutInflater;
99
import android.view.View;
1010
import android.view.ViewGroup;
11+
import android.widget.ImageView;
1112
import android.widget.TextView;
1213

1314
import java.util.List;
@@ -35,10 +36,12 @@ public RecycleAdapterMenu(Context context, List<MenuModel> models) {
3536
// Provide a reference to the type of views you're using
3637
public static class ItemViewHolder extends WearableRecyclerView.ViewHolder {
3738
private TextView textView;
39+
private ImageView iconIV;
3840
public ItemViewHolder(View itemView) {
3941
super(itemView);
4042
// find the text view within the custom item's layout
4143
textView = (TextView) itemView.findViewById(R.id.name);
44+
iconIV = (ImageView) itemView.findViewById(R.id.circle);
4245
}
4346
}
4447

@@ -62,6 +65,7 @@ public void onBindViewHolder(ItemViewHolder holder, int position) {
6265
Log.e("TAG","onBindViewHolder position = "+position);
6366
MenuModel item = mDataset.get(position);
6467
holder.textView.setText(item.getTitle());
68+
holder.iconIV.setImageDrawable(mContext.getResources().getDrawable(item.getIcon()));
6569

6670
}
6771

wear/src/main/java/mnf/android/wearnote/Fragment/NewNoteFragment.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ public void onCreate(Bundle savedInstanceState) {
6565
public View onCreateView(LayoutInflater inflater, ViewGroup container,
6666
Bundle savedInstanceState) {
6767
// Inflate the layout for this fragment
68-
return inflater.inflate(R.layout.new_note_fragment, container, false);
68+
View v = inflater.inflate(R.layout.new_note_fragment, container, false);
69+
70+
return v;
6971
}
7072

7173
// TODO: Rename method, update argument and hook method into UI event

wear/src/main/java/mnf/android/wearnote/MainActivity.java

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package mnf.android.wearnote;
22

33
import android.app.Activity;
4+
import android.app.FragmentTransaction;
45
import android.os.Bundle;
56
import android.support.annotation.NonNull;
67
import android.support.annotation.Nullable;
@@ -67,17 +68,18 @@ public void onLayoutInflated(WatchViewStub stub) {
6768

6869
CircularOffsettingHelper circularHelper = new CircularOffsettingHelper();
6970
MyOffsettingHelper myOffsettingHelper = new MyOffsettingHelper();
70-
mRecyclerView.setOffsettingHelper(myOffsettingHelper);
71-
mRecyclerView.setCircularScrollingGestureEnabled(true);
72-
mRecyclerView.setBezelWidth(0.5f);
73-
mRecyclerView.setScrollDegreesPerScreen(90);
71+
mRecyclerView.setOffsettingHelper(myOffsettingHelper);
72+
mRecyclerView.setCircularScrollingGestureEnabled(false);
73+
mRecyclerView.setBezelWidth(1f);
74+
mRecyclerView.setScrollDegreesPerScreen(250);
7475

75-
getFragmentManager().beginTransaction().replace(R.id.containerView,new ListFragment().newInstance("","")).addToBackStack("note").commit();
76+
// getFragmentManager().beginTransaction().replace(R.id.containerView,new ListFragment().newInstance("","")).addToBackStack("note").commit();
7677

7778

7879
final List<MenuModel> listItem = new ArrayList<>();
79-
listItem.add(new MenuModel("1","New Note"));
80-
listItem.add(new MenuModel("2","Notes"));
80+
listItem.add(new MenuModel("1","New Note",R.mipmap.red_add));
81+
listItem.add(new MenuModel("2","Notes",R.mipmap.red_note));
82+
listItem.add(new MenuModel("3","Settings",R.mipmap.red_settr));
8183

8284
mRecyclerView.setAdapter(new RecycleAdapterMenu(this,listItem));
8385

@@ -91,11 +93,17 @@ public void onClick(View view, int position,RecyclerView rv) {
9193
MenuModel menuItem = listItem.get(position);
9294
switch (menuItem.getId()){
9395
case "1":
94-
// getFragmentManager().beginTransaction().replace(R.id.containerView,new NewNoteFragment().newInstance("","")).addToBackStack("new_note").commit();
96+
getFragmentManager().beginTransaction().replace(R.id.containerView,new NewNoteFragment().newInstance("","")).addToBackStack("new_note").commit();
9597
break;
9698
case "2":
97-
// getFragmentManager().beginTransaction().replace(R.id.containerView,new ListFragment().newInstance("","")).addToBackStack("note_list").commit();
99+
FragmentTransaction transNotes = getFragmentManager().beginTransaction();
100+
transNotes.setCustomAnimations(android.R.animator.fade_in,android.R.animator.fade_out);
101+
transNotes.replace(R.id.containerView,new ListFragment().newInstance("","")).addToBackStack("note_list").commit();
98102
break;
103+
case "3":
104+
getFragmentManager().beginTransaction().replace(R.id.containerView,new ListFragment().newInstance("","")).addToBackStack("note_list").commit();
105+
break;
106+
99107

100108
}
101109
//getFragmentManager().beginTransaction().replace(R.id.containerView,new FragmentNote().newInstance(""+noteItem.getIdn(),""+noteItem.getBody())).addToBackStack("note_detail").commit();
@@ -179,7 +187,7 @@ public void updateChild(View child, WearableRecyclerView parent) {
179187
public static class MyOffsettingHelper extends DefaultOffsettingHelper {
180188

181189
/** How much should we scale the icon at most. */
182-
private static final float MAX_ICON_PROGRESS = 0.65f;
190+
private static final float MAX_ICON_PROGRESS = 2f;
183191

184192
private float mProgressToCenter;
185193

wear/src/main/java/mnf/android/wearnote/Model/MenuModel.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ public class MenuModel {
88

99
private String title;
1010
private String id;
11-
public MenuModel(String id,String title){
11+
private int icon;
12+
public MenuModel(String id,String title,int icon){
1213
this.title=title;
1314
this.id=id;
15+
this.icon=icon;
1416
}
1517

1618
public void setTitle(String title){
@@ -28,4 +30,13 @@ public String getId(){
2830
return id;
2931
}
3032

33+
34+
public void setIcon(int icon){
35+
this.icon=icon;
36+
}
37+
38+
public int getIcon(){
39+
return icon;
40+
}
41+
3142
}
408 Bytes
Loading
356 Bytes
Loading
747 Bytes
Loading
276 Bytes
Loading
248 Bytes
Loading
480 Bytes
Loading
413 Bytes
Loading
380 Bytes
Loading
939 Bytes
Loading
742 Bytes
Loading
669 Bytes
Loading
Loading
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:color="@android:color/holo_blue_light">
4+
5+
<item
6+
android:id="@android:id/mask"
7+
android:drawable="@android:color/white" />
8+
</ripple>

wear/src/main/res/layout/activity_main.xml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,12 @@
22
<android.support.wearable.view.BoxInsetLayout
33
xmlns:android="http://schemas.android.com/apk/res/android"
44
xmlns:app="http://schemas.android.com/apk/res-auto"
5-
android:background="@color/black"
5+
android:background="@color/blue_grey900"
66
android:layout_height="match_parent"
77
android:id="@+id/containerView"
88
android:layout_width="match_parent">
99

10-
<TextView
11-
android:id="@+id/text"
12-
android:layout_width="wrap_content"
13-
android:layout_height="wrap_content"
14-
android:text="@string/hello_square" />
10+
1511

1612

1713
<android.support.wearable.view.WearableRecyclerView
Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
11
<mnf.android.wearnote.Tools.WearableListItemLayout
22
xmlns:android="http://schemas.android.com/apk/res/android"
33
android:gravity="center_vertical"
4+
android:background="@drawable/custom_bg"
5+
46
android:layout_width="match_parent"
57
android:layout_height="80dp">
68
<ImageView
79
android:id="@+id/circle"
8-
android:layout_height="20dp"
10+
android:layout_height="45dp"
911
android:layout_margin="16dp"
10-
android:layout_width="20dp"
12+
android:layout_width="45dp"
1113
android:src="@drawable/ic_cc_checkmark"/>
1214
<TextView
1315
android:id="@+id/name"
1416
android:gravity="center_vertical|left"
15-
android:layout_width="wrap_content"
17+
android:layout_width="match_parent"
1618
android:layout_marginRight="16dp"
17-
android:layout_height="match_parent"
19+
android:text="test"
20+
android:layout_height="wrap_content"
1821
android:fontFamily="sans-serif-condensed-light"
1922
android:lineSpacingExtra="-4sp"
2023
android:textColor="@color/white"
21-
android:textSize="16sp"/>
24+
android:textSize="19sp"/>
2225
</mnf.android.wearnote.Tools.WearableListItemLayout>

wear/src/main/res/layout/new_note_fragment.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
android:id="@+id/note_frag_container"
55
android:layout_width="match_parent"
66
android:layout_height="match_parent"
7+
android:background="@color/blue_grey800"
78
tools:context="mnf.android.wearnote.Fragment.FragmentNote">
89

910
<!-- TODO: Update blank fragment layout -->
@@ -26,7 +27,7 @@
2627

2728
<EditText
2829
android:id="@+id/note"
29-
android:textColor="@color/grey800"
30+
android:textColor="@color/white"
3031
app:layout_box="all"
3132
android:gravity="top|left"
3233
android:inputType="textMultiLine"
10.4 KB
Loading
10.6 KB
Loading
Loading
Loading
Loading
10.5 KB
Loading
10.7 KB
Loading
10.3 KB
Loading
10.4 KB
Loading
12.3 KB
Loading
12.2 KB
Loading
12.3 KB
Loading

wear/src/main/res/values/colors.xml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,22 @@
5050

5151

5252

53+
<color name="light_blue800">#0277BD</color>
54+
<color name="light_blue900">#01579B</color>
55+
<color name="light_blue900_dark">#002f6c</color>
56+
57+
58+
<color name="blue_grey50">#ECEFF1</color>
59+
<color name="blue_grey100">#CFD8DC</color>
60+
<color name="blue_grey200">#B0BEC5</color>
61+
<color name="blue_grey300">#90A4AE</color>
62+
<color name="blue_grey400">#78909C</color>
63+
<color name="blue_grey500">#607D8B</color>
64+
<color name="blue_grey600">#546E7A</color>
65+
<color name="blue_grey700">#455A64</color>
66+
<color name="blue_grey800">#37474F</color>
67+
<color name="blue_grey900">#263238</color>
68+
5369

5470

5571

0 commit comments

Comments
 (0)