Commit 6b038e4433703087576aaa067062438a7616b652
1 parent
ba7d7409b2
Exists in
master
and in
1 other branch
update
Showing 50 changed files with 575 additions and 135 deletions Side-by-side Diff
- .idea/modules.xml
- app/build.gradle
- app/src/main/AndroidManifest.xml
- app/src/main/java/com/dinhcv/lifelogpedometer/activity/HistoryContentFragment.java
- app/src/main/java/com/dinhcv/lifelogpedometer/activity/MapFragment.java
- app/src/main/java/com/dinhcv/lifelogpedometer/activity/PedometerActivity.java
- app/src/main/java/com/dinhcv/lifelogpedometer/activity/RankFragment.java
- app/src/main/java/com/dinhcv/lifelogpedometer/activity/TopDateFragment.java
- app/src/main/java/com/dinhcv/lifelogpedometer/activity/WelcomeActivity.java
- app/src/main/java/com/dinhcv/lifelogpedometer/adapter/RankingAdapter.java
- app/src/main/java/com/dinhcv/lifelogpedometer/customview/CircularImageView.java
- app/src/main/res/drawable/back_ic.PNG
- app/src/main/res/drawable/goout_ic.PNG
- app/src/main/res/drawable/home_ic.PNG
- app/src/main/res/drawable/list_ic.PNG
- app/src/main/res/drawable/next_ic.PNG
- app/src/main/res/drawable/step_type_enabled.xml
- app/src/main/res/drawable/tab_color_selector.xml
- app/src/main/res/drawable/test_selector.xml
- app/src/main/res/drawable/walking_ic.PNG
- app/src/main/res/layout/activity_pedometer.xml
- app/src/main/res/layout/customtab.xml
- app/src/main/res/layout/fragment_history.xml
- app/src/main/res/layout/fragment_history_content.xml
- app/src/main/res/layout/fragment_history_detail.xml
- app/src/main/res/layout/fragment_map.xml
- app/src/main/res/layout/fragment_rank.xml
- app/src/main/res/layout/fragment_sns.xml
- app/src/main/res/layout/fragment_sns_create_group.xml
- app/src/main/res/layout/fragment_sns_detail.xml
- app/src/main/res/layout/fragment_sns_my_group.xml
- app/src/main/res/layout/fragment_sns_search.xml
- app/src/main/res/layout/fragment_sns_topic.xml
- app/src/main/res/layout/fragment_top.xml
- app/src/main/res/layout/fragment_top_date.xml
- app/src/main/res/layout/fragment_top_today.xml
- app/src/main/res/layout/history_page_7_content.xml
- app/src/main/res/layout/layout_rank_row.xml
- app/src/main/res/layout/layout_sns_member_row.xml
- app/src/main/res/layout/layout_sns_search_row.xml
- app/src/main/res/layout/layout_sns_topic_row.xml
- app/src/main/res/layout/layout_toolbar.xml
- app/src/main/res/layout/notice_list_item.xml
- app/src/main/res/layout/type_step.xml
- app/src/main/res/mipmap-hdpi/ic_launcher.png
- app/src/main/res/mipmap-mdpi/ic_launcher.png
- app/src/main/res/mipmap-xhdpi/ic_launcher.png
- app/src/main/res/mipmap-xxhdpi/ic_launcher.png
- app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
- app/src/main/res/values/colors.xml
.idea/modules.xml
... | ... | @@ -3,7 +3,7 @@ |
3 | 3 | <component name="ProjectModuleManager"> |
4 | 4 | <modules> |
5 | 5 | <module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" /> |
6 | - <module fileurl="file://$PROJECT_DIR$/lifelog_android.iml" filepath="$PROJECT_DIR$/lifelog_android.iml" /> | |
6 | + <module fileurl="file://$PROJECT_DIR$/lifelog_new.iml" filepath="$PROJECT_DIR$/lifelog_new.iml" /> | |
7 | 7 | <module fileurl="file://D:\Project\Git\lifelog_android\lifelogpedometer.iml" filepath="D:\Project\Git\lifelog_android\lifelogpedometer.iml" /> |
8 | 8 | </modules> |
9 | 9 | </component> |
app/build.gradle
app/src/main/AndroidManifest.xml
... | ... | @@ -12,6 +12,7 @@ |
12 | 12 | <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> |
13 | 13 | <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" /> |
14 | 14 | <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> |
15 | + <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> | |
15 | 16 | |
16 | 17 | <application |
17 | 18 | android:name=".LifeLogApplication" |
app/src/main/java/com/dinhcv/lifelogpedometer/activity/HistoryContentFragment.java
... | ... | @@ -11,6 +11,7 @@ |
11 | 11 | import android.widget.Button; |
12 | 12 | import android.widget.DatePicker; |
13 | 13 | import android.widget.ImageButton; |
14 | +import android.widget.ImageView; | |
14 | 15 | import android.widget.LinearLayout; |
15 | 16 | import android.widget.TextView; |
16 | 17 | |
... | ... | @@ -55,11 +56,11 @@ |
55 | 56 | TextView tvDate; |
56 | 57 | @BindView(R.id.tv_week_day) |
57 | 58 | TextView tvWeekDay; |
58 | - private Button btnFace; | |
59 | - private Button btnTwitter; | |
60 | - private Button btnLine; | |
61 | - private Button btnEmail; | |
62 | - private Button btnOther; | |
59 | + private ImageView btnFace; | |
60 | + private ImageView btnTwitter; | |
61 | + private ImageView btnLine; | |
62 | + private ImageView btnEmail; | |
63 | + private ImageView btnOther; | |
63 | 64 | @BindView(R.id.tv_steps) |
64 | 65 | TextView tvStep; |
65 | 66 | @BindView(R.id.tv_remainingStep) |
... | ... | @@ -139,11 +140,11 @@ |
139 | 140 | |
140 | 141 | |
141 | 142 | private void initView(View view) { |
142 | - btnFace = (Button) view.findViewById(R.id.btn_face); | |
143 | - btnTwitter = (Button) view.findViewById(R.id.btn_twitter); | |
144 | - btnLine = (Button) view.findViewById(R.id.btn_line); | |
145 | - btnEmail = (Button) view.findViewById(R.id.btn_email); | |
146 | - btnOther = (Button) view.findViewById(R.id.btn_other); | |
143 | + btnFace = (ImageView) view.findViewById(R.id.btn_face); | |
144 | + btnTwitter = (ImageView) view.findViewById(R.id.btn_twitter); | |
145 | + btnLine = (ImageView) view.findViewById(R.id.btn_line); | |
146 | + btnEmail = (ImageView) view.findViewById(R.id.btn_email); | |
147 | + btnOther = (ImageView) view.findViewById(R.id.btn_other); | |
147 | 148 | |
148 | 149 | mBarChart = (BarChart) view.findViewById(R.id.chart); |
149 | 150 | } |
app/src/main/java/com/dinhcv/lifelogpedometer/activity/MapFragment.java
1 | 1 | package com.dinhcv.lifelogpedometer.activity; |
2 | 2 | |
3 | +import android.Manifest; | |
3 | 4 | import android.app.Activity; |
4 | 5 | import android.content.Context; |
6 | +import android.content.pm.PackageManager; | |
7 | +import android.location.Location; | |
8 | +import android.location.LocationListener; | |
9 | +import android.location.LocationManager; | |
5 | 10 | import android.os.Bundle; |
6 | 11 | import android.support.annotation.Nullable; |
12 | +import android.support.v4.app.ActivityCompat; | |
13 | +import android.support.v4.content.ContextCompat; | |
7 | 14 | import android.support.v4.app.Fragment; |
8 | 15 | import android.util.Log; |
9 | 16 | import android.view.LayoutInflater; |
10 | 17 | |
11 | 18 | |
12 | 19 | |
13 | 20 | |
... | ... | @@ -11,12 +18,32 @@ |
11 | 18 | import android.view.ViewGroup; |
12 | 19 | |
13 | 20 | import com.dinhcv.lifelogpedometer.R; |
21 | +import com.google.android.gms.maps.CameraUpdateFactory; | |
14 | 22 | import com.google.android.gms.maps.GoogleMap; |
15 | 23 | import com.google.android.gms.maps.OnMapReadyCallback; |
24 | +import com.google.android.gms.maps.SupportMapFragment; | |
25 | +import com.google.android.gms.maps.model.LatLng; | |
26 | +import com.google.android.gms.maps.model.MarkerOptions; | |
27 | +import com.google.android.gms.maps.model.PolylineOptions; | |
16 | 28 | |
29 | +import static android.content.Context.LOCATION_SERVICE; | |
30 | + | |
17 | 31 | public class MapFragment extends Fragment implements SettingFragmentPresenter, OnMapReadyCallback { |
18 | 32 | private View mRootView; |
33 | + private PolylineOptions polylineOptions = new PolylineOptions(); | |
34 | + private LocationManager mLocationManager; | |
35 | + // The minimum distance to change Updates in meters | |
36 | + private static final long LOCATION_REFRESH_DISTANCE = 10; | |
19 | 37 | |
38 | + // The minimum time between updates in milliseconds | |
39 | + private static final long LOCATION_REFRESH_TIME = 10000; | |
40 | + | |
41 | + private double lat = 0; | |
42 | + private double log = 0; | |
43 | + | |
44 | + private SupportMapFragment mapFragment; | |
45 | + private GoogleMap googleMap; | |
46 | + | |
20 | 47 | @Override |
21 | 48 | public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle |
22 | 49 | savedInstanceState) { |
23 | 50 | |
24 | 51 | |
25 | 52 | |
26 | 53 | |
27 | 54 | |
... | ... | @@ -36,17 +63,71 @@ |
36 | 63 | * @param rootView view |
37 | 64 | */ |
38 | 65 | private void initView(View rootView) { |
66 | + mapFragment = (SupportMapFragment) getChildFragmentManager() | |
67 | + .findFragmentById(R.id.map); | |
39 | 68 | |
69 | + polylineOptions.color(ContextCompat.getColor(getActivity(),android.R.color.holo_red_dark)); | |
70 | + | |
40 | 71 | } |
41 | 72 | |
42 | 73 | /** |
43 | 74 | * Init data |
44 | 75 | */ |
45 | 76 | private void initData() { |
77 | + mLocationManager = (LocationManager) getActivity().getSystemService(LOCATION_SERVICE); | |
46 | 78 | |
79 | + if (ActivityCompat.checkSelfPermission(getActivity(), Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(getActivity(), Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) { | |
80 | + return; | |
81 | + } | |
82 | + mLocationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, LOCATION_REFRESH_TIME, | |
83 | + LOCATION_REFRESH_DISTANCE, mLocationListener); | |
47 | 84 | } |
48 | 85 | |
86 | + private final LocationListener mLocationListener = new LocationListener() { | |
87 | + @Override | |
88 | + public void onLocationChanged(final Location location) { | |
89 | + //your code here | |
90 | + lat = location.getLatitude(); | |
91 | + log = location.getLongitude(); | |
92 | + polylineOptions.add(new LatLng(lat, log)); | |
93 | + if (googleMap!= null) { | |
94 | + googleMap.addPolyline(polylineOptions); | |
95 | + } | |
96 | + //update | |
97 | + update(); | |
98 | + } | |
49 | 99 | |
100 | + @Override | |
101 | + public void onStatusChanged(String s, int i, Bundle bundle) { | |
102 | + | |
103 | + } | |
104 | + | |
105 | + @Override | |
106 | + public void onProviderEnabled(String s) { | |
107 | + | |
108 | + } | |
109 | + | |
110 | + @Override | |
111 | + public void onProviderDisabled(String s) { | |
112 | + | |
113 | + } | |
114 | + }; | |
115 | + | |
116 | + private void update(){ | |
117 | + mapFragment.getMapAsync(this); | |
118 | + } | |
119 | + | |
120 | + private void updateLine(){ | |
121 | + LatLng sydney = new LatLng(-34, 151); | |
122 | + LatLng melbourne=new LatLng(37.813, 144.9631); | |
123 | + LatLng auckland=new LatLng(36.8485, 174.7633); | |
124 | + | |
125 | + polylineOptions.add(new LatLng[]{sydney,melbourne,auckland}); | |
126 | + if (googleMap!= null) { | |
127 | + googleMap.addPolyline(polylineOptions); | |
128 | + } | |
129 | + } | |
130 | + | |
50 | 131 | @Override |
51 | 132 | public void onAttach(Context context) { |
52 | 133 | super.onAttach(context); |
53 | 134 | |
... | ... | @@ -77,8 +158,17 @@ |
77 | 158 | } |
78 | 159 | |
79 | 160 | @Override |
80 | - public void onMapReady(GoogleMap googleMap) { | |
161 | + public void onMapReady(GoogleMap gm) { | |
162 | + | |
163 | + googleMap = gm; | |
164 | + LatLng pos=new LatLng(lat, log); | |
165 | + googleMap.addMarker(new MarkerOptions() | |
166 | + .position(pos)); | |
167 | + googleMap.animateCamera(CameraUpdateFactory.newLatLngZoom(pos, 15.0f)); | |
168 | + | |
81 | 169 | Log.i("SonLT","Readdy"); |
170 | + | |
171 | + //updateLine(); | |
82 | 172 | } |
83 | 173 | } |
app/src/main/java/com/dinhcv/lifelogpedometer/activity/PedometerActivity.java
1 | 1 | package com.dinhcv.lifelogpedometer.activity; |
2 | 2 | |
3 | 3 | import android.Manifest; |
4 | +import android.content.Context; | |
4 | 5 | import android.content.Intent; |
5 | 6 | import android.os.Build; |
6 | 7 | import android.os.Bundle; |
7 | 8 | |
... | ... | @@ -13,12 +14,14 @@ |
13 | 14 | import android.support.v7.widget.PopupMenu; |
14 | 15 | import android.support.v7.widget.Toolbar; |
15 | 16 | import android.view.Gravity; |
17 | +import android.view.LayoutInflater; | |
16 | 18 | import android.view.MenuItem; |
17 | 19 | import android.view.View; |
18 | 20 | import android.view.Window; |
19 | 21 | import android.view.WindowManager; |
20 | 22 | import android.widget.ImageView; |
21 | 23 | import android.widget.PopupWindow; |
24 | +import android.widget.TabHost; | |
22 | 25 | import android.widget.TextView; |
23 | 26 | import android.widget.Toast; |
24 | 27 | |
... | ... | @@ -44,11 +47,11 @@ |
44 | 47 | private SnsFragment mSnsFragment; |
45 | 48 | |
46 | 49 | private int[] tabIcons = { |
47 | - com.dinhcv.lifelogpedometer.R.drawable.ic_date, | |
48 | - R.drawable.ic_history, | |
49 | - R.drawable.ic_rank, | |
50 | - R.drawable.ic_map, | |
51 | - R.drawable.ic_sns | |
50 | + R.drawable.today_ic, | |
51 | + R.drawable.history_ic, | |
52 | + R.drawable.rank_ic, | |
53 | + R.drawable.map_ic, | |
54 | + R.drawable.sns_ic | |
52 | 55 | }; |
53 | 56 | |
54 | 57 | public enum TAB { |
55 | 58 | |
56 | 59 | |
... | ... | @@ -101,9 +104,40 @@ |
101 | 104 | if (tab != null) { |
102 | 105 | tab.select(); |
103 | 106 | } |
107 | + //mTabLayout.addTab(); | |
108 | + View view1 = getLayoutInflater().inflate(R.layout.customtab, null); | |
109 | + view1.findViewById(R.id.icon).setBackgroundResource(R.drawable.today_ic); | |
110 | + //mTabLayout.addTab(mTabLayout.newTab().setCustomView(view1)); | |
104 | 111 | |
112 | + | |
113 | + View view2 = getLayoutInflater().inflate(R.layout.customtab, null); | |
114 | + view2.findViewById(R.id.icon).setBackgroundResource(R.drawable.history_ic); | |
115 | + //mTabLayout.addTab(mTabLayout.newTab().setCustomView(view2)); | |
116 | + | |
117 | + | |
118 | + View view3 = getLayoutInflater().inflate(R.layout.customtab, null); | |
119 | + view3.findViewById(R.id.icon).setBackgroundResource(R.drawable.rank_ic); | |
120 | + //mTabLayout.addTab(mTabLayout.newTab().setCustomView(view3)); | |
121 | + | |
122 | + | |
123 | + View view4 = getLayoutInflater().inflate(R.layout.customtab, null); | |
124 | + view4.findViewById(R.id.icon).setBackgroundResource(R.drawable.map_ic); | |
125 | + //mTabLayout.addTab(mTabLayout.newTab().setCustomView(view4)); | |
126 | + | |
127 | + | |
128 | + View view5 = getLayoutInflater().inflate(R.layout.customtab, null); | |
129 | + view5.findViewById(R.id.icon).setBackgroundResource(R.drawable.sns_ic); | |
130 | + //mTabLayout.addTab(mTabLayout.newTab().setCustomView(view5)); | |
131 | + | |
132 | + | |
133 | + mTabLayout.getTabAt(0).setCustomView(view1); | |
134 | + mTabLayout.getTabAt(1).setCustomView(view2); | |
135 | + mTabLayout.getTabAt(2).setCustomView(view3); | |
136 | + mTabLayout.getTabAt(3).setCustomView(view4); | |
137 | + mTabLayout.getTabAt(4).setCustomView(view5); | |
138 | + | |
105 | 139 | changeColorStatusBar(); |
106 | - setupTabIcons(); | |
140 | + //setupTabIcons(); | |
107 | 141 | |
108 | 142 | //SonLT Add |
109 | 143 | ivHome.setOnClickListener(new View.OnClickListener() { |
110 | 144 | |
... | ... | @@ -161,8 +195,16 @@ |
161 | 195 | }); //closing the setOnClickListener method |
162 | 196 | } |
163 | 197 | |
198 | + public TabHost.TabSpec setIndicator(Context ctx, TabHost.TabSpec spec, int viewId, int resId, String name) { | |
199 | + View v = LayoutInflater.from(ctx).inflate(R.layout.customtab, null); | |
200 | + ImageView imgTab = (ImageView) v.findViewById(viewId); | |
201 | + imgTab.setImageDrawable(getResources().getDrawable(resId)); | |
202 | + | |
203 | + return spec.setIndicator(v); | |
204 | + } | |
205 | + | |
164 | 206 | private void setupTabIcons() { |
165 | - mTabLayout.getTabAt(0).setIcon(tabIcons[0]); | |
207 | + mTabLayout.getTabAt(0).setCustomView(tabIcons[0]); | |
166 | 208 | mTabLayout.getTabAt(1).setIcon(tabIcons[1]); |
167 | 209 | mTabLayout.getTabAt(2).setIcon(tabIcons[2]); |
168 | 210 | mTabLayout.getTabAt(3).setIcon(tabIcons[3]); |
... | ... | @@ -251,7 +293,8 @@ |
251 | 293 | |
252 | 294 | @Override |
253 | 295 | public CharSequence getPageTitle(int position) { |
254 | - return mFragmentTitleList.get(position); | |
296 | + //return mFragmentTitleList.get(position); | |
297 | + return null; | |
255 | 298 | } |
256 | 299 | } |
257 | 300 |
app/src/main/java/com/dinhcv/lifelogpedometer/activity/RankFragment.java
app/src/main/java/com/dinhcv/lifelogpedometer/activity/TopDateFragment.java
... | ... | @@ -34,6 +34,8 @@ |
34 | 34 | import java.util.Date; |
35 | 35 | import java.util.List; |
36 | 36 | |
37 | +import de.hdodenhof.circleimageview.CircleImageView; | |
38 | + | |
37 | 39 | public class TopDateFragment extends FragmentBase implements SettingFragmentPresenter { |
38 | 40 | |
39 | 41 | private TextView tvDate; |
... | ... | @@ -57,7 +59,7 @@ |
57 | 59 | |
58 | 60 | private Const.STEP_TYPE stepType; |
59 | 61 | private TagetInfo mTagetInfo = new TagetInfo(); |
60 | - private ImageView ivToDay; | |
62 | + private CircleImageView ivToDay; | |
61 | 63 | private ExpandableListCustomView lvNotice; |
62 | 64 | private NoticeAdapter mNoticeAdapter; |
63 | 65 | private View mRootview; |
... | ... | @@ -91,7 +93,7 @@ |
91 | 93 | llWalking = (LinearLayout) rootView.findViewById(R.id.ll_walking); |
92 | 94 | llRunning = (LinearLayout) rootView.findViewById(R.id.ll_running); |
93 | 95 | |
94 | - ivToDay = (ImageView) rootView.findViewById(R.id.iv_toDay); | |
96 | + ivToDay = (CircleImageView) rootView.findViewById(R.id.iv_toDay); | |
95 | 97 | lvNotice = (ExpandableListCustomView) rootView.findViewById(R.id.lv_notice); |
96 | 98 | |
97 | 99 | handleEvent(); |
app/src/main/java/com/dinhcv/lifelogpedometer/activity/WelcomeActivity.java
1 | 1 | package com.dinhcv.lifelogpedometer.activity; |
2 | 2 | |
3 | +import android.Manifest; | |
3 | 4 | import android.app.ProgressDialog; |
4 | 5 | import android.content.DialogInterface; |
5 | 6 | import android.content.Intent; |
7 | +import android.content.pm.PackageManager; | |
6 | 8 | import android.net.Uri; |
9 | +import android.os.Build; | |
7 | 10 | import android.os.Bundle; |
8 | 11 | import android.os.Handler; |
12 | +import android.support.v4.app.ActivityCompat; | |
13 | +import android.support.v4.content.ContextCompat; | |
9 | 14 | import android.support.v7.app.AlertDialog; |
15 | +import android.widget.Toast; | |
10 | 16 | |
11 | 17 | import com.dinhcv.lifelogpedometer.R; |
12 | 18 | import com.dinhcv.lifelogpedometer.interfaces.LLAPIManagerListener; |
13 | 19 | |
... | ... | @@ -21,11 +27,13 @@ |
21 | 27 | |
22 | 28 | public class WelcomeActivity extends ActivityBase implements Runnable { |
23 | 29 | private boolean isRefresh = false; |
30 | + private static final int PERMISSIONS_REQUEST = 999; | |
31 | + | |
24 | 32 | @Override |
25 | 33 | protected void onCreate(Bundle savedInstanceState) { |
26 | 34 | super.onCreate(savedInstanceState); |
27 | 35 | setContentView(R.layout.activity_welcome); |
28 | - checkRefreshToken(); | |
36 | + checkPermission(); | |
29 | 37 | } |
30 | 38 | |
31 | 39 | private void checkRefreshToken(){ |
... | ... | @@ -101,6 +109,60 @@ |
101 | 109 | @Override |
102 | 110 | protected void onResume() { |
103 | 111 | super.onResume(); |
112 | + } | |
113 | + | |
114 | + private void checkPermission() { | |
115 | + // Check all permission in android 6.0 | |
116 | + if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { | |
117 | + if ((ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) | |
118 | + == PackageManager.PERMISSION_GRANTED) && (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) | |
119 | + == PackageManager.PERMISSION_GRANTED)) { | |
120 | + checkRefreshToken(); | |
121 | + | |
122 | + } else { | |
123 | + // Requset permisson of device | |
124 | + if (ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission | |
125 | + .ACCESS_COARSE_LOCATION) | |
126 | + && ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest | |
127 | + .permission.ACCESS_FINE_LOCATION)) { | |
128 | + ActivityCompat.requestPermissions(this, | |
129 | + new String[]{Manifest.permission.ACCESS_COARSE_LOCATION, | |
130 | + Manifest.permission.ACCESS_FINE_LOCATION}, | |
131 | + PERMISSIONS_REQUEST); | |
132 | + | |
133 | + } else { | |
134 | + ActivityCompat.requestPermissions(this, | |
135 | + new String[]{Manifest.permission.ACCESS_COARSE_LOCATION, | |
136 | + Manifest.permission.ACCESS_FINE_LOCATION}, | |
137 | + PERMISSIONS_REQUEST); | |
138 | + } | |
139 | + } | |
140 | + | |
141 | + } else { | |
142 | + checkRefreshToken(); | |
143 | + } | |
144 | + } | |
145 | + | |
146 | + @Override | |
147 | + public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] | |
148 | + grantResults) { | |
149 | + super.onRequestPermissionsResult(requestCode, permissions, grantResults); | |
150 | + | |
151 | + if (requestCode == PERMISSIONS_REQUEST) { | |
152 | + if (grantResults.length > 0) { | |
153 | + if (grantResults[0] == PackageManager.PERMISSION_GRANTED | |
154 | + && grantResults[1] == PackageManager.PERMISSION_GRANTED | |
155 | + && grantResults[2] == PackageManager.PERMISSION_GRANTED) { | |
156 | + checkRefreshToken(); | |
157 | + return; | |
158 | + } | |
159 | + } else { | |
160 | + Toast.makeText(this, "Permission was not granted ", Toast.LENGTH_SHORT).show(); | |
161 | + finish(); | |
162 | + } | |
163 | + } else { | |
164 | + super.onRequestPermissionsResult(requestCode, permissions, grantResults); | |
165 | + } | |
104 | 166 | } |
105 | 167 | } |
app/src/main/java/com/dinhcv/lifelogpedometer/adapter/RankingAdapter.java
... | ... | @@ -84,13 +84,13 @@ |
84 | 84 | } |
85 | 85 | switch (rankingInfo.getRank()) { |
86 | 86 | case 1: |
87 | - holder.mImvPosition.setBackground(Utils.getDrawableWrapper(mActivity, R.drawable.ic_first)); | |
87 | + holder.mImvPosition.setBackground(Utils.getDrawableWrapper(mActivity, R.drawable.no1)); | |
88 | 88 | break; |
89 | 89 | case 2: |
90 | - holder.mImvPosition.setBackground(Utils.getDrawableWrapper(mActivity, R.drawable.ic_second)); | |
90 | + holder.mImvPosition.setBackground(Utils.getDrawableWrapper(mActivity, R.drawable.no2)); | |
91 | 91 | break; |
92 | 92 | case 3: |
93 | - holder.mImvPosition.setBackground(Utils.getDrawableWrapper(mActivity, R.drawable.ic_third)); | |
93 | + holder.mImvPosition.setBackground(Utils.getDrawableWrapper(mActivity, R.drawable.no3)); | |
94 | 94 | break; |
95 | 95 | } |
96 | 96 | } |
app/src/main/java/com/dinhcv/lifelogpedometer/customview/CircularImageView.java
1 | +package com.dinhcv.lifelogpedometer.customview; | |
2 | + | |
3 | + | |
4 | +import android.annotation.SuppressLint; | |
5 | +import android.content.Context; | |
6 | +import android.graphics.Bitmap; | |
7 | +import android.graphics.BitmapShader; | |
8 | +import android.graphics.Canvas; | |
9 | +import android.graphics.Color; | |
10 | +import android.graphics.Matrix; | |
11 | +import android.graphics.Paint; | |
12 | +import android.graphics.Shader; | |
13 | +import android.graphics.drawable.BitmapDrawable; | |
14 | +import android.graphics.drawable.Drawable; | |
15 | +import android.util.AttributeSet; | |
16 | +import android.util.Log; | |
17 | +import android.widget.ImageView; | |
18 | + | |
19 | + | |
20 | +@SuppressLint("AppCompatCustomView") | |
21 | +public class CircularImageView extends ImageView { | |
22 | + private static final ScaleType SCALE_TYPE = ScaleType.CENTER_CROP; | |
23 | + | |
24 | + private static final float DEFAULT_BORDER_WIDTH = 4; | |
25 | + private static final float DEFAULT_SHADOW_RADIUS = 8.0f; | |
26 | + private float borderWidth; | |
27 | + private int canvasSize; | |
28 | + private float shadowRadius; | |
29 | + private int shadowColor = Color.BLACK; | |
30 | + | |
31 | + private Bitmap image; | |
32 | + private Drawable drawable; | |
33 | + private Paint paint; | |
34 | + private Paint paintBorder; | |
35 | + | |
36 | + public CircularImageView(final Context context) { | |
37 | + this(context, null); | |
38 | + } | |
39 | + | |
40 | + public CircularImageView(Context context, AttributeSet attrs) { | |
41 | + this(context, attrs, 0); | |
42 | + } | |
43 | + | |
44 | + public CircularImageView(Context context, AttributeSet attrs, int defStyleAttr) { | |
45 | + super(context, attrs, defStyleAttr); | |
46 | + init(context, attrs, defStyleAttr); | |
47 | + } | |
48 | + | |
49 | + private void init(Context context, AttributeSet attrs, int defStyleAttr) { | |
50 | + paint = new Paint(); | |
51 | + paint.setAntiAlias(true); | |
52 | + | |
53 | + paintBorder = new Paint(); | |
54 | + paintBorder.setAntiAlias(true); | |
55 | + } | |
56 | + | |
57 | + public void setBorderWidth(float borderWidth) { | |
58 | + this.borderWidth = borderWidth; | |
59 | + requestLayout(); | |
60 | + invalidate(); | |
61 | + } | |
62 | + | |
63 | + public void setBorderColor(int borderColor) { | |
64 | + if (paintBorder != null) | |
65 | + paintBorder.setColor(borderColor); | |
66 | + invalidate(); | |
67 | + } | |
68 | + | |
69 | + public void addShadow() { | |
70 | + if (shadowRadius == 0) | |
71 | + shadowRadius = DEFAULT_SHADOW_RADIUS; | |
72 | + drawShadow(shadowRadius, shadowColor); | |
73 | + invalidate(); | |
74 | + } | |
75 | + | |
76 | + public void setShadowRadius(float shadowRadius) { | |
77 | + drawShadow(shadowRadius, shadowColor); | |
78 | + invalidate(); | |
79 | + } | |
80 | + | |
81 | + public void setShadowColor(int shadowColor) { | |
82 | + drawShadow(shadowRadius, shadowColor); | |
83 | + invalidate(); | |
84 | + } | |
85 | + | |
86 | + @Override | |
87 | + public ScaleType getScaleType() { | |
88 | + return SCALE_TYPE; | |
89 | + } | |
90 | + | |
91 | + @Override | |
92 | + public void setScaleType(ScaleType scaleType) { | |
93 | + if (scaleType != SCALE_TYPE) { | |
94 | + throw new IllegalArgumentException(String.format("ScaleType %s not supported. ScaleType.CENTER_CROP is used by default. So you don't need to use ScaleType.", scaleType)); | |
95 | + } | |
96 | + } | |
97 | + | |
98 | + @Override | |
99 | + public void onDraw(Canvas canvas) { | |
100 | + loadBitmap(); | |
101 | + | |
102 | + if (image == null) | |
103 | + return; | |
104 | + | |
105 | + if (!isInEditMode()) { | |
106 | + canvasSize = canvas.getWidth(); | |
107 | + if (canvas.getHeight() < canvasSize) { | |
108 | + canvasSize = canvas.getHeight(); | |
109 | + } | |
110 | + } | |
111 | + | |
112 | + int circleCenter = (int) (canvasSize - (borderWidth * 2)) / 2; | |
113 | + canvas.drawCircle(circleCenter + borderWidth, circleCenter + borderWidth, circleCenter + borderWidth - (shadowRadius + shadowRadius / 2), paintBorder); | |
114 | + canvas.drawCircle(circleCenter + borderWidth, circleCenter + borderWidth, circleCenter - (shadowRadius + shadowRadius / 2), paint); | |
115 | + } | |
116 | + | |
117 | + private void loadBitmap() { | |
118 | + if (this.drawable == getDrawable()) | |
119 | + return; | |
120 | + | |
121 | + this.drawable = getDrawable(); | |
122 | + this.image = drawableToBitmap(this.drawable); | |
123 | + updateShader(); | |
124 | + } | |
125 | + | |
126 | + @Override | |
127 | + protected void onSizeChanged(int w, int h, int oldw, int oldh) { | |
128 | + super.onSizeChanged(w, h, oldw, oldh); | |
129 | + canvasSize = w; | |
130 | + if (h < canvasSize) | |
131 | + canvasSize = h; | |
132 | + if (image != null) | |
133 | + updateShader(); | |
134 | + } | |
135 | + | |
136 | + private void drawShadow(float shadowRadius, int shadowColor) { | |
137 | + this.shadowRadius = shadowRadius; | |
138 | + this.shadowColor = shadowColor; | |
139 | + if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) { | |
140 | + setLayerType(LAYER_TYPE_SOFTWARE, paintBorder); | |
141 | + } | |
142 | + paintBorder.setShadowLayer(shadowRadius, 0.0f, shadowRadius / 2, shadowColor); | |
143 | + } | |
144 | + | |
145 | + private void updateShader() { | |
146 | + if (image == null) | |
147 | + return; | |
148 | + | |
149 | + image = cropBitmap(image); | |
150 | + | |
151 | + BitmapShader shader = new BitmapShader(image, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP); | |
152 | + | |
153 | + Matrix matrix = new Matrix(); | |
154 | + matrix.setScale((float) canvasSize / (float) image.getWidth(), (float) canvasSize / (float) image.getHeight()); | |
155 | + shader.setLocalMatrix(matrix); | |
156 | + | |
157 | + paint.setShader(shader); | |
158 | + } | |
159 | + | |
160 | + private Bitmap cropBitmap(Bitmap bitmap) { | |
161 | + Bitmap bmp; | |
162 | + if (bitmap.getWidth() >= bitmap.getHeight()) { | |
163 | + bmp = Bitmap.createBitmap( | |
164 | + bitmap, | |
165 | + bitmap.getWidth() / 2 - bitmap.getHeight() / 2, | |
166 | + 0, | |
167 | + bitmap.getHeight(), bitmap.getHeight()); | |
168 | + } else { | |
169 | + bmp = Bitmap.createBitmap( | |
170 | + bitmap, | |
171 | + 0, | |
172 | + bitmap.getHeight() / 2 - bitmap.getWidth() / 2, | |
173 | + bitmap.getWidth(), bitmap.getWidth()); | |
174 | + } | |
175 | + return bmp; | |
176 | + } | |
177 | + | |
178 | + private Bitmap drawableToBitmap(Drawable drawable) { | |
179 | + if (drawable == null) { | |
180 | + return null; | |
181 | + } else if (drawable instanceof BitmapDrawable) { | |
182 | + return ((BitmapDrawable) drawable).getBitmap(); | |
183 | + } | |
184 | + | |
185 | + int intrinsicWidth = drawable.getIntrinsicWidth(); | |
186 | + int intrinsicHeight = drawable.getIntrinsicHeight(); | |
187 | + | |
188 | + if (!(intrinsicWidth > 0 && intrinsicHeight > 0)) | |
189 | + return null; | |
190 | + | |
191 | + try { | |
192 | + Bitmap bitmap = Bitmap.createBitmap(intrinsicWidth, intrinsicHeight, Bitmap.Config.ARGB_8888); | |
193 | + Canvas canvas = new Canvas(bitmap); | |
194 | + drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight()); | |
195 | + drawable.draw(canvas); | |
196 | + return bitmap; | |
197 | + } catch (OutOfMemoryError e) { | |
198 | + Log.e(getClass().toString(), "Encountered OutOfMemoryError while generating bitmap!"); | |
199 | + return null; | |
200 | + } | |
201 | + } | |
202 | + | |
203 | + @Override | |
204 | + protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { | |
205 | + int width = measureWidth(widthMeasureSpec); | |
206 | + int height = measureHeight(heightMeasureSpec); | |
207 | + setMeasuredDimension(width, height); | |
208 | + } | |
209 | + | |
210 | + private int measureWidth(int measureSpec) { | |
211 | + int result; | |
212 | + int specMode = MeasureSpec.getMode(measureSpec); | |
213 | + int specSize = MeasureSpec.getSize(measureSpec); | |
214 | + | |
215 | + if (specMode == MeasureSpec.EXACTLY) { | |
216 | + result = specSize; | |
217 | + } else if (specMode == MeasureSpec.AT_MOST) { | |
218 | + result = specSize; | |
219 | + } else { | |
220 | + result = canvasSize; | |
221 | + } | |
222 | + | |
223 | + return result; | |
224 | + } | |
225 | + | |
226 | + private int measureHeight(int measureSpecHeight) { | |
227 | + int result; | |
228 | + int specMode = MeasureSpec.getMode(measureSpecHeight); | |
229 | + int specSize = MeasureSpec.getSize(measureSpecHeight); | |
230 | + | |
231 | + if (specMode == MeasureSpec.EXACTLY) { | |
232 | + result = specSize; | |
233 | + } else if (specMode == MeasureSpec.AT_MOST) { | |
234 | + result = specSize; | |
235 | + } else { | |
236 | + result = canvasSize; | |
237 | + } | |
238 | + | |
239 | + return (result + 2); | |
240 | + } | |
241 | +} |
app/src/main/res/drawable/back_ic.PNG
app/src/main/res/drawable/goout_ic.PNG
app/src/main/res/drawable/home_ic.PNG
app/src/main/res/drawable/list_ic.PNG
app/src/main/res/drawable/next_ic.PNG
app/src/main/res/drawable/step_type_enabled.xml
... | ... | @@ -3,9 +3,9 @@ |
3 | 3 | <shape xmlns:android="http://schemas.android.com/apk/res/android" |
4 | 4 | android:shape="rectangle"> |
5 | 5 | <gradient |
6 | - android:startColor="@color/tab_sub2_unselected" | |
7 | - android:centerColor="@color/tab_sub2_unselected" | |
8 | - android:endColor="@color/tab_sub2_unselected" | |
6 | + android:startColor="@color/bg_header" | |
7 | + android:centerColor="@color/bg_header" | |
8 | + android:endColor="@color/bg_header" | |
9 | 9 | android:angle="90"/> |
10 | 10 | <padding |
11 | 11 | android:bottom="7dp" |
... | ... | @@ -14,7 +14,7 @@ |
14 | 14 | android:top="7dp" /> |
15 | 15 | <stroke |
16 | 16 | android:width="2dip" |
17 | - android:color="@color/tab_sub2_unselected" /> | |
17 | + android:color="@color/bg_header" /> | |
18 | 18 | <corners android:radius="0dp" /> |
19 | 19 | </shape> |
app/src/main/res/drawable/tab_color_selector.xml
1 | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | 2 | <selector xmlns:android="http://schemas.android.com/apk/res/android"> |
3 | 3 | <item android:drawable="@color/selected_tab_color" android:state_selected="true"/> |
4 | - <item android:drawable="@color/background_main"/> | |
4 | + <item android:drawable="@color/white"/> | |
5 | 5 | </selector> |
app/src/main/res/drawable/test_selector.xml
app/src/main/res/drawable/walking_ic.PNG
app/src/main/res/layout/activity_pedometer.xml
... | ... | @@ -4,7 +4,8 @@ |
4 | 4 | xmlns:tools="http://schemas.android.com/tools" |
5 | 5 | xmlns:app="http://schemas.android.com/apk/res-auto" |
6 | 6 | android:layout_width="match_parent" |
7 | - android:layout_height="match_parent"> | |
7 | + android:layout_height="match_parent" | |
8 | + android:background="@drawable/bg"> | |
8 | 9 | |
9 | 10 | <include layout="@layout/layout_toolbar"/> |
10 | 11 | |
11 | 12 | |
... | ... | @@ -21,14 +22,14 @@ |
21 | 22 | android:layout_width="match_parent" |
22 | 23 | android:layout_height="wrap_content" |
23 | 24 | android:layout_alignParentBottom="true" |
24 | - android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"> | |
25 | + android:theme="@style/ThemeOverlay.AppCompat.Light"> | |
25 | 26 | |
26 | 27 | <android.support.design.widget.TabLayout |
27 | 28 | android:id="@+id/tabs" |
28 | 29 | android:layout_width="match_parent" |
29 | 30 | android:layout_height="wrap_content" |
30 | 31 | style="@style/custom_tab" |
31 | - android:background="@drawable/tab_background" | |
32 | + android:background="@color/white" | |
32 | 33 | app:tabBackground="@drawable/tab_color_selector" |
33 | 34 | app:tabGravity="fill" |
34 | 35 | app:tabMode="fixed"/> |
app/src/main/res/layout/customtab.xml
1 | +<?xml version="1.0" encoding="utf-8"?> | |
2 | +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
3 | + android:orientation="vertical" | |
4 | + android:layout_width="match_parent" | |
5 | + android:layout_height="match_parent" | |
6 | + android:padding="3dp"> | |
7 | + | |
8 | + <ImageView | |
9 | + android:layout_width="wrap_content" | |
10 | + android:layout_height="wrap_content" | |
11 | + android:adjustViewBounds="true" | |
12 | + android:src="@drawable/tab_ic" | |
13 | + android:id="@+id/icon" | |
14 | + android:layout_gravity="center" /> | |
15 | +</LinearLayout> |
app/src/main/res/layout/fragment_history.xml
... | ... | @@ -2,7 +2,6 @@ |
2 | 2 | xmlns:appNs="http://schemas.android.com/apk/res-auto" |
3 | 3 | android:layout_width="match_parent" |
4 | 4 | android:layout_height="match_parent" |
5 | - android:background="@color/background_main" | |
6 | 5 | android:orientation="vertical"> |
7 | 6 | <FrameLayout |
8 | 7 | android:id="@+id/layout_history" |
app/src/main/res/layout/fragment_history_content.xml
1 | 1 | <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" |
2 | 2 | xmlns:appNs="http://schemas.android.com/apk/res-auto" |
3 | 3 | android:layout_width="match_parent" |
4 | - android:layout_height="match_parent" | |
5 | - android:background="@color/background_main"> | |
4 | + android:layout_height="match_parent"> | |
6 | 5 | |
7 | 6 | <ScrollView |
8 | 7 | android:layout_width="match_parent" |
9 | 8 | |
... | ... | @@ -142,13 +141,13 @@ |
142 | 141 | android:layout_below="@+id/layout_top" |
143 | 142 | android:orientation="vertical"> |
144 | 143 | |
145 | - <include layout="@layout/history_page_7_content"/> | |
144 | + <include layout="@layout/history_page_7_content" /> | |
146 | 145 | |
147 | 146 | <LinearLayout |
148 | 147 | android:layout_width="match_parent" |
149 | 148 | android:layout_height="120dp" |
150 | - android:orientation="vertical" | |
151 | - android:layout_marginTop="10dp"> | |
149 | + android:layout_marginTop="10dp" | |
150 | + android:orientation="vertical"> | |
152 | 151 | |
153 | 152 | <!--<org.eazegraph.lib.charts.BarChart--> |
154 | 153 | <!--xmlns:eaze="http://schemas.android.com/apk/res-auto"--> |
155 | 154 | |
156 | 155 | |
157 | 156 | |
158 | 157 | |
159 | 158 | |
160 | 159 | |
161 | 160 | |
162 | 161 | |
163 | 162 | |
164 | 163 | |
165 | 164 | |
166 | 165 | |
167 | 166 | |
168 | 167 | |
169 | 168 | |
... | ... | @@ -172,64 +171,55 @@ |
172 | 171 | <LinearLayout |
173 | 172 | android:id="@+id/layout_bottom" |
174 | 173 | android:layout_width="match_parent" |
175 | - android:layout_height="56dp" | |
174 | + android:layout_height="wrap_content" | |
175 | + android:gravity="right" | |
176 | 176 | android:orientation="horizontal" |
177 | 177 | android:weightSum="5"> |
178 | 178 | |
179 | - <Button | |
179 | + | |
180 | + <ImageView | |
180 | 181 | android:id="@+id/btn_face" |
181 | - style="@style/button_bot_page_7_style" | |
182 | - android:layout_width="0dp" | |
183 | - android:layout_height="match_parent" | |
184 | - android:layout_weight="1" | |
185 | - android:background="@drawable/button_background" | |
186 | - android:lines="2" | |
182 | + android:layout_width="wrap_content" | |
183 | + android:layout_height="wrap_content" | |
187 | 184 | android:layout_margin="2dp" |
188 | - android:text="@string/facebook" /> | |
185 | + android:adjustViewBounds="true" | |
186 | + android:background="@drawable/face_ic" /> | |
189 | 187 | |
190 | - <Button | |
188 | + | |
189 | + <ImageView | |
191 | 190 | android:id="@+id/btn_twitter" |
192 | - style="@style/button_bot_page_7_style" | |
193 | - android:layout_width="0dp" | |
194 | - android:layout_height="match_parent" | |
195 | - android:layout_weight="1" | |
196 | - android:background="@drawable/button_background" | |
197 | - android:lines="2" | |
191 | + android:layout_width="wrap_content" | |
192 | + android:layout_height="wrap_content" | |
198 | 193 | android:layout_margin="2dp" |
199 | - android:text="@string/twitter" /> | |
194 | + android:adjustViewBounds="true" | |
195 | + android:background="@drawable/f2_ic" /> | |
200 | 196 | |
201 | - <Button | |
197 | + | |
198 | + <ImageView | |
202 | 199 | android:id="@+id/btn_line" |
203 | - style="@style/button_bot_page_7_style" | |
204 | - android:layout_width="0dp" | |
205 | - android:layout_height="match_parent" | |
206 | - android:layout_weight="1" | |
207 | - android:background="@drawable/button_background" | |
208 | - android:lines="2" | |
200 | + android:layout_width="wrap_content" | |
201 | + android:layout_height="wrap_content" | |
209 | 202 | android:layout_margin="2dp" |
210 | - android:text="@string/line" /> | |
203 | + android:adjustViewBounds="true" | |
204 | + android:background="@drawable/twitter_ic" /> | |
211 | 205 | |
212 | - <Button | |
206 | + | |
207 | + <ImageView | |
213 | 208 | android:id="@+id/btn_email" |
214 | - style="@style/button_bot_page_7_style" | |
215 | - android:layout_width="0dp" | |
216 | - android:layout_height="match_parent" | |
217 | - android:layout_weight="1" | |
218 | - android:background="@drawable/button_background" | |
219 | - android:lines="2" | |
209 | + android:layout_width="wrap_content" | |
210 | + android:layout_height="wrap_content" | |
220 | 211 | android:layout_margin="2dp" |
221 | - android:text="@string/mail" /> | |
212 | + android:adjustViewBounds="true" | |
213 | + android:background="@drawable/mail_ic" /> | |
222 | 214 | |
223 | - <Button | |
215 | + <ImageView | |
224 | 216 | android:id="@+id/btn_other" |
225 | - style="@style/button_bot_page_7_style" | |
226 | - android:layout_width="0dp" | |
227 | - android:layout_height="match_parent" | |
228 | - android:layout_weight="1" | |
229 | - android:background="@drawable/button_background" | |
230 | - android:lines="2" | |
217 | + android:layout_width="wrap_content" | |
218 | + android:layout_height="wrap_content" | |
231 | 219 | android:layout_margin="2dp" |
232 | - android:text="@string/other" /> | |
220 | + android:adjustViewBounds="true" | |
221 | + android:background="@drawable/other_ic" /> | |
222 | + | |
233 | 223 | |
234 | 224 | </LinearLayout> |
235 | 225 |
app/src/main/res/layout/fragment_history_detail.xml
1 | 1 | <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" |
2 | 2 | xmlns:appNs="http://schemas.android.com/apk/res-auto" |
3 | 3 | android:layout_width="match_parent" |
4 | - android:layout_height="match_parent" | |
5 | - android:background="@color/background_main"> | |
4 | + android:layout_height="match_parent"> | |
6 | 5 | |
7 | 6 | <ScrollView |
8 | 7 | android:layout_width="match_parent" |
app/src/main/res/layout/fragment_map.xml
1 | 1 | <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" |
2 | 2 | xmlns:appNs="http://schemas.android.com/apk/res-auto" |
3 | 3 | android:layout_width="match_parent" |
4 | - android:layout_height="match_parent" | |
5 | - android:background="@color/background_main"> | |
4 | + android:layout_height="match_parent"> | |
6 | 5 | |
7 | 6 | <RelativeLayout |
8 | 7 | android:id="@+id/layout_date_controll" |
... | ... | @@ -13,8 +12,8 @@ |
13 | 12 | |
14 | 13 | <ImageButton |
15 | 14 | android:id="@+id/btn_left_date" |
16 | - android:layout_width="44dp" | |
17 | - android:layout_height="44dp" | |
15 | + android:layout_width="48dp" | |
16 | + android:layout_height="48dp" | |
18 | 17 | android:layout_alignParentLeft="true" |
19 | 18 | android:layout_centerVertical="true" |
20 | 19 | android:layout_marginLeft="16dp" |
... | ... | @@ -49,8 +48,8 @@ |
49 | 48 | |
50 | 49 | <ImageButton |
51 | 50 | android:id="@+id/btn_right_date" |
52 | - android:layout_width="44dp" | |
53 | - android:layout_height="44dp" | |
51 | + android:layout_width="48dp" | |
52 | + android:layout_height="48dp" | |
54 | 53 | android:layout_alignParentRight="true" |
55 | 54 | android:layout_centerVertical="true" |
56 | 55 | android:layout_marginRight="16dp" |
... | ... | @@ -79,7 +78,7 @@ |
79 | 78 | android:layout_width="match_parent" |
80 | 79 | android:layout_height="wrap_content" |
81 | 80 | android:layout_alignParentBottom="true" |
82 | - android:background="@color/tab_sub2_unselected"> | |
81 | + android:background="@color/bg_header"> | |
83 | 82 | |
84 | 83 | <LinearLayout |
85 | 84 | android:layout_width="match_parent" |
app/src/main/res/layout/fragment_rank.xml
1 | 1 | <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" |
2 | 2 | xmlns:appNs="http://schemas.android.com/apk/res-auto" |
3 | 3 | android:layout_width="match_parent" |
4 | - android:layout_height="match_parent" | |
5 | - android:background="@color/background_main"> | |
4 | + android:layout_height="match_parent"> | |
6 | 5 | |
7 | 6 | <LinearLayout |
8 | 7 | android:id="@+id/layout_top" |
9 | 8 | |
10 | 9 | |
... | ... | @@ -56,16 +55,14 @@ |
56 | 55 | <RelativeLayout |
57 | 56 | android:layout_width="match_parent" |
58 | 57 | android:layout_height="48dp" |
59 | - android:background="@android:color/black" | |
60 | 58 | android:gravity="center_vertical"> |
61 | 59 | |
62 | - <ImageButton | |
60 | + <ImageView | |
63 | 61 | android:id="@+id/btn_back" |
64 | 62 | android:layout_width="40dp" |
65 | 63 | android:layout_height="40dp" |
66 | 64 | android:layout_centerVertical="true" |
67 | 65 | android:layout_marginLeft="8dp" |
68 | - android:background="@android:color/white" | |
69 | 66 | android:padding="2dp" |
70 | 67 | android:scaleType="fitCenter" |
71 | 68 | android:src="@drawable/back_ic" /> |
72 | 69 | |
... | ... | @@ -104,14 +101,13 @@ |
104 | 101 | android:textColor="@android:color/white" |
105 | 102 | android:textSize="14sp" /> |
106 | 103 | |
107 | - <ImageButton | |
104 | + <ImageView | |
108 | 105 | android:id="@+id/btn_next" |
109 | 106 | android:layout_width="40dp" |
110 | 107 | android:layout_height="40dp" |
111 | 108 | android:layout_alignParentRight="true" |
112 | 109 | android:layout_centerVertical="true" |
113 | 110 | android:layout_marginRight="8dp" |
114 | - android:background="@android:color/white" | |
115 | 111 | android:padding="2dp" |
116 | 112 | android:scaleType="fitCenter" |
117 | 113 | android:src="@drawable/next_ic" /> |
app/src/main/res/layout/fragment_sns.xml
app/src/main/res/layout/fragment_sns_create_group.xml
... | ... | @@ -2,7 +2,6 @@ |
2 | 2 | xmlns:tools="http://schemas.android.com/tools" |
3 | 3 | android:layout_width="match_parent" |
4 | 4 | android:layout_height="match_parent" |
5 | - android:background="@color/background_main" | |
6 | 5 | tools:context="com.dinhcv.lifelogpedometer.activity.SnsCreateGroupFragment"> |
7 | 6 | <!-- TODO: Update blank fragment layout --> |
8 | 7 | <ScrollView |
app/src/main/res/layout/fragment_sns_detail.xml
1 | 1 | <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" |
2 | 2 | android:layout_width="match_parent" |
3 | - android:layout_height="match_parent" | |
4 | - android:background="@color/background_main"> | |
3 | + android:layout_height="match_parent"> | |
5 | 4 | |
6 | 5 | <LinearLayout |
7 | 6 | android:id="@+id/layout_main_sns_screen" |
8 | 7 | android:layout_width="match_parent" |
9 | 8 | android:layout_height="match_parent" |
10 | - android:background="@color/background_main" | |
11 | 9 | android:orientation="vertical"> |
12 | 10 | |
13 | 11 | <TextView |
app/src/main/res/layout/fragment_sns_my_group.xml
... | ... | @@ -2,7 +2,6 @@ |
2 | 2 | xmlns:tools="http://schemas.android.com/tools" |
3 | 3 | android:layout_width="match_parent" |
4 | 4 | android:layout_height="match_parent" |
5 | - android:background="@color/background_main" | |
6 | 5 | tools:context="com.dinhcv.lifelogpedometer.activity.SnsMyGroupFragment"> |
7 | 6 | |
8 | 7 | <LinearLayout |
app/src/main/res/layout/fragment_sns_search.xml
app/src/main/res/layout/fragment_sns_topic.xml
app/src/main/res/layout/fragment_top.xml
app/src/main/res/layout/fragment_top_date.xml
1 | 1 | <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" |
2 | 2 | xmlns:appNs="http://schemas.android.com/apk/res-auto" |
3 | 3 | android:layout_width="match_parent" |
4 | - android:layout_height="match_parent" | |
5 | - android:background="@color/background_main"> | |
4 | + android:layout_height="match_parent"> | |
6 | 5 | |
7 | 6 | <ScrollView |
8 | 7 | android:layout_width="match_parent" |
9 | 8 | |
... | ... | @@ -21,11 +20,11 @@ |
21 | 20 | android:layout_height="wrap_content" |
22 | 21 | android:orientation="horizontal"> |
23 | 22 | |
24 | - <ImageView | |
23 | + <de.hdodenhof.circleimageview.CircleImageView | |
25 | 24 | android:id="@+id/iv_toDay" |
26 | - android:layout_width="wrap_content" | |
27 | - android:layout_height="wrap_content" | |
28 | - android:src="@drawable/add_ic" /> | |
25 | + android:layout_width="150dp" | |
26 | + android:layout_height="150dp" | |
27 | + android:src="@drawable/ic_detail" /> | |
29 | 28 | |
30 | 29 | <LinearLayout |
31 | 30 | android:layout_width="0dp" |
app/src/main/res/layout/fragment_top_today.xml
1 | 1 | <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" |
2 | 2 | xmlns:appNs="http://schemas.android.com/apk/res-auto" |
3 | 3 | android:layout_width="match_parent" |
4 | - android:layout_height="match_parent" | |
5 | - android:background="@color/background_main"> | |
4 | + android:layout_height="match_parent"> | |
6 | 5 | |
7 | 6 | <ScrollView |
8 | 7 | android:layout_width="match_parent" |
... | ... | @@ -97,7 +96,7 @@ |
97 | 96 | android:layout_marginTop="10dp" |
98 | 97 | eaze:egLegendHeight="0dp" |
99 | 98 | eaze:egInnerPadding="93" |
100 | - eaze:egInnerPaddingColor="@color/background_main" | |
99 | + eaze:egInnerPaddingColor="@color/bg_main" | |
101 | 100 | eaze:egHighlightStrength="1"/> |
102 | 101 | |
103 | 102 | <LinearLayout |
app/src/main/res/layout/history_page_7_content.xml
... | ... | @@ -2,8 +2,7 @@ |
2 | 2 | <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
3 | 3 | android:layout_width="match_parent" |
4 | 4 | android:layout_height="match_parent" |
5 | - android:orientation="vertical" | |
6 | - android:background="@color/background_main"> | |
5 | + android:orientation="vertical"> | |
7 | 6 | |
8 | 7 | <LinearLayout |
9 | 8 | android:layout_width="match_parent" |
app/src/main/res/layout/layout_rank_row.xml
... | ... | @@ -20,24 +20,33 @@ |
20 | 20 | android:layout_height="wrap_content" |
21 | 21 | android:layout_centerVertical="true" |
22 | 22 | android:layout_margin="8dp" |
23 | + android:layout_alignParentLeft="true" | |
23 | 24 | android:text="1" |
24 | 25 | android:textColor="@android:color/black" |
25 | 26 | android:textSize="36sp" /> |
26 | 27 | |
27 | 28 | <ImageView |
29 | + android:id="@+id/imv_position" | |
30 | + android:layout_width="56dp" | |
31 | + android:layout_height="40dp" | |
32 | + android:layout_centerVertical="true" | |
33 | + android:layout_marginRight="8dp" | |
34 | + android:layout_toRightOf="@id/tv_position" | |
35 | + android:layout_marginLeft="2dp"/> | |
36 | + | |
37 | + <ImageView | |
28 | 38 | android:id="@+id/imv_user_icon" |
29 | 39 | android:layout_width="56dp" |
30 | 40 | android:layout_height="56dp" |
31 | 41 | android:layout_centerVertical="true" |
32 | 42 | android:layout_margin="8dp" |
33 | - android:layout_toRightOf="@id/tv_position" | |
34 | - android:background="@drawable/ic_user" /> | |
43 | + android:layout_toRightOf="@id/imv_position" | |
44 | + android:background="@drawable/ic_ava" /> | |
35 | 45 | |
36 | 46 | <LinearLayout |
37 | 47 | android:layout_width="match_parent" |
38 | 48 | android:layout_height="wrap_content" |
39 | 49 | android:layout_centerVertical="true" |
40 | - android:layout_toLeftOf="@+id/imv_position" | |
41 | 50 | android:layout_toRightOf="@+id/imv_user_icon" |
42 | 51 | android:orientation="vertical"> |
43 | 52 | |
... | ... | @@ -93,14 +102,7 @@ |
93 | 102 | </LinearLayout> |
94 | 103 | </LinearLayout> |
95 | 104 | |
96 | - <ImageView | |
97 | - android:id="@+id/imv_position" | |
98 | - android:layout_width="36dp" | |
99 | - android:layout_height="36dp" | |
100 | - android:layout_alignParentRight="true" | |
101 | - android:layout_centerVertical="true" | |
102 | - android:layout_marginRight="8dp" | |
103 | - android:layout_marginLeft="2dp"/> | |
105 | + | |
104 | 106 | </RelativeLayout> |
105 | 107 | |
106 | 108 | <View |
app/src/main/res/layout/layout_sns_member_row.xml
... | ... | @@ -22,7 +22,7 @@ |
22 | 22 | android:id="@+id/imv_user_icon" |
23 | 23 | android:layout_width="60dp" |
24 | 24 | android:layout_height="60dp" |
25 | - android:background="@drawable/ic_user"/> | |
25 | + android:background="@drawable/ic_ava"/> | |
26 | 26 | </LinearLayout> |
27 | 27 | <LinearLayout |
28 | 28 | android:layout_width="match_parent" |
app/src/main/res/layout/layout_sns_search_row.xml
app/src/main/res/layout/layout_sns_topic_row.xml
app/src/main/res/layout/layout_toolbar.xml
... | ... | @@ -4,7 +4,7 @@ |
4 | 4 | android:layout_height="wrap_content" |
5 | 5 | android:layout_alignParentTop="true" |
6 | 6 | android:id="@+id/ll_toolBar" |
7 | - android:background="@color/tab_sub2_unselected"> | |
7 | + android:background="@color/bg_header"> | |
8 | 8 | |
9 | 9 | <RelativeLayout |
10 | 10 | android:layout_width="match_parent" |
... | ... | @@ -42,6 +42,7 @@ |
42 | 42 | android:layout_height="wrap_content" |
43 | 43 | android:adjustViewBounds="true" |
44 | 44 | android:layout_alignParentRight="true" |
45 | + android:padding="6dp" | |
45 | 46 | android:src="@drawable/list_ic"/> |
46 | 47 | |
47 | 48 |
app/src/main/res/layout/notice_list_item.xml
app/src/main/res/layout/type_step.xml
... | ... | @@ -5,7 +5,7 @@ |
5 | 5 | android:layout_alignParentBottom="true" |
6 | 6 | android:id="@+id/ll_stepType" |
7 | 7 | android:layout_marginBottom="8dp" |
8 | - android:background="@color/tab_sub2_unselected"> | |
8 | + android:background="@color/bg_header"> | |
9 | 9 | |
10 | 10 | <LinearLayout |
11 | 11 | android:layout_width="match_parent" |
app/src/main/res/mipmap-hdpi/ic_launcher.png
app/src/main/res/mipmap-mdpi/ic_launcher.png
app/src/main/res/mipmap-xhdpi/ic_launcher.png
app/src/main/res/mipmap-xxhdpi/ic_launcher.png
app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
app/src/main/res/values/colors.xml
... | ... | @@ -23,5 +23,9 @@ |
23 | 23 | <color name="item_page8_top">#666666</color> |
24 | 24 | <color name="item_page8_top_end">#383838</color> |
25 | 25 | <color name="item_page8_content">#EEEEEE</color> |
26 | + | |
27 | + <color name="bg_main">#030087</color> | |
28 | + <color name="bg_header">#010137</color> | |
29 | + | |
26 | 30 | </resources> |