Commit 383e85498497b7379255204f2c537d0c24500d71
1 parent
0c1f9bf911
Exists in
master
and in
1 other branch
update handle UI
Showing 6 changed files with 66 additions and 19 deletions Inline Diff
- .idea/modules.xml
- app/src/main/java/com/dinhcv/lifelogpedometer/activity/PedometerActivity.java
- app/src/main/java/com/dinhcv/lifelogpedometer/activity/TopDateFragment.java
- app/src/main/java/com/dinhcv/lifelogpedometer/model/Shareprefer/Setting.java
- app/src/main/res/menu/main.xml
- app/src/main/res/values/strings.xml
.idea/modules.xml
| 1 | <?xml version="1.0" encoding="UTF-8"?> | 1 | <?xml version="1.0" encoding="UTF-8"?> |
| 2 | <project version="4"> | 2 | <project version="4"> |
| 3 | <component name="ProjectModuleManager"> | 3 | <component name="ProjectModuleManager"> |
| 4 | <modules> | 4 | <modules> |
| 5 | <module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" /> | 5 | <module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" /> |
| 6 | <module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" /> | ||
| 7 | <module fileurl="file://$PROJECT_DIR$/lifelog_android.iml" filepath="$PROJECT_DIR$/lifelog_android.iml" /> | ||
| 8 | <module fileurl="file://$PROJECT_DIR$/lifelog_android.iml" filepath="$PROJECT_DIR$/lifelog_android.iml" /> | 6 | <module fileurl="file://$PROJECT_DIR$/lifelog_android.iml" filepath="$PROJECT_DIR$/lifelog_android.iml" /> |
| 9 | <module fileurl="file://$PROJECT_DIR$/lifelogpedometer.iml" filepath="$PROJECT_DIR$/lifelogpedometer.iml" /> | 7 | <module fileurl="file://$PROJECT_DIR$/lifelogpedometer.iml" filepath="$PROJECT_DIR$/lifelogpedometer.iml" /> |
| 10 | </modules> | 8 | </modules> |
| 11 | </component> | 9 | </component> |
| 12 | </project> | 10 | </project> |
app/src/main/java/com/dinhcv/lifelogpedometer/activity/PedometerActivity.java
| 1 | package com.dinhcv.lifelogpedometer.activity; | 1 | package com.dinhcv.lifelogpedometer.activity; |
| 2 | 2 | ||
| 3 | import android.Manifest; | 3 | import android.Manifest; |
| 4 | import android.content.Intent; | 4 | import android.content.Intent; |
| 5 | import android.os.Build; | 5 | import android.os.Build; |
| 6 | import android.os.Bundle; | 6 | import android.os.Bundle; |
| 7 | import android.support.design.widget.TabLayout; | 7 | import android.support.design.widget.TabLayout; |
| 8 | import android.support.v4.app.Fragment; | 8 | import android.support.v4.app.Fragment; |
| 9 | import android.support.v4.app.FragmentManager; | 9 | import android.support.v4.app.FragmentManager; |
| 10 | import android.support.v4.app.FragmentPagerAdapter; | 10 | import android.support.v4.app.FragmentPagerAdapter; |
| 11 | import android.support.v4.content.PermissionChecker; | 11 | import android.support.v4.content.PermissionChecker; |
| 12 | import android.support.v4.view.ViewPager; | 12 | import android.support.v4.view.ViewPager; |
| 13 | import android.support.v7.widget.PopupMenu; | ||
| 13 | import android.support.v7.widget.Toolbar; | 14 | import android.support.v7.widget.Toolbar; |
| 14 | import android.view.Gravity; | 15 | import android.view.Gravity; |
| 15 | import android.view.MenuItem; | 16 | import android.view.MenuItem; |
| 16 | import android.view.View; | 17 | import android.view.View; |
| 17 | import android.view.Window; | 18 | import android.view.Window; |
| 18 | import android.view.WindowManager; | 19 | import android.view.WindowManager; |
| 19 | import android.widget.ImageView; | 20 | import android.widget.ImageView; |
| 20 | import android.widget.PopupWindow; | 21 | import android.widget.PopupWindow; |
| 21 | import android.widget.TextView; | 22 | import android.widget.TextView; |
| 23 | import android.widget.Toast; | ||
| 22 | 24 | ||
| 23 | import com.dinhcv.lifelogpedometer.R; | 25 | import com.dinhcv.lifelogpedometer.R; |
| 26 | import com.dinhcv.lifelogpedometer.model.Shareprefer.Setting; | ||
| 24 | import com.dinhcv.lifelogpedometer.utils.Debug; | 27 | import com.dinhcv.lifelogpedometer.utils.Debug; |
| 25 | import com.dinhcv.lifelogpedometer.utils.Utils; | 28 | import com.dinhcv.lifelogpedometer.utils.Utils; |
| 26 | 29 | ||
| 27 | import java.util.ArrayList; | 30 | import java.util.ArrayList; |
| 28 | import java.util.List; | 31 | import java.util.List; |
| 29 | 32 | ||
| 30 | public class PedometerActivity extends ActivityBase { | 33 | public class PedometerActivity extends ActivityBase { |
| 31 | private Toolbar mToolBar; | 34 | private Toolbar mToolBar; |
| 32 | private ViewPager mViewPager; | 35 | private ViewPager mViewPager; |
| 33 | private int mCurrentTab = 0; | 36 | private int mCurrentTab = 0; |
| 34 | private TabLayout mTabLayout; | 37 | private TabLayout mTabLayout; |
| 35 | private TextView tvPageTitle; | 38 | private TextView tvPageTitle; |
| 36 | private ImageView ivHome; | 39 | private ImageView ivHome; |
| 37 | private ImageView imvMenu; | 40 | private ImageView imvMenu; |
| 38 | 41 | ||
| 39 | private TopFragment mTopFragment; | 42 | private TopFragment mTopFragment; |
| 40 | private HistoryFragment mHistoryFragment; | 43 | private HistoryFragment mHistoryFragment; |
| 41 | private SnsFragment mSnsFragment; | 44 | private SnsFragment mSnsFragment; |
| 42 | 45 | ||
| 43 | private int[] tabIcons = { | 46 | private int[] tabIcons = { |
| 44 | com.dinhcv.lifelogpedometer.R.drawable.ic_date, | 47 | com.dinhcv.lifelogpedometer.R.drawable.ic_date, |
| 45 | R.drawable.ic_history, | 48 | R.drawable.ic_history, |
| 46 | R.drawable.ic_rank, | 49 | R.drawable.ic_rank, |
| 47 | R.drawable.ic_map, | 50 | R.drawable.ic_map, |
| 48 | R.drawable.ic_sns | 51 | R.drawable.ic_sns |
| 49 | }; | 52 | }; |
| 50 | 53 | ||
| 51 | public enum TAB { | 54 | public enum TAB { |
| 52 | DATE_TAB(0), | 55 | DATE_TAB(0), |
| 53 | HISTORY_TAB(1), | 56 | HISTORY_TAB(1), |
| 54 | RANK_TAB(2), | 57 | RANK_TAB(2), |
| 55 | MAP_TAB(3), | 58 | MAP_TAB(3), |
| 56 | SNS_TAB(4); | 59 | SNS_TAB(4); |
| 57 | 60 | ||
| 58 | private final int index; | 61 | private final int index; |
| 59 | 62 | ||
| 60 | TAB(int index) { | 63 | TAB(int index) { |
| 61 | this.index = index; | 64 | this.index = index; |
| 62 | } | 65 | } |
| 63 | 66 | ||
| 64 | public int getValue() { | 67 | public int getValue() { |
| 65 | return index; | 68 | return index; |
| 66 | } | 69 | } |
| 67 | } | 70 | } |
| 68 | 71 | ||
| 69 | @Override | 72 | @Override |
| 70 | protected void onCreate(Bundle savedInstanceState) { | 73 | protected void onCreate(Bundle savedInstanceState) { |
| 71 | super.onCreate(savedInstanceState); | 74 | super.onCreate(savedInstanceState); |
| 72 | 75 | ||
| 73 | setContentView(R.layout.activity_pedometer); | 76 | setContentView(R.layout.activity_pedometer); |
| 74 | getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE); | 77 | getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE); |
| 75 | 78 | ||
| 76 | initView(); | 79 | initView(); |
| 77 | 80 | ||
| 78 | if (android.support.v4.BuildConfig.DEBUG && Build.VERSION.SDK_INT >= 23 && PermissionChecker | 81 | if (android.support.v4.BuildConfig.DEBUG && Build.VERSION.SDK_INT >= 23 && PermissionChecker |
| 79 | .checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != | 82 | .checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != |
| 80 | PermissionChecker.PERMISSION_GRANTED) { | 83 | PermissionChecker.PERMISSION_GRANTED) { |
| 81 | requestPermissions(new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, 0); | 84 | requestPermissions(new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, 0); |
| 82 | } | 85 | } |
| 83 | } | 86 | } |
| 84 | 87 | ||
| 85 | private void initView() { | 88 | private void initView() { |
| 86 | 89 | ||
| 87 | tvPageTitle = (TextView) findViewById(R.id.tv_pageTitle); | 90 | tvPageTitle = (TextView) findViewById(R.id.tv_pageTitle); |
| 88 | ivHome = (ImageView) findViewById(R.id.iv_home); | 91 | ivHome = (ImageView) findViewById(R.id.iv_home); |
| 89 | imvMenu = (ImageView) findViewById(R.id.imv_menu); | 92 | imvMenu = (ImageView) findViewById(R.id.imv_menu); |
| 90 | 93 | ||
| 91 | mViewPager = (ViewPager) findViewById(R.id.viewpager); | 94 | mViewPager = (ViewPager) findViewById(R.id.viewpager); |
| 92 | mViewPager.setOffscreenPageLimit(5); | 95 | mViewPager.setOffscreenPageLimit(5); |
| 93 | setupViewPager(mViewPager); | 96 | setupViewPager(mViewPager); |
| 94 | mTabLayout = (TabLayout) findViewById(R.id.tabs); | 97 | mTabLayout = (TabLayout) findViewById(R.id.tabs); |
| 95 | mTabLayout.setupWithViewPager(mViewPager); | 98 | mTabLayout.setupWithViewPager(mViewPager); |
| 96 | //Set tab selected | 99 | //Set tab selected |
| 97 | TabLayout.Tab tab = mTabLayout.getTabAt(mCurrentTab); | 100 | TabLayout.Tab tab = mTabLayout.getTabAt(mCurrentTab); |
| 98 | if (tab != null) { | 101 | if (tab != null) { |
| 99 | tab.select(); | 102 | tab.select(); |
| 100 | } | 103 | } |
| 101 | 104 | ||
| 102 | changeColorStatusBar(); | 105 | changeColorStatusBar(); |
| 103 | setupTabIcons(); | 106 | setupTabIcons(); |
| 104 | 107 | ||
| 105 | //SonLT Add | 108 | //SonLT Add |
| 106 | ivHome.setOnClickListener(new View.OnClickListener() { | 109 | ivHome.setOnClickListener(new View.OnClickListener() { |
| 107 | @Override | 110 | @Override |
| 108 | public void onClick(View v) { | 111 | public void onClick(View v) { |
| 109 | switch (mCurrentTab){ | 112 | switch (mCurrentTab){ |
| 110 | case 0: mTopFragment.clickBackToHome(); break; | 113 | case 0: mTopFragment.clickBackToHome(); break; |
| 111 | case 1: mHistoryFragment.clickBackToHome(); break; | 114 | case 1: mHistoryFragment.clickBackToHome(); break; |
| 112 | case 4: mSnsFragment.handleToolbarClick(0); break; | 115 | case 4: mSnsFragment.handleToolbarClick(0); break; |
| 113 | default: break; | 116 | default: break; |
| 114 | } | 117 | } |
| 115 | } | 118 | } |
| 116 | }); | 119 | }); |
| 120 | |||
| 121 | imvMenu.setOnClickListener(new View.OnClickListener() { | ||
| 122 | @Override | ||
| 123 | public void onClick(View v) { | ||
| 124 | //Creating the instance of PopupMenu | ||
| 125 | PopupMenu popup = new PopupMenu(PedometerActivity.this, imvMenu); | ||
| 126 | //Inflating the Popup using xml file | ||
| 127 | popup.getMenuInflater().inflate(R.menu.main, popup.getMenu()); | ||
| 128 | |||
| 129 | //registering popup with OnMenuItemClickListener | ||
| 130 | popup.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() { | ||
| 131 | public boolean onMenuItemClick(MenuItem item) { | ||
| 132 | switch (item.getItemId()){ | ||
| 133 | case R.id.action_setting: | ||
| 134 | Toast.makeText( | ||
| 135 | PedometerActivity.this, | ||
| 136 | "Have not spec : " + item.getTitle(), | ||
| 137 | Toast.LENGTH_SHORT | ||
| 138 | ).show(); | ||
| 139 | break; | ||
| 140 | case R.id.action_profile: | ||
| 141 | Toast.makeText( | ||
| 142 | PedometerActivity.this, | ||
| 143 | "Have not spec : " + item.getTitle(), | ||
| 144 | Toast.LENGTH_SHORT | ||
| 145 | ).show(); | ||
| 146 | break; | ||
| 147 | case R.id.action_logout: | ||
| 148 | logout(); | ||
| 149 | break; | ||
| 150 | default: | ||
| 151 | Debug.warn("Not run here"); | ||
| 152 | break; | ||
| 153 | } | ||
| 154 | |||
| 155 | return true; | ||
| 156 | } | ||
| 157 | }); | ||
| 158 | |||
| 159 | popup.show(); //showing popup menu | ||
| 160 | } | ||
| 161 | }); //closing the setOnClickListener method | ||
| 117 | } | 162 | } |
| 118 | 163 | ||
| 119 | private void setupTabIcons() { | 164 | private void setupTabIcons() { |
| 120 | mTabLayout.getTabAt(0).setIcon(tabIcons[0]); | 165 | mTabLayout.getTabAt(0).setIcon(tabIcons[0]); |
| 121 | mTabLayout.getTabAt(1).setIcon(tabIcons[1]); | 166 | mTabLayout.getTabAt(1).setIcon(tabIcons[1]); |
| 122 | mTabLayout.getTabAt(2).setIcon(tabIcons[2]); | 167 | mTabLayout.getTabAt(2).setIcon(tabIcons[2]); |
| 123 | mTabLayout.getTabAt(3).setIcon(tabIcons[3]); | 168 | mTabLayout.getTabAt(3).setIcon(tabIcons[3]); |
| 124 | mTabLayout.getTabAt(4).setIcon(tabIcons[4]); | 169 | mTabLayout.getTabAt(4).setIcon(tabIcons[4]); |
| 125 | } | 170 | } |
| 126 | 171 | ||
| 127 | 172 | ||
| 128 | private void setTabView() { | 173 | private void setTabView() { |
| 129 | 174 | ||
| 130 | for (int i = 0; i < mTabLayout.getTabCount(); i++) { | 175 | for (int i = 0; i < mTabLayout.getTabCount(); i++) { |
| 131 | TextView tv = (TextView) mTabLayout.getChildAt(0).findViewById(android.R.id.title); | 176 | TextView tv = (TextView) mTabLayout.getChildAt(0).findViewById(android.R.id.title); |
| 132 | //tv.setTextColor(Color.BLACK); | 177 | //tv.setTextColor(Color.BLACK); |
| 133 | tv.setPadding(10, 10, 10, 15); | 178 | tv.setPadding(10, 10, 10, 15); |
| 134 | tv.setTextSize((float) 20.0); | 179 | tv.setTextSize((float) 20.0); |
| 135 | //tv.setTypeface(null, Typeface.BOLD); | 180 | //tv.setTypeface(null, Typeface.BOLD); |
| 136 | //tv.setBackgroundResource(R.drawable.icon); | 181 | //tv.setBackgroundResource(R.drawable.icon); |
| 137 | tv.setHeight(100); | 182 | tv.setHeight(100); |
| 138 | tv.setWidth(100); | 183 | tv.setWidth(100); |
| 139 | } | 184 | } |
| 140 | 185 | ||
| 141 | } | 186 | } |
| 142 | 187 | ||
| 143 | private void changeColorStatusBar() { | 188 | private void changeColorStatusBar() { |
| 144 | if (android.os.Build.VERSION.SDK_INT >= 21) { | 189 | if (android.os.Build.VERSION.SDK_INT >= 21) { |
| 145 | Window window = this.getWindow(); | 190 | Window window = this.getWindow(); |
| 146 | window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); | 191 | window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); |
| 147 | window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); | 192 | window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); |
| 148 | window.setStatusBarColor(Utils.getColorWrapper(this, R.color.white)); | 193 | // window.setStatusBarColor(Utils.getColorWrapper(this, R.color.white)); |
| 149 | } | 194 | } |
| 150 | } | 195 | } |
| 151 | 196 | ||
| 152 | // @Override | 197 | // @Override |
| 153 | // public boolean onCreateOptionsMenu(Menu menu) { | 198 | // public boolean onCreateOptionsMenu(Menu menu) { |
| 154 | // getMenuInflater().inflate(R.menu.setting_menu, menu); | 199 | // getMenuInflater().inflate(R.menu.setting_menu, menu); |
| 155 | // return true; | 200 | // return true; |
| 156 | // } | 201 | // } |
| 157 | 202 | ||
| 158 | @Override | 203 | @Override |
| 159 | public boolean onOptionsItemSelected(MenuItem item) { | 204 | public boolean onOptionsItemSelected(MenuItem item) { |
| 160 | return super.onOptionsItemSelected(item); | 205 | return super.onOptionsItemSelected(item); |
| 161 | } | 206 | } |
| 162 | 207 | ||
| 163 | /** | 208 | /** |
| 164 | * Setup pager | 209 | * Setup pager |
| 165 | * | 210 | * |
| 166 | * @param viewPager: view pager | 211 | * @param viewPager: view pager |
| 167 | */ | 212 | */ |
| 168 | private void setupViewPager(ViewPager viewPager) { | 213 | private void setupViewPager(ViewPager viewPager) { |
| 169 | ViewPagerAdapter adapter = new ViewPagerAdapter(getSupportFragmentManager()); | 214 | ViewPagerAdapter adapter = new ViewPagerAdapter(getSupportFragmentManager()); |
| 170 | mTopFragment = new TopFragment(); | 215 | mTopFragment = new TopFragment(); |
| 171 | adapter.addFragment(mTopFragment, getString(R.string.date)); | 216 | adapter.addFragment(mTopFragment, getString(R.string.date)); |
| 172 | mHistoryFragment = new HistoryFragment(); | 217 | mHistoryFragment = new HistoryFragment(); |
| 173 | adapter.addFragment(mHistoryFragment, getString(R.string.history)); | 218 | adapter.addFragment(mHistoryFragment, getString(R.string.history)); |
| 174 | adapter.addFragment(new RankFragment(), getString(R.string.ranking)); | 219 | adapter.addFragment(new RankFragment(), getString(R.string.ranking)); |
| 175 | adapter.addFragment(new MapFragment(), getString(R.string.map)); | 220 | adapter.addFragment(new MapFragment(), getString(R.string.map)); |
| 176 | mSnsFragment = new SnsFragment(); | 221 | mSnsFragment = new SnsFragment(); |
| 177 | adapter.addFragment(mSnsFragment, getString(R.string.sns)); | 222 | adapter.addFragment(mSnsFragment, getString(R.string.sns)); |
| 178 | viewPager.setAdapter(adapter); | 223 | viewPager.setAdapter(adapter); |
| 179 | } | 224 | } |
| 180 | 225 | ||
| 181 | /** | 226 | /** |
| 182 | * Class FragmentPagerAdapter | 227 | * Class FragmentPagerAdapter |
| 183 | */ | 228 | */ |
| 184 | class ViewPagerAdapter extends FragmentPagerAdapter { | 229 | class ViewPagerAdapter extends FragmentPagerAdapter { |
| 185 | private final List<Fragment> mFragmentList = new ArrayList<>(); | 230 | private final List<Fragment> mFragmentList = new ArrayList<>(); |
| 186 | private final List<String> mFragmentTitleList = new ArrayList<>(); | 231 | private final List<String> mFragmentTitleList = new ArrayList<>(); |
| 187 | 232 | ||
| 188 | public ViewPagerAdapter(FragmentManager manager) { | 233 | public ViewPagerAdapter(FragmentManager manager) { |
| 189 | super(manager); | 234 | super(manager); |
| 190 | } | 235 | } |
| 191 | 236 | ||
| 192 | @Override | 237 | @Override |
| 193 | public Fragment getItem(int position) { | 238 | public Fragment getItem(int position) { |
| 194 | return mFragmentList.get(position); | 239 | return mFragmentList.get(position); |
| 195 | } | 240 | } |
| 196 | 241 | ||
| 197 | @Override | 242 | @Override |
| 198 | public int getCount() { | 243 | public int getCount() { |
| 199 | return mFragmentList.size(); | 244 | return mFragmentList.size(); |
| 200 | } | 245 | } |
| 201 | 246 | ||
| 202 | private void addFragment(Fragment fragment, String title) { | 247 | private void addFragment(Fragment fragment, String title) { |
| 203 | mFragmentList.add(fragment); | 248 | mFragmentList.add(fragment); |
| 204 | mFragmentTitleList.add(title); | 249 | mFragmentTitleList.add(title); |
| 205 | } | 250 | } |
| 206 | 251 | ||
| 207 | @Override | 252 | @Override |
| 208 | public CharSequence getPageTitle(int position) { | 253 | public CharSequence getPageTitle(int position) { |
| 209 | return mFragmentTitleList.get(position); | 254 | return mFragmentTitleList.get(position); |
| 210 | } | 255 | } |
| 211 | } | 256 | } |
| 212 | 257 | ||
| 213 | @Override | 258 | @Override |
| 214 | protected void onResume() { | 259 | protected void onResume() { |
| 215 | super.onResume(); | 260 | super.onResume(); |
| 216 | mViewPager.addOnPageChangeListener(mPageChangeListener); | 261 | mViewPager.addOnPageChangeListener(mPageChangeListener); |
| 217 | } | 262 | } |
| 218 | 263 | ||
| 219 | @Override | 264 | @Override |
| 220 | protected void onPause() { | 265 | protected void onPause() { |
| 221 | super.onPause(); | 266 | super.onPause(); |
| 222 | mViewPager.removeOnPageChangeListener(mPageChangeListener); | 267 | mViewPager.removeOnPageChangeListener(mPageChangeListener); |
| 223 | } | 268 | } |
| 224 | 269 | ||
| 225 | private int mLastTab = 0; | 270 | private int mLastTab = 0; |
| 226 | private final ViewPager.OnPageChangeListener mPageChangeListener = new ViewPager | 271 | private final ViewPager.OnPageChangeListener mPageChangeListener = new ViewPager |
| 227 | .OnPageChangeListener | 272 | .OnPageChangeListener |
| 228 | () { | 273 | () { |
| 229 | @Override | 274 | @Override |
| 230 | public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { | 275 | public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { |
| 231 | //Nothing here | 276 | //Nothing here |
| 232 | } | 277 | } |
| 233 | 278 | ||
| 234 | @Override | 279 | @Override |
| 235 | public void onPageSelected(int position) { | 280 | public void onPageSelected(int position) { |
| 236 | ViewPagerAdapter adapter = (ViewPagerAdapter) mViewPager.getAdapter(); | 281 | ViewPagerAdapter adapter = (ViewPagerAdapter) mViewPager.getAdapter(); |
| 237 | SettingFragmentPresenter presenter = (SettingFragmentPresenter) adapter.getItem | 282 | SettingFragmentPresenter presenter = (SettingFragmentPresenter) adapter.getItem |
| 238 | (position); | 283 | (position); |
| 239 | presenter.onInvalidate(false); | 284 | presenter.onInvalidate(false); |
| 240 | 285 | ||
| 241 | switch (position) { | 286 | switch (position) { |
| 242 | case 4: | 287 | case 4: |
| 243 | tvPageTitle.setText(getString(R.string.sns_fragment)); | 288 | tvPageTitle.setText(getString(R.string.sns_fragment)); |
| 244 | ivHome.setVisibility(View.VISIBLE); | 289 | ivHome.setVisibility(View.VISIBLE); |
| 245 | break; | 290 | break; |
| 246 | case 1: | 291 | case 1: |
| 247 | tvPageTitle.setText(getString(R.string.today)); | 292 | tvPageTitle.setText(getString(R.string.today)); |
| 248 | ivHome.setVisibility(View.VISIBLE); | 293 | ivHome.setVisibility(View.VISIBLE); |
| 249 | break; | 294 | break; |
| 250 | 295 | ||
| 251 | case 0: | 296 | case 0: |
| 252 | tvPageTitle.setText(getString(R.string.home)); | 297 | tvPageTitle.setText(getString(R.string.home)); |
| 253 | ivHome.setVisibility(View.GONE); | 298 | ivHome.setVisibility(View.GONE); |
| 254 | break; | 299 | break; |
| 255 | 300 | ||
| 256 | default: | 301 | default: |
| 257 | tvPageTitle.setText(getString(R.string.home)); | 302 | tvPageTitle.setText(getString(R.string.home)); |
| 258 | ivHome.setVisibility(View.GONE); | 303 | ivHome.setVisibility(View.GONE); |
| 259 | break; | 304 | break; |
| 260 | } | 305 | } |
| 261 | // if (position == 1){ | 306 | // if (position == 1){ |
| 262 | // tvPageTitle.setText(getString(R.string.today)); | 307 | // tvPageTitle.setText(getString(R.string.today)); |
| 263 | // ivHome.setVisibility(View.VISIBLE); | 308 | // ivHome.setVisibility(View.VISIBLE); |
| 264 | // }else { | 309 | // }else { |
| 265 | // tvPageTitle.setText(getString(R.string.home)); | 310 | // tvPageTitle.setText(getString(R.string.home)); |
| 266 | // ivHome.setVisibility(View.GONE); | 311 | // ivHome.setVisibility(View.GONE); |
| 267 | // } | 312 | // } |
| 268 | 313 | ||
| 269 | mLastTab = position; | 314 | mLastTab = position; |
| 270 | mCurrentTab = position; | 315 | mCurrentTab = position; |
| 271 | } | 316 | } |
| 272 | 317 | ||
| 273 | @Override | 318 | @Override |
| 274 | public void onPageScrollStateChanged(int state) { | 319 | public void onPageScrollStateChanged(int state) { |
| 275 | //Nothing here | 320 | //Nothing here |
| 276 | if (state == ViewPager.SCROLL_STATE_SETTLING) { | 321 | if (state == ViewPager.SCROLL_STATE_SETTLING) { |
| 277 | if (mLastTab >= 0) { | 322 | if (mLastTab >= 0) { |
| 278 | ViewPagerAdapter adapter = (ViewPagerAdapter) mViewPager.getAdapter(); | 323 | ViewPagerAdapter adapter = (ViewPagerAdapter) mViewPager.getAdapter(); |
| 279 | SettingFragmentPresenter presenter = (SettingFragmentPresenter) adapter | 324 | SettingFragmentPresenter presenter = (SettingFragmentPresenter) adapter |
| 280 | .getItem(mLastTab); | 325 | .getItem(mLastTab); |
| 281 | 326 | ||
| 282 | Debug.normal("Save data in tab:" + mLastTab); | 327 | Debug.normal("Save data in tab:" + mLastTab); |
| 283 | presenter.onSaveData(); | 328 | presenter.onSaveData(); |
| 284 | } | 329 | } |
| 285 | } | 330 | } |
| 286 | } | 331 | } |
| 287 | }; | 332 | }; |
| 288 | 333 | ||
| 289 | public void setVisibleIconHome(boolean isVisible){ | 334 | public void setVisibleIconHome(boolean isVisible){ |
| 290 | if (isVisible) { | 335 | if (isVisible) { |
| 291 | ivHome.setVisibility(View.VISIBLE); | 336 | ivHome.setVisibility(View.VISIBLE); |
| 292 | }else { | 337 | }else { |
| 293 | ivHome.setVisibility(View.GONE); | 338 | ivHome.setVisibility(View.GONE); |
| 294 | } | 339 | } |
| 295 | } | 340 | } |
| 296 | 341 | ||
| 297 | private void showMenu(){ | 342 | private void logout(){ |
| 298 | // show | 343 | // clear data |
| 299 | // int[] location = new int[2]; | 344 | Setting.clearUserIdSharepre(PedometerActivity.this); |
| 300 | // imvMenu.getLocationOnScreen(location); | 345 | // go to login |
| 301 | // final View mView = inflater.inflate(R.layout.xxxx, null, false); | 346 | Intent intent = new Intent(PedometerActivity.this, LoginActivity.class); |
| 302 | // final PopupWindow popUp = new PopupWindow(mView, Width, Height, false); | 347 | intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); |
| 303 | // popUp.setTouchable(true); | 348 | intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); |
| 304 | // popUp.setFocusable(true); | 349 | startActivity(intent); |
| 305 | // popUp.setOutsideTouchable(true); | ||
| 306 | // popUp.showAtLocation(view, Gravity.NO_GRAVITY, location[0], location[1]); | ||
| 307 | } | 350 | } |
| 308 | 351 |
app/src/main/java/com/dinhcv/lifelogpedometer/activity/TopDateFragment.java
| 1 | package com.dinhcv.lifelogpedometer.activity; | 1 | package com.dinhcv.lifelogpedometer.activity; |
| 2 | 2 | ||
| 3 | import android.app.DatePickerDialog; | 3 | import android.app.DatePickerDialog; |
| 4 | import android.content.Context; | 4 | import android.content.Context; |
| 5 | import android.content.Intent; | 5 | import android.content.Intent; |
| 6 | import android.os.Bundle; | 6 | import android.os.Bundle; |
| 7 | import android.support.annotation.Nullable; | 7 | import android.support.annotation.Nullable; |
| 8 | import android.view.LayoutInflater; | 8 | import android.view.LayoutInflater; |
| 9 | import android.view.View; | 9 | import android.view.View; |
| 10 | import android.view.ViewGroup; | 10 | import android.view.ViewGroup; |
| 11 | import android.widget.DatePicker; | 11 | import android.widget.DatePicker; |
| 12 | import android.widget.ImageView; | 12 | import android.widget.ImageView; |
| 13 | import android.widget.LinearLayout; | 13 | import android.widget.LinearLayout; |
| 14 | import android.widget.TextView; | 14 | import android.widget.TextView; |
| 15 | 15 | ||
| 16 | import com.dinhcv.lifelogpedometer.R; | 16 | import com.dinhcv.lifelogpedometer.R; |
| 17 | import com.dinhcv.lifelogpedometer.adapter.NoticeAdapter; | 17 | import com.dinhcv.lifelogpedometer.adapter.NoticeAdapter; |
| 18 | import com.dinhcv.lifelogpedometer.customview.ExpandableListCustomView; | 18 | import com.dinhcv.lifelogpedometer.customview.ExpandableListCustomView; |
| 19 | import com.dinhcv.lifelogpedometer.interfaces.LLAPIManagerListener; | 19 | import com.dinhcv.lifelogpedometer.interfaces.LLAPIManagerListener; |
| 20 | import com.dinhcv.lifelogpedometer.model.structure.home.NoticeInfo; | 20 | import com.dinhcv.lifelogpedometer.model.structure.home.NoticeInfo; |
| 21 | import com.dinhcv.lifelogpedometer.model.structure.home.TagetInfo; | 21 | import com.dinhcv.lifelogpedometer.model.structure.home.TagetInfo; |
| 22 | import com.dinhcv.lifelogpedometer.portal.LLAPIManager; | 22 | import com.dinhcv.lifelogpedometer.portal.LLAPIManager; |
| 23 | import com.dinhcv.lifelogpedometer.utils.Const; | 23 | import com.dinhcv.lifelogpedometer.utils.Const; |
| 24 | import com.dinhcv.lifelogpedometer.utils.Debug; | 24 | import com.dinhcv.lifelogpedometer.utils.Debug; |
| 25 | import com.dinhcv.lifelogpedometer.utils.Utils; | 25 | import com.dinhcv.lifelogpedometer.utils.Utils; |
| 26 | 26 | ||
| 27 | import org.json.JSONArray; | 27 | import org.json.JSONArray; |
| 28 | import org.json.JSONException; | 28 | import org.json.JSONException; |
| 29 | import org.json.JSONObject; | 29 | import org.json.JSONObject; |
| 30 | 30 | ||
| 31 | import java.util.ArrayList; | 31 | import java.util.ArrayList; |
| 32 | import java.util.Calendar; | 32 | import java.util.Calendar; |
| 33 | import java.util.Date; | 33 | import java.util.Date; |
| 34 | import java.util.List; | 34 | import java.util.List; |
| 35 | 35 | ||
| 36 | public class TopDateFragment extends FragmentBase implements SettingFragmentPresenter { | 36 | public class TopDateFragment extends FragmentBase implements SettingFragmentPresenter { |
| 37 | 37 | ||
| 38 | private TextView tvDate; | 38 | private TextView tvDate; |
| 39 | private TextView tvStep; | 39 | private TextView tvStep; |
| 40 | private TextView tvRemain; | 40 | private TextView tvRemain; |
| 41 | private TextView tvRateDone; | 41 | private TextView tvRateDone; |
| 42 | private ImageView ivBack; | 42 | private ImageView ivBack; |
| 43 | private ImageView ivNext; | 43 | private ImageView ivNext; |
| 44 | 44 | ||
| 45 | private LinearLayout llBike; | 45 | private LinearLayout llBike; |
| 46 | private LinearLayout llWalking; | 46 | private LinearLayout llWalking; |
| 47 | private LinearLayout llRunning; | 47 | private LinearLayout llRunning; |
| 48 | 48 | ||
| 49 | private Date mAnaDate; | 49 | private Date mAnaDate; |
| 50 | private Calendar mCalendar; | 50 | private Calendar mCalendar; |
| 51 | 51 | ||
| 52 | private int mAnaDay; | 52 | private int mAnaDay; |
| 53 | private int mAnaMonth; | 53 | private int mAnaMonth; |
| 54 | private int mAnaYear; | 54 | private int mAnaYear; |
| 55 | private Context mContext; | 55 | private Context mContext; |
| 56 | 56 | ||
| 57 | private Const.STEP_TYPE stepType; | 57 | private Const.STEP_TYPE stepType; |
| 58 | private TagetInfo mTagetInfo = new TagetInfo(); | 58 | private TagetInfo mTagetInfo = new TagetInfo(); |
| 59 | private ImageView ivToDay; | 59 | private ImageView ivToDay; |
| 60 | private ExpandableListCustomView lvNotice; | 60 | private ExpandableListCustomView lvNotice; |
| 61 | private NoticeAdapter mNoticeAdapter; | 61 | private NoticeAdapter mNoticeAdapter; |
| 62 | private View mRootview; | 62 | private View mRootview; |
| 63 | private TopFragment mTopFragment; | 63 | private TopFragment mTopFragment; |
| 64 | 64 | ||
| 65 | public void setRootFragment(TopFragment frag) { | 65 | public void setRootFragment(TopFragment frag) { |
| 66 | this.mTopFragment = frag; | 66 | this.mTopFragment = frag; |
| 67 | } | 67 | } |
| 68 | 68 | ||
| 69 | @Override | 69 | @Override |
| 70 | public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle | 70 | public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle |
| 71 | savedInstanceState) { | 71 | savedInstanceState) { |
| 72 | // Inflate the layout for this fragment | 72 | // Inflate the layout for this fragment |
| 73 | mRootview = inflater.inflate(R.layout.fragment_top_date, container, false); | 73 | mRootview = inflater.inflate(R.layout.fragment_top_date, container, false); |
| 74 | mContext = getActivity(); | 74 | mContext = getActivity(); |
| 75 | initView(mRootview); | 75 | initView(mRootview); |
| 76 | initData(); | 76 | initData(); |
| 77 | return mRootview; | 77 | return mRootview; |
| 78 | } | 78 | } |
| 79 | 79 | ||
| 80 | 80 | ||
| 81 | private void initView(View rootView) { | 81 | private void initView(View rootView) { |
| 82 | tvDate = (TextView) rootView.findViewById(R.id.tv_date); | 82 | tvDate = (TextView) rootView.findViewById(R.id.tv_date); |
| 83 | tvStep = (TextView) rootView.findViewById(R.id.tv_step); | 83 | tvStep = (TextView) rootView.findViewById(R.id.tv_step); |
| 84 | tvRemain = (TextView) rootView.findViewById(R.id.tv_remainingStep); | 84 | tvRemain = (TextView) rootView.findViewById(R.id.tv_remainingStep); |
| 85 | tvRateDone = (TextView) rootView.findViewById(R.id.tv_completeRate); | 85 | tvRateDone = (TextView) rootView.findViewById(R.id.tv_completeRate); |
| 86 | ivBack = (ImageView) rootView.findViewById(R.id.iv_back); | 86 | ivBack = (ImageView) rootView.findViewById(R.id.iv_back); |
| 87 | ivNext = (ImageView) rootView.findViewById(R.id.iv_next); | 87 | ivNext = (ImageView) rootView.findViewById(R.id.iv_next); |
| 88 | 88 | ||
| 89 | llBike = (LinearLayout) rootView.findViewById(R.id.ll_bike); | 89 | llBike = (LinearLayout) rootView.findViewById(R.id.ll_bike); |
| 90 | llWalking = (LinearLayout) rootView.findViewById(R.id.ll_walking); | 90 | llWalking = (LinearLayout) rootView.findViewById(R.id.ll_walking); |
| 91 | llRunning = (LinearLayout) rootView.findViewById(R.id.ll_running); | 91 | llRunning = (LinearLayout) rootView.findViewById(R.id.ll_running); |
| 92 | 92 | ||
| 93 | ivToDay = (ImageView) rootView.findViewById(R.id.iv_toDay); | 93 | ivToDay = (ImageView) rootView.findViewById(R.id.iv_toDay); |
| 94 | lvNotice = (ExpandableListCustomView) rootView.findViewById(R.id.lv_notice); | 94 | lvNotice = (ExpandableListCustomView) rootView.findViewById(R.id.lv_notice); |
| 95 | 95 | ||
| 96 | handleEvent(); | 96 | handleEvent(); |
| 97 | } | 97 | } |
| 98 | 98 | ||
| 99 | private void handleEvent(){ | 99 | private void handleEvent(){ |
| 100 | tvDate.setOnClickListener(new View.OnClickListener() { | 100 | tvDate.setOnClickListener(new View.OnClickListener() { |
| 101 | @Override | 101 | @Override |
| 102 | public void onClick(View view) { | 102 | public void onClick(View view) { |
| 103 | handleAnaDatePicker(); | 103 | handleAnaDatePicker(); |
| 104 | } | 104 | } |
| 105 | }); | 105 | }); |
| 106 | 106 | ||
| 107 | ivBack.setOnClickListener(new View.OnClickListener() { | 107 | ivBack.setOnClickListener(new View.OnClickListener() { |
| 108 | @Override | 108 | @Override |
| 109 | public void onClick(View view) { | 109 | public void onClick(View view) { |
| 110 | mCalendar = Calendar.getInstance(); | 110 | mCalendar = Calendar.getInstance(); |
| 111 | mCalendar.setTime(mAnaDate); | 111 | mCalendar.setTime(mAnaDate); |
| 112 | mCalendar.add(Calendar.DAY_OF_MONTH, -1); | 112 | mCalendar.add(Calendar.DAY_OF_MONTH, -1); |
| 113 | Date date = mCalendar.getTime(); | 113 | Date date = mCalendar.getTime(); |
| 114 | tvDate.setText(Utils.dateToStringFormatDayMonthYearJp(date)); | 114 | tvDate.setText(Utils.dateToStringFormatDayMonthYearJp(date)); |
| 115 | mAnaDate = date; | 115 | mAnaDate = date; |
| 116 | getHomePage(mAnaDate, stepType); | 116 | getHomePage(mAnaDate, stepType); |
| 117 | } | 117 | } |
| 118 | }); | 118 | }); |
| 119 | 119 | ||
| 120 | ivNext.setOnClickListener(new View.OnClickListener() { | 120 | ivNext.setOnClickListener(new View.OnClickListener() { |
| 121 | @Override | 121 | @Override |
| 122 | public void onClick(View view) { | 122 | public void onClick(View view) { |
| 123 | mCalendar = Calendar.getInstance(); | 123 | mCalendar = Calendar.getInstance(); |
| 124 | mCalendar.setTime(mAnaDate); | 124 | mCalendar.setTime(mAnaDate); |
| 125 | mCalendar.add(Calendar.DAY_OF_MONTH, +1); | 125 | mCalendar.add(Calendar.DAY_OF_MONTH, +1); |
| 126 | Date date = mCalendar.getTime(); | 126 | Date date = mCalendar.getTime(); |
| 127 | tvDate.setText(Utils.dateToStringFormatDayMonthYearJp(date)); | 127 | tvDate.setText(Utils.dateToStringFormatDayMonthYearJp(date)); |
| 128 | mAnaDate = date; | 128 | mAnaDate = date; |
| 129 | getHomePage(mAnaDate, stepType); | 129 | getHomePage(mAnaDate, stepType); |
| 130 | } | 130 | } |
| 131 | }); | 131 | }); |
| 132 | 132 | ||
| 133 | 133 | ||
| 134 | llWalking.setOnClickListener(new View.OnClickListener() { | 134 | llWalking.setOnClickListener(new View.OnClickListener() { |
| 135 | @Override | 135 | @Override |
| 136 | public void onClick(View view) { | 136 | public void onClick(View view) { |
| 137 | stepType = Const.STEP_TYPE.WALKING; | 137 | stepType = Const.STEP_TYPE.WALKING; |
| 138 | updateUiStepType(false, true, false); | 138 | updateUiStepType(false, true, false); |
| 139 | // add data | 139 | // add data |
| 140 | getHomePage(mAnaDate, stepType); | 140 | getHomePage(mAnaDate, stepType); |
| 141 | } | 141 | } |
| 142 | }); | 142 | }); |
| 143 | 143 | ||
| 144 | llRunning.setOnClickListener(new View.OnClickListener() { | 144 | llRunning.setOnClickListener(new View.OnClickListener() { |
| 145 | @Override | 145 | @Override |
| 146 | public void onClick(View view) { | 146 | public void onClick(View view) { |
| 147 | stepType = Const.STEP_TYPE.RUNNING; | 147 | stepType = Const.STEP_TYPE.RUNNING; |
| 148 | updateUiStepType(false, false, true); | 148 | updateUiStepType(false, false, true); |
| 149 | // add | 149 | // add |
| 150 | getHomePage(mAnaDate, stepType); | 150 | getHomePage(mAnaDate, stepType); |
| 151 | } | 151 | } |
| 152 | }); | 152 | }); |
| 153 | 153 | ||
| 154 | llBike.setOnClickListener(new View.OnClickListener() { | 154 | llBike.setOnClickListener(new View.OnClickListener() { |
| 155 | @Override | 155 | @Override |
| 156 | public void onClick(View view) { | 156 | public void onClick(View view) { |
| 157 | stepType = Const.STEP_TYPE.BIKE; | 157 | stepType = Const.STEP_TYPE.BIKE; |
| 158 | updateUiStepType(true, false, false); | 158 | updateUiStepType(true, false, false); |
| 159 | // add data | 159 | // add data |
| 160 | getHomePage(mAnaDate, stepType); | 160 | getHomePage(mAnaDate, stepType); |
| 161 | } | 161 | } |
| 162 | }); | 162 | }); |
| 163 | 163 | ||
| 164 | ivToDay.setOnClickListener(new View.OnClickListener() { | 164 | ivToDay.setOnClickListener(new View.OnClickListener() { |
| 165 | @Override | 165 | @Override |
| 166 | public void onClick(View view) { | 166 | public void onClick(View view) { |
| 167 | mTopFragment.showDetailFragment(); | 167 | mTopFragment.showDetailFragment(); |
| 168 | } | 168 | } |
| 169 | }); | 169 | }); |
| 170 | 170 | ||
| 171 | } | 171 | } |
| 172 | 172 | ||
| 173 | private void updateUiStepType(boolean b1, boolean b2, boolean b3) { | 173 | private void updateUiStepType(boolean b1, boolean b2, boolean b3) { |
| 174 | llBike.setSelected(b1); | 174 | llBike.setSelected(b1); |
| 175 | llWalking.setSelected(b2); | 175 | llWalking.setSelected(b2); |
| 176 | llRunning.setSelected(b3); | 176 | llRunning.setSelected(b3); |
| 177 | } | 177 | } |
| 178 | 178 | ||
| 179 | /** | 179 | /** |
| 180 | * Show date picker dialog | 180 | * Show date picker dialog |
| 181 | */ | 181 | */ |
| 182 | private void handleAnaDatePicker() { | 182 | private void handleAnaDatePicker() { |
| 183 | 183 | ||
| 184 | new DatePickerDialog(getActivity(), new DatePickerDialog.OnDateSetListener() { | 184 | new DatePickerDialog(getActivity(), new DatePickerDialog.OnDateSetListener() { |
| 185 | @Override | 185 | @Override |
| 186 | public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) { | 186 | public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) { |
| 187 | 187 | ||
| 188 | mCalendar = Calendar.getInstance(); | 188 | mCalendar = Calendar.getInstance(); |
| 189 | mCalendar.set(year, monthOfYear, dayOfMonth); | 189 | mCalendar.set(year, monthOfYear, dayOfMonth); |
| 190 | mAnaYear = year; | 190 | mAnaYear = year; |
| 191 | mAnaMonth = monthOfYear; | 191 | mAnaMonth = monthOfYear; |
| 192 | mAnaDay = dayOfMonth; | 192 | mAnaDay = dayOfMonth; |
| 193 | Date date = mCalendar.getTime(); | 193 | Date date = mCalendar.getTime(); |
| 194 | tvDate.setText(Utils.dateToStringFormatDayMonthYearJp(date)); | 194 | tvDate.setText(Utils.dateToStringFormatDayMonthYearJp(date)); |
| 195 | mAnaDate = date; | 195 | mAnaDate = date; |
| 196 | 196 | ||
| 197 | getHomePage(mAnaDate, stepType); | 197 | getHomePage(mAnaDate, stepType); |
| 198 | } | 198 | } |
| 199 | }, mAnaYear, mAnaMonth, mAnaDay).show(); | 199 | }, mAnaYear, mAnaMonth, mAnaDay).show(); |
| 200 | 200 | ||
| 201 | } | 201 | } |
| 202 | 202 | ||
| 203 | 203 | ||
| 204 | /** | 204 | /** |
| 205 | * init data for | 205 | * init data for |
| 206 | */ | 206 | */ |
| 207 | private void initData() { | 207 | private void initData() { |
| 208 | mCalendar = Calendar.getInstance(); | 208 | mCalendar = Calendar.getInstance(); |
| 209 | mCalendar.setTime(new Date()); | 209 | mCalendar.setTime(new Date()); |
| 210 | mAnaDate = mCalendar.getTime(); | 210 | mAnaDate = mCalendar.getTime(); |
| 211 | mAnaYear = mCalendar.get(Calendar.YEAR); | 211 | mAnaYear = mCalendar.get(Calendar.YEAR); |
| 212 | mAnaMonth = mCalendar.get(Calendar.MONTH); | 212 | mAnaMonth = mCalendar.get(Calendar.MONTH); |
| 213 | mAnaDay = mCalendar.get(Calendar.DAY_OF_MONTH); | 213 | mAnaDay = mCalendar.get(Calendar.DAY_OF_MONTH); |
| 214 | 214 | ||
| 215 | tvDate.setText(Utils.dateToStringFormatDayMonthYearJp(mAnaDate)); | 215 | tvDate.setText(Utils.dateToStringFormatDayMonthYearJp(mAnaDate)); |
| 216 | 216 | ||
| 217 | stepType = Const.STEP_TYPE.WALKING; | 217 | stepType = Const.STEP_TYPE.WALKING; |
| 218 | updateUiStepType(false, true, false); | 218 | updateUiStepType(false, true, false); |
| 219 | getHomePage(mAnaDate, stepType); | 219 | getHomePage(mAnaDate, stepType); |
| 220 | } | 220 | } |
| 221 | 221 | ||
| 222 | 222 | ||
| 223 | private void getHomePage(Date date, Const.STEP_TYPE stepType){ | 223 | private void getHomePage(Date date, Const.STEP_TYPE stepType){ |
| 224 | 224 | ||
| 225 | showDialog(mContext); | 225 | showDialog(mContext); |
| 226 | LLAPIManager.homePage(date, stepType, new LLAPIManagerListener() { | 226 | LLAPIManager.homePage(date, stepType, new LLAPIManagerListener() { |
| 227 | @Override | 227 | @Override |
| 228 | public void onError(Error error) { | 228 | public void onError(Error error) { |
| 229 | Debug.error("Get data history error"); | 229 | Debug.error("Get data history error"); |
| 230 | hiddenDialog(); | 230 | hiddenDialog(); |
| 231 | showDialogNotData(); | 231 | showDialogNotData(); |
| 232 | } | 232 | } |
| 233 | 233 | ||
| 234 | @Override | 234 | @Override |
| 235 | public void onSuccess(String json) { | 235 | public void onSuccess(String json) { |
| 236 | Debug.error("Get data history success"); | 236 | Debug.error("Get data history success"); |
| 237 | hiddenDialog(); | 237 | hiddenDialog(); |
| 238 | loadDataDone(json); | 238 | loadDataDone(json); |
| 239 | } | 239 | } |
| 240 | 240 | ||
| 241 | @Override | 241 | @Override |
| 242 | public void onSuccess(JSONObject object) { | 242 | public void onSuccess(JSONObject object) { |
| 243 | Debug.error("Get data history success"); | 243 | Debug.error("Get data history success"); |
| 244 | hiddenDialog(); | 244 | hiddenDialog(); |
| 245 | } | 245 | } |
| 246 | }); | 246 | }); |
| 247 | } | 247 | } |
| 248 | 248 | ||
| 249 | private void showDialogNotData(){ | 249 | private void showDialogNotData(){ |
| 250 | showAlerDialog(mContext, getResources().getString(R.string.can_not_get_data)); | 250 | showAlerDialog(mContext, getResources().getString(R.string.can_not_get_data)); |
| 251 | } | 251 | } |
| 252 | 252 | ||
| 253 | private void loadDataDone(String jsonString) { | 253 | private void loadDataDone(String jsonString) { |
| 254 | JSONObject jsonObject = null; | 254 | JSONObject jsonObject = null; |
| 255 | try { | 255 | try { |
| 256 | jsonObject = new JSONObject(jsonString); | 256 | jsonObject = new JSONObject(jsonString); |
| 257 | int status = jsonObject.optInt("status"); | 257 | int status = jsonObject.optInt("status"); |
| 258 | if (status == 1) { | 258 | if (status == 1) { |
| 259 | JSONObject jsonObject1 = jsonObject.optJSONObject("result"); | 259 | JSONObject jsonObject1 = jsonObject.optJSONObject("result"); |
| 260 | JSONObject targetInf = jsonObject1.getJSONObject("targetInf"); | 260 | JSONObject targetInf = jsonObject1.getJSONObject("targetInf"); |
| 261 | JSONArray listNotice = jsonObject1.getJSONArray("listNotice"); | 261 | JSONArray listNotice = jsonObject1.getJSONArray("listNotice"); |
| 262 | 262 | ||
| 263 | if (targetInf != null){ | 263 | if (targetInf != null){ |
| 264 | String target = targetInf.optString("target_step"); | 264 | String target = targetInf.optString("target_step"); |
| 265 | Debug.normal("Target: "+ target); | 265 | Debug.normal("Target: "+ target); |
| 266 | mTagetInfo.setTaget(targetInf.optString("target_step")); | 266 | mTagetInfo.setTaget(targetInf.optString("target_step")); |
| 267 | mTagetInfo.setSteps(targetInf.optString("num_step")); | 267 | mTagetInfo.setSteps(targetInf.optString("num_step")); |
| 268 | mTagetInfo.setStepRemain(targetInf.optString("remaining_step")); | 268 | mTagetInfo.setStepRemain(targetInf.optString("remaining_step")); |
| 269 | mTagetInfo.setCompletePercent(targetInf.optString("complete_percent")); | 269 | mTagetInfo.setCompletePercent(targetInf.optString("complete_percent")); |
| 270 | } | 270 | } |
| 271 | 271 | ||
| 272 | if (listNotice != null && listNotice.length() > 0) { | 272 | if (listNotice != null && listNotice.length() > 0) { |
| 273 | List<NoticeInfo> infoLists = new ArrayList<>(); | 273 | List<NoticeInfo> infoLists = new ArrayList<>(); |
| 274 | for (int i = 0; i < listNotice.length(); i++){ | 274 | for (int i = 0; i < listNotice.length(); i++){ |
| 275 | NoticeInfo noticeInfo = new NoticeInfo(); | 275 | NoticeInfo noticeInfo = new NoticeInfo(); |
| 276 | JSONObject ob = (JSONObject) listNotice.get(i); | 276 | JSONObject ob = (JSONObject) listNotice.get(i); |
| 277 | noticeInfo.setId(ob.optInt("id")); | 277 | noticeInfo.setId(ob.optInt("id")); |
| 278 | noticeInfo.setContent(ob.optString("notice_content")); | 278 | noticeInfo.setContent(ob.optString("notice_content")); |
| 279 | infoLists.add(noticeInfo); | 279 | infoLists.add(noticeInfo); |
| 280 | } | 280 | } |
| 281 | 281 | ||
| 282 | mTagetInfo.setNoticeList(infoLists); | 282 | mTagetInfo.setNoticeList(infoLists); |
| 283 | } | 283 | } |
| 284 | 284 | ||
| 285 | } | 285 | } |
| 286 | } catch (JSONException e) { | 286 | } catch (JSONException e) { |
| 287 | e.printStackTrace(); | 287 | e.printStackTrace(); |
| 288 | mTagetInfo = new TagetInfo();; | 288 | mTagetInfo = new TagetInfo();; |
| 289 | } | 289 | } |
| 290 | 290 | ||
| 291 | loadUI(); | 291 | loadUI(); |
| 292 | } | 292 | } |
| 293 | 293 | ||
| 294 | 294 | ||
| 295 | private void loadUI(){ | 295 | private void loadUI(){ |
| 296 | tvStep.setText(String.valueOf(mTagetInfo.getSteps())); | 296 | tvStep.setText(String.valueOf(mTagetInfo.getSteps())); |
| 297 | tvRemain.setText(String.valueOf(mTagetInfo.getStepRemain())); | 297 | tvRemain.setText(String.valueOf(mTagetInfo.getStepRemain())); |
| 298 | tvRateDone.setText(getResources().getString(R.string.percent_unit, mTagetInfo.getCompletePercent())); | 298 | tvRateDone.setText(mContext.getResources().getString(R.string.percent_unit, mTagetInfo.getCompletePercent())); |
| 299 | 299 | ||
| 300 | List<NoticeInfo> infoLists = mTagetInfo.getNoticeList(); | 300 | List<NoticeInfo> infoLists = mTagetInfo.getNoticeList(); |
| 301 | if (infoLists != null && infoLists.size() >0){ | 301 | if (infoLists != null && infoLists.size() >0){ |
| 302 | mNoticeAdapter = new NoticeAdapter(mContext, infoLists); | 302 | mNoticeAdapter = new NoticeAdapter(mContext, infoLists); |
| 303 | lvNotice.setAdapter(mNoticeAdapter); | 303 | lvNotice.setAdapter(mNoticeAdapter); |
| 304 | lvNotice.setExpanded(true); | 304 | lvNotice.setExpanded(true); |
| 305 | } | 305 | } |
| 306 | 306 | ||
| 307 | } | 307 | } |
| 308 | 308 | ||
| 309 | 309 | ||
| 310 | @Override | 310 | @Override |
| 311 | public void onAttach(Context context) { | 311 | public void onAttach(Context context) { |
| 312 | super.onAttach(context); | 312 | super.onAttach(context); |
| 313 | 313 | ||
| 314 | } | 314 | } |
| 315 | 315 | ||
| 316 | 316 | ||
| 317 | @Override | 317 | @Override |
| 318 | public void onSaveData() { | 318 | public void onSaveData() { |
| 319 | 319 | ||
| 320 | } | 320 | } |
| 321 | 321 | ||
| 322 | @Override | 322 | @Override |
| 323 | public void onInvalidate(boolean isInit) { | 323 | public void onInvalidate(boolean isInit) { |
| 324 | initData(); | 324 | initData(); |
| 325 | } | 325 | } |
| 326 | 326 | ||
| 327 | @Override | 327 | @Override |
| 328 | public void onViewStateRestored(@Nullable Bundle savedInstanceState) { | 328 | public void onViewStateRestored(@Nullable Bundle savedInstanceState) { |
| 329 | super.onViewStateRestored(savedInstanceState); | 329 | super.onViewStateRestored(savedInstanceState); |
| 330 | 330 | ||
| 331 | initData(); | 331 | initData(); |
| 332 | } | 332 | } |
| 333 | 333 | ||
| 334 | 334 | ||
| 335 | @Override | 335 | @Override |
| 336 | public void onActivityResult(int requestCode, int resultCode, Intent data) { | 336 | public void onActivityResult(int requestCode, int resultCode, Intent data) { |
| 337 | super.onActivityResult(requestCode, resultCode, data); | 337 | super.onActivityResult(requestCode, resultCode, data); |
| 338 | 338 | ||
| 339 | } | 339 | } |
| 340 | 340 | ||
| 341 | } | 341 | } |
| 342 | 342 |
app/src/main/java/com/dinhcv/lifelogpedometer/model/Shareprefer/Setting.java
| 1 | package com.dinhcv.lifelogpedometer.model.Shareprefer; | 1 | package com.dinhcv.lifelogpedometer.model.Shareprefer; |
| 2 | 2 | ||
| 3 | import android.content.Context; | 3 | import android.content.Context; |
| 4 | import android.content.SharedPreferences; | 4 | import android.content.SharedPreferences; |
| 5 | 5 | ||
| 6 | import com.dinhcv.lifelogpedometer.utils.Debug; | 6 | import com.dinhcv.lifelogpedometer.utils.Debug; |
| 7 | 7 | ||
| 8 | import static android.content.Context.MODE_PRIVATE; | 8 | import static android.content.Context.MODE_PRIVATE; |
| 9 | 9 | ||
| 10 | public class Setting { | 10 | public class Setting { |
| 11 | 11 | ||
| 12 | private static String PEDOMETER = "pedometer"; | 12 | private static String PEDOMETER = "pedometer"; |
| 13 | public static String PAUSECOUNT = "pauseCount"; | 13 | public static String PAUSECOUNT = "pauseCount"; |
| 14 | public static String CORRECTSHUTDOWN = "correctShutdown"; | 14 | public static String CORRECTSHUTDOWN = "correctShutdown"; |
| 15 | public static void setPedometer(Context context, String type, String value){ | 15 | public static void setPedometer(Context context, String type, String value){ |
| 16 | SharedPreferences.Editor editor = context.getSharedPreferences(PEDOMETER, MODE_PRIVATE).edit(); | 16 | SharedPreferences.Editor editor = context.getSharedPreferences(PEDOMETER, MODE_PRIVATE).edit(); |
| 17 | editor.putString(type, value); | 17 | editor.putString(type, value); |
| 18 | editor.apply(); | 18 | editor.apply(); |
| 19 | editor.commit(); | 19 | editor.commit(); |
| 20 | } | 20 | } |
| 21 | 21 | ||
| 22 | public static void removePedometer(Context context, String type){ | 22 | public static void removePedometer(Context context, String type){ |
| 23 | SharedPreferences.Editor editor = context.getSharedPreferences(PEDOMETER, MODE_PRIVATE).edit(); | 23 | SharedPreferences.Editor editor = context.getSharedPreferences(PEDOMETER, MODE_PRIVATE).edit(); |
| 24 | editor.remove(type); | 24 | editor.remove(type); |
| 25 | editor.apply(); | 25 | editor.apply(); |
| 26 | } | 26 | } |
| 27 | 27 | ||
| 28 | public static void setPedometerPauseCount(Context context, int value){ | 28 | public static void setPedometerPauseCount(Context context, int value){ |
| 29 | SharedPreferences.Editor editor = context.getSharedPreferences(PEDOMETER, MODE_PRIVATE).edit(); | 29 | SharedPreferences.Editor editor = context.getSharedPreferences(PEDOMETER, MODE_PRIVATE).edit(); |
| 30 | editor.putInt(PAUSECOUNT, value); | 30 | editor.putInt(PAUSECOUNT, value); |
| 31 | editor.apply(); | 31 | editor.apply(); |
| 32 | editor.commit(); | 32 | editor.commit(); |
| 33 | } | 33 | } |
| 34 | 34 | ||
| 35 | public static int getPedometerPauseCount(Context context, int defaulValue){ | 35 | public static int getPedometerPauseCount(Context context, int defaulValue){ |
| 36 | SharedPreferences prefs = context.getSharedPreferences(PEDOMETER, MODE_PRIVATE); | 36 | SharedPreferences prefs = context.getSharedPreferences(PEDOMETER, MODE_PRIVATE); |
| 37 | int value = prefs.getInt(PAUSECOUNT, defaulValue); | 37 | int value = prefs.getInt(PAUSECOUNT, defaulValue); |
| 38 | return value; | 38 | return value; |
| 39 | } | 39 | } |
| 40 | 40 | ||
| 41 | public static void setPedometerCorrectShutdown(Context context, boolean value){ | 41 | public static void setPedometerCorrectShutdown(Context context, boolean value){ |
| 42 | SharedPreferences.Editor editor = context.getSharedPreferences(PEDOMETER, MODE_PRIVATE).edit(); | 42 | SharedPreferences.Editor editor = context.getSharedPreferences(PEDOMETER, MODE_PRIVATE).edit(); |
| 43 | editor.putBoolean(PAUSECOUNT, value); | 43 | editor.putBoolean(PAUSECOUNT, value); |
| 44 | editor.apply(); | 44 | editor.apply(); |
| 45 | editor.commit(); | 45 | editor.commit(); |
| 46 | } | 46 | } |
| 47 | 47 | ||
| 48 | public static boolean getPedometerCorrectShutdown(Context context, boolean defaulValue){ | 48 | public static boolean getPedometerCorrectShutdown(Context context, boolean defaulValue){ |
| 49 | SharedPreferences prefs = context.getSharedPreferences(PEDOMETER, MODE_PRIVATE); | 49 | SharedPreferences prefs = context.getSharedPreferences(PEDOMETER, MODE_PRIVATE); |
| 50 | boolean value = prefs.getBoolean(CORRECTSHUTDOWN, defaulValue); | 50 | boolean value = prefs.getBoolean(CORRECTSHUTDOWN, defaulValue); |
| 51 | return value; | 51 | return value; |
| 52 | } | 52 | } |
| 53 | 53 | ||
| 54 | 54 | ||
| 55 | // First run app | 55 | // First run app |
| 56 | private static final String USER_DATA_SHAREPRE = "app.user.data"; | 56 | private static final String USER_DATA_SHAREPRE = "app.user.data"; |
| 57 | public static final String ID_SHAREPRE = "id_data"; | 57 | public static final String ID_SHAREPRE = "id_data"; |
| 58 | public static final String EMAIL_SHAREPRE = "email_data"; | 58 | public static final String EMAIL_SHAREPRE = "email_data"; |
| 59 | public static final String USER_SHAREPRE = "user_data"; | 59 | public static final String USER_SHAREPRE = "user_data"; |
| 60 | public static final String PASS_SHAREPRE = "pass_data"; | 60 | public static final String PASS_SHAREPRE = "pass_data"; |
| 61 | public static final String TOKEN_SHAREPRE = "token_data"; | 61 | public static final String TOKEN_SHAREPRE = "token_data"; |
| 62 | 62 | ||
| 63 | public static void setUserDataSharepre(Context context, String key, String value){ | 63 | public static void setUserDataSharepre(Context context, String key, String value){ |
| 64 | SharedPreferences.Editor preferences = context.getSharedPreferences(USER_DATA_SHAREPRE, Context.MODE_PRIVATE).edit(); | 64 | SharedPreferences.Editor preferences = context.getSharedPreferences(USER_DATA_SHAREPRE, Context.MODE_PRIVATE).edit(); |
| 65 | preferences.putString(key, null); | 65 | preferences.putString(key, null); |
| 66 | preferences.commit(); | 66 | preferences.commit(); |
| 67 | } | 67 | } |
| 68 | 68 | ||
| 69 | public static String getUserDataSharepre(Context context, String key){ | 69 | public static String getUserDataSharepre(Context context, String key){ |
| 70 | SharedPreferences preferences = context.getSharedPreferences(USER_DATA_SHAREPRE, Context.MODE_PRIVATE); | 70 | SharedPreferences preferences = context.getSharedPreferences(USER_DATA_SHAREPRE, Context.MODE_PRIVATE); |
| 71 | String value = preferences.getString(key, null); | 71 | String value = preferences.getString(key, null); |
| 72 | return value; | 72 | return value; |
| 73 | } | 73 | } |
| 74 | 74 | ||
| 75 | private static void clearUserDataSharepre(Context context){ | 75 | private static void clearUserDataSharepre(Context context){ |
| 76 | SharedPreferences.Editor preferences = context.getSharedPreferences(USER_DATA_SHAREPRE, Context.MODE_PRIVATE).edit(); | 76 | SharedPreferences.Editor preferences = context.getSharedPreferences(USER_DATA_SHAREPRE, Context.MODE_PRIVATE).edit(); |
| 77 | preferences.clear(); | 77 | preferences.clear(); |
| 78 | preferences.apply(); | 78 | preferences.apply(); |
| 79 | } | 79 | } |
| 80 | 80 | ||
| 81 | 81 | ||
| 82 | private static final String USER_ID_SHAREPRE = "app.user.id.data"; | 82 | private static final String USER_ID_SHAREPRE = "app.user.id.data"; |
| 83 | 83 | ||
| 84 | public static void setUserIdSharepre(Context context, int value){ | 84 | public static void setUserIdSharepre(Context context, int value){ |
| 85 | SharedPreferences.Editor preferences = context.getSharedPreferences(USER_ID_SHAREPRE, Context.MODE_PRIVATE).edit(); | 85 | SharedPreferences.Editor preferences = context.getSharedPreferences(USER_ID_SHAREPRE, Context.MODE_PRIVATE).edit(); |
| 86 | preferences.putInt("user_id_data", value); | 86 | preferences.putInt("user_id_data", value); |
| 87 | preferences.commit(); | 87 | preferences.commit(); |
| 88 | } | 88 | } |
| 89 | 89 | ||
| 90 | public static int getUserIdSharepre(Context context){ | 90 | public static int getUserIdSharepre(Context context){ |
| 91 | SharedPreferences preferences = context.getSharedPreferences(USER_ID_SHAREPRE, Context.MODE_PRIVATE); | 91 | SharedPreferences preferences = context.getSharedPreferences(USER_ID_SHAREPRE, Context.MODE_PRIVATE); |
| 92 | int value = preferences.getInt("user_id_data", 0); | 92 | int value = preferences.getInt("user_id_data", 0); |
| 93 | return value; | 93 | return value; |
| 94 | } | 94 | } |
| 95 | 95 | ||
| 96 | private static void clearUserIdSharepre(Context context){ | 96 | public static void clearUserIdSharepre(Context context){ |
| 97 | SharedPreferences.Editor preferences = context.getSharedPreferences(USER_ID_SHAREPRE, Context.MODE_PRIVATE).edit(); | 97 | SharedPreferences.Editor preferences = context.getSharedPreferences(USER_ID_SHAREPRE, Context.MODE_PRIVATE).edit(); |
| 98 | preferences.clear(); | 98 | preferences.clear(); |
| 99 | preferences.apply(); | 99 | preferences.apply(); |
| 100 | } | 100 | } |
| 101 | 101 | ||
| 102 | //*** End add | 102 | //*** End add |
| 103 | } | 103 | } |
| 104 | 104 |
app/src/main/res/menu/main.xml
| 1 | <menu xmlns:android="http://schemas.android.com/apk/res/android" > | 1 | <menu xmlns:android="http://schemas.android.com/apk/res/android" > |
| 2 | 2 | ||
| 3 | <item | 3 | <item |
| 4 | android:id="@+id/action_pause" | 4 | android:id="@+id/action_setting" |
| 5 | android:orderInCategory="100" | 5 | android:orderInCategory="100" |
| 6 | android:title="@string/pause"/> | 6 | android:title="@string/setting"/> |
| 7 | <item | 7 | <item |
| 8 | android:id="@+id/action_settings" | 8 | android:id="@+id/action_profile" |
| 9 | android:orderInCategory="100" | 9 | android:orderInCategory="100" |
| 10 | android:title="@string/settings"/> | 10 | android:title="@string/profile_change"/> |
| 11 | |||
| 12 | <item | ||
| 13 | android:id="@+id/action_logout" | ||
| 14 | android:orderInCategory="100" | ||
| 15 | android:title="@string/logout"/> | ||
| 11 | 16 | ||
| 12 | </menu> | 17 | </menu> |
app/src/main/res/values/strings.xml
| 1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | <resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="MissingTranslation"> | 2 | <resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="MissingTranslation"> |
| 3 | <string name="app_id">com.dinhcv.lifelogpedometer</string> | 3 | <string name="app_id">com.dinhcv.lifelogpedometer</string> |
| 4 | <string name="app_name">LIFELOG</string> | 4 | <string name="app_name">LIFELOG</string> |
| 5 | <string name="sns_fragment">コミュニティー</string> | 5 | <string name="sns_fragment">コミュニティー</string> |
| 6 | <string name="goal">Goal</string> | 6 | <string name="goal">Goal</string> |
| 7 | <string name="steps">steps</string> | 7 | <string name="steps">steps</string> |
| 8 | <string name="settings">Settings</string> | 8 | <string name="settings">Settings</string> |
| 9 | <string name="total">Total</string> | 9 | <string name="total">Total</string> |
| 10 | <string name="average">Average</string> | 10 | <string name="average">Average</string> |
| 11 | <string name="close">close</string> | 11 | <string name="close">close</string> |
| 12 | <string name="pause">Pause</string> | 12 | <string name="pause">Pause</string> |
| 13 | <string name="logout">ログアウト</string> | ||
| 13 | <string name="setting">設定</string> | 14 | <string name="setting">設定</string> |
| 14 | <string name="profile_change">プロフェイール変更</string> | 15 | <string name="profile_change">プロフェイール変更</string> |
| 15 | <string name="step">step</string> | 16 | <string name="step">step</string> |
| 16 | <string name="remaining_number_step">残歩数</string> | 17 | <string name="remaining_number_step">残歩数</string> |
| 17 | <string name="achiverment_rate">達成率</string> | 18 | <string name="achiverment_rate">達成率</string> |
| 18 | <string name="notify">お知らせ</string> | 19 | <string name="notify">お知らせ</string> |
| 19 | <string name="data">●●●●●●●</string> | 20 | <string name="data">●●●●●●●</string> |
| 20 | <string name="bike">BIKE</string> | 21 | <string name="bike">BIKE</string> |
| 21 | <string name="walking">WALKING</string> | 22 | <string name="walking">WALKING</string> |
| 22 | <string name="running">RUNNING</string> | 23 | <string name="running">RUNNING</string> |
| 23 | <string name="home">HOME</string> | 24 | <string name="home">HOME</string> |
| 24 | <string name="today">TODAY</string> | 25 | <string name="today">TODAY</string> |
| 25 | <string name="date">日付</string> | 26 | <string name="date">日付</string> |
| 26 | <string name="today_jp">今日</string> | 27 | <string name="today_jp">今日</string> |
| 27 | <string name="history">履歴</string> | 28 | <string name="history">履歴</string> |
| 28 | <string name="ranking">ランキング</string> | 29 | <string name="ranking">ランキング</string> |
| 29 | <string name="map">MAP</string> | 30 | <string name="map">MAP</string> |
| 30 | <string name="sns">SNS</string> | 31 | <string name="sns">SNS</string> |
| 31 | <string name="step_further">目標まであと %$d 歩です</string> | 32 | <string name="step_further">目標まであと %$d 歩です</string> |
| 32 | <string name="goal_jp">目標</string> | 33 | <string name="goal_jp">目標</string> |
| 33 | <string name="step_jp">歩</string> | 34 | <string name="step_jp">歩</string> |
| 34 | <string name="km">KM</string> | 35 | <string name="km">KM</string> |
| 35 | <string name="time">時間</string> | 36 | <string name="time">時間</string> |
| 36 | <string name="carori">カロリー</string> | 37 | <string name="carori">カロリー</string> |
| 37 | 38 | ||
| 38 | <string name="pie_text_content1">/10.000</string> | 39 | <string name="pie_text_content1">/10.000</string> |
| 39 | <string name="pie_text_content2">目標まであと</string> | 40 | <string name="pie_text_content2">目標まであと</string> |
| 40 | <string name="pie_text_content3">3487歩です</string> | 41 | <string name="pie_text_content3">3487歩です</string> |
| 41 | <string name="pie_text_content3a">%d歩です</string> | 42 | <string name="pie_text_content3a">%d歩です</string> |
| 42 | <string name="percent">%s%</string> | 43 | <string name="percent">%s%</string> |
| 43 | <string name="percent_unit">%s%</string> | 44 | <string name="percent_unit">%s%</string> |
| 44 | <string name="step_unit">%d step</string> | 45 | <string name="step_unit">%d step</string> |
| 45 | <string name="step_unit_1">%d stepです</string> | 46 | <string name="step_unit_1">%d stepです</string> |
| 46 | <string name="kcal_unit">%s kcal</string> | 47 | <string name="kcal_unit">%s kcal</string> |
| 47 | <string name="distance_unit">%s KM</string> | 48 | <string name="distance_unit">%s KM</string> |
| 48 | <string name="time_unit">%s 時間</string> | 49 | <string name="time_unit">%s 時間</string> |
| 49 | 50 | ||
| 50 | <string name="login">ログイン</string> | 51 | <string name="login">ログイン</string> |
| 51 | <string name="email">メールアドレス</string> | 52 | <string name="email">メールアドレス</string> |
| 52 | <string name="password">パスワード</string> | 53 | <string name="password">パスワード</string> |
| 53 | <string name="forget_pass"><u>パスワードをお忘れの方</u></string> | 54 | <string name="forget_pass"><u>パスワードをお忘れの方</u></string> |
| 54 | <string name="register">登録がまだの方</string> | 55 | <string name="register">登録がまだの方</string> |
| 55 | <string name="register_button">新規登録</string> | 56 | <string name="register_button">新規登録</string> |
| 56 | <string name="username">ユーザー名</string> | 57 | <string name="username">ユーザー名</string> |
| 57 | <string name="name">氏名</string> | 58 | <string name="name">氏名</string> |
| 58 | <string name="nickname">ニックネーム</string> | 59 | <string name="nickname">ニックネーム</string> |
| 59 | <string name="confirm_pass">確認用パスワード</string> | 60 | <string name="confirm_pass">確認用パスワード</string> |
| 60 | <string name="sex">性別</string> | 61 | <string name="sex">性別</string> |
| 61 | <string name="birthday">生年月日</string> | 62 | <string name="birthday">生年月日</string> |
| 62 | <string name="height">身長</string> | 63 | <string name="height">身長</string> |
| 63 | <string name="weight">体重</string> | 64 | <string name="weight">体重</string> |
| 64 | <string name="level_active">1日の身体活動レベル</string> | 65 | <string name="level_active">1日の身体活動レベル</string> |
| 65 | <string name="low">低い</string> | 66 | <string name="low">低い</string> |
| 66 | <string name="usually">普通</string> | 67 | <string name="usually">普通</string> |
| 67 | <string name="hight">高い</string> | 68 | <string name="hight">高い</string> |
| 68 | <string name="body_fat_percent">体脂肪率</string> | 69 | <string name="body_fat_percent">体脂肪率</string> |
| 69 | <string name="address">お住いの地域</string> | 70 | <string name="address">お住いの地域</string> |
| 70 | <string name="comment">コメント</string> | 71 | <string name="comment">コメント</string> |
| 71 | <string name="member_registration">会員登録</string> | 72 | <string name="member_registration">会員登録</string> |
| 72 | <string name="send_push_notify">プッシュ通知を送信します。\nよろしいでしょうか?</string> | 73 | <string name="send_push_notify">プッシュ通知を送信します。\nよろしいでしょうか?</string> |
| 73 | <string name="not_allowed">許可しない</string> | 74 | <string name="not_allowed">許可しない</string> |
| 74 | <string name="allowed">許可</string> | 75 | <string name="allowed">許可</string> |
| 75 | <string name="please_select">選択してください</string> | 76 | <string name="please_select">選択してください</string> |
| 76 | 77 | ||
| 77 | <string name="prefecture">都道府県</string> | 78 | <string name="prefecture">都道府県</string> |
| 78 | 79 | ||
| 79 | <string name="login_error_title">ログインエラー</string> | 80 | <string name="login_error_title">ログインエラー</string> |
| 80 | <string name="login_error">ログインできません。</string> | 81 | <string name="login_error">ログインできません。</string> |
| 81 | <string name="ok">OK</string> | 82 | <string name="ok">OK</string> |
| 82 | <string name="error_title">エラー</string> | 83 | <string name="error_title">エラー</string> |
| 83 | <string name="password_is_null">パスワードはnullです。</string> | 84 | <string name="password_is_null">パスワードはnullです。</string> |
| 84 | <string name="account_is_null">メールはヌルです。</string> | 85 | <string name="account_is_null">メールはヌルです。</string> |
| 85 | <string name="uploading">アップロード中</string> | 86 | <string name="uploading">アップロード中</string> |
| 86 | <string name="register_err">レジスタエラー</string> | 87 | <string name="register_err">レジスタエラー</string> |
| 87 | <string name="err_exception">エラー例外</string> | 88 | <string name="err_exception">エラー例外</string> |
| 88 | <string name="cm">cm</string> | 89 | <string name="cm">cm</string> |
| 89 | <string name="kg">kg</string> | 90 | <string name="kg">kg</string> |
| 90 | <string name="percen">%</string> | 91 | <string name="percen">%</string> |
| 91 | <string name="waite_some_minute">しばらくお待ちください。</string> | 92 | <string name="waite_some_minute">しばらくお待ちください。</string> |
| 92 | <string name="request_pass_error">要求を送信できないため、パスワードを取得できません。</string> | 93 | <string name="request_pass_error">要求を送信できないため、パスワードを取得できません。</string> |
| 93 | <string name="password_not_send">パスワードが送信されていません。もう一度お試しください。</string> | 94 | <string name="password_not_send">パスワードが送信されていません。もう一度お試しください。</string> |
| 94 | <string name="password_have_send">パスワードが送られてきました、メールをチェックしてください。</string> | 95 | <string name="password_have_send">パスワードが送られてきました、メールをチェックしてください。</string> |
| 95 | <string name="register_success">登録成功</string> | 96 | <string name="register_success">登録成功</string> |
| 96 | 97 | ||
| 97 | <!-- message error register --> | 98 | <!-- message error register --> |
| 98 | <string name="username_null">ユーザー名はnullです。</string> | 99 | <string name="username_null">ユーザー名はnullです。</string> |
| 99 | <string name="name_null">名前はnullです。</string> | 100 | <string name="name_null">名前はnullです。</string> |
| 100 | <string name="nickname_null">ニックネームはnullです。</string> | 101 | <string name="nickname_null">ニックネームはnullです。</string> |
| 101 | <string name="mail_null">メールはヌルです。</string> | 102 | <string name="mail_null">メールはヌルです。</string> |
| 102 | <string name="mail_invalid">電子メールが無効です。</string> | 103 | <string name="mail_invalid">電子メールが無効です。</string> |
| 103 | <string name="password_null">パスワードはnullです。</string> | 104 | <string name="password_null">パスワードはnullです。</string> |
| 104 | <string name="confirm_pass_null">パスワードの確認はnullです。</string> | 105 | <string name="confirm_pass_null">パスワードの確認はnullです。</string> |
| 105 | <string name="password_less_6">パスワードの長さは6文字以上です。</string> | 106 | <string name="password_less_6">パスワードの長さは6文字以上です。</string> |
| 106 | <string name="confirm_pass_wrong">パスワードの確認が間違っています。</string> | 107 | <string name="confirm_pass_wrong">パスワードの確認が間違っています。</string> |
| 107 | <string name="sex_not_select">性別は選択されていません。</string> | 108 | <string name="sex_not_select">性別は選択されていません。</string> |
| 108 | <string name="birthday_not_select">誕生日は選択されていません。</string> | 109 | <string name="birthday_not_select">誕生日は選択されていません。</string> |
| 109 | <string name="height_null">Hightはnullです。</string> | 110 | <string name="height_null">Hightはnullです。</string> |
| 110 | <string name="weight_null">重量はnullです。</string> | 111 | <string name="weight_null">重量はnullです。</string> |
| 111 | <string name="body_fat_percent_null">体脂肪率はnullです。</string> | 112 | <string name="body_fat_percent_null">体脂肪率はnullです。</string> |
| 112 | <string name="comment_null">コメントはnullです。</string> | 113 | <string name="comment_null">コメントはnullです。</string> |
| 113 | <string name="level_not_select">レベルは選択されていません。</string> | 114 | <string name="level_not_select">レベルは選択されていません。</string> |
| 114 | <string name="province_not_select">州は選択されていません。</string> | 115 | <string name="province_not_select">州は選択されていません。</string> |
| 115 | 116 | ||
| 116 | <string name="please_input_email">メールを入力してください。</string> | 117 | <string name="please_input_email">メールを入力してください。</string> |
| 117 | <string name="please_input_confirm">確認コードを入力してください。</string> | 118 | <string name="please_input_confirm">確認コードを入力してください。</string> |
| 118 | <string name="send_confirm">送信確認</string> | 119 | <string name="send_confirm">送信確認</string> |
| 119 | 120 | ||
| 120 | <!--string relationship--> | 121 | <!--string relationship--> |
| 121 | <string name="male">男</string> | 122 | <string name="male">男</string> |
| 122 | <string name="female">女</string> | 123 | <string name="female">女</string> |
| 123 | 124 | ||
| 124 | <!--string host family job --> | 125 | <!--string host family job --> |
| 125 | <string name="job1">上場会社役員</string> | 126 | <string name="job1">上場会社役員</string> |
| 126 | <string name="job2">非上場会社役員</string> | 127 | <string name="job2">非上場会社役員</string> |
| 127 | <string name="job3">上場会社幹部社員</string> | 128 | <string name="job3">上場会社幹部社員</string> |
| 128 | <string name="job4">上場会社社員</string> | 129 | <string name="job4">上場会社社員</string> |
| 129 | <string name="job5">非上場会社社員</string> | 130 | <string name="job5">非上場会社社員</string> |
| 130 | <string name="job6">団体の役員</string> | 131 | <string name="job6">団体の役員</string> |
| 131 | <string name="job7">団体の職員</string> | 132 | <string name="job7">団体の職員</string> |
| 132 | <string name="job8">国家公務員</string> | 133 | <string name="job8">国家公務員</string> |
| 133 | <string name="job9">地方公務員</string> | 134 | <string name="job9">地方公務員</string> |
| 134 | <string name="job10">農林水産業</string> | 135 | <string name="job10">農林水産業</string> |
| 135 | <string name="job11">医師その他医療関係</string> | 136 | <string name="job11">医師その他医療関係</string> |
| 136 | <string name="job12">弁護士・会計士・税理士</string> | 137 | <string name="job12">弁護士・会計士・税理士</string> |
| 137 | <string name="job13">教職員</string> | 138 | <string name="job13">教職員</string> |
| 138 | <string name="job14">自営業</string> | 139 | <string name="job14">自営業</string> |
| 139 | <string name="job15">パート・アルバイト</string> | 140 | <string name="job15">パート・アルバイト</string> |
| 140 | <string name="job16">主婦</string> | 141 | <string name="job16">主婦</string> |
| 141 | <string name="job17">学生</string> | 142 | <string name="job17">学生</string> |
| 142 | <string name="job18">無職</string> | 143 | <string name="job18">無職</string> |
| 143 | <string name="job19">その他</string> | 144 | <string name="job19">その他</string> |
| 144 | 145 | ||
| 145 | 146 | ||
| 146 | <string name="tokutei_err_m">特定口座の開設有無をお選びください。</string> | 147 | <string name="tokutei_err_m">特定口座の開設有無をお選びください。</string> |
| 147 | 148 | ||
| 148 | <!--SNS screen--> | 149 | <!--SNS screen--> |
| 149 | <string name="error_empty_text">Empty</string> | 150 | <string name="error_empty_text">Empty</string> |
| 150 | <string name="msg_create_group_title">Create group</string> | 151 | <string name="msg_create_group_title">Create group</string> |
| 151 | <string name="msg_join_group_title">Join group</string> | 152 | <string name="msg_join_group_title">Join group</string> |
| 152 | <string name="msg_create_group_success">Success</string> | 153 | <string name="msg_create_group_success">Success</string> |
| 153 | <string name="msg_create_group_fail">Fail</string> | 154 | <string name="msg_create_group_fail">Fail</string> |
| 154 | <string name="msg_ok">OK</string> | 155 | <string name="msg_ok">OK</string> |
| 155 | <string name="sns_btn_view_member_title">メンバーを見る</string> | 156 | <string name="sns_btn_view_member_title">メンバーを見る</string> |
| 156 | <string name="sns_btn_view_tweet_title">ツイートを見る</string> | 157 | <string name="sns_btn_view_tweet_title">ツイートを見る</string> |
| 157 | <!-- City list --> | 158 | <!-- City list --> |
| 158 | <string name="please_search">検索してください</string> | 159 | <string name="please_search">検索してください</string> |
| 159 | 160 | ||
| 160 | <string name="city_item_1">北海道</string> | 161 | <string name="city_item_1">北海道</string> |
| 161 | <string name="city_item_2">青森県</string> | 162 | <string name="city_item_2">青森県</string> |
| 162 | <string name="city_item_3">岩手県</string> | 163 | <string name="city_item_3">岩手県</string> |
| 163 | <string name="city_item_4">宮城県</string> | 164 | <string name="city_item_4">宮城県</string> |
| 164 | <string name="city_item_5">秋田県</string> | 165 | <string name="city_item_5">秋田県</string> |
| 165 | <string name="city_item_6">山形県</string> | 166 | <string name="city_item_6">山形県</string> |
| 166 | <string name="city_item_7">福島県</string> | 167 | <string name="city_item_7">福島県</string> |
| 167 | <string name="city_item_8">茨城県</string> | 168 | <string name="city_item_8">茨城県</string> |
| 168 | <string name="city_item_9">栃木県</string> | 169 | <string name="city_item_9">栃木県</string> |
| 169 | <string name="city_item_10">群馬県</string> | 170 | <string name="city_item_10">群馬県</string> |
| 170 | <string name="city_item_11">埼玉県</string> | 171 | <string name="city_item_11">埼玉県</string> |
| 171 | <string name="city_item_12">千葉県</string> | 172 | <string name="city_item_12">千葉県</string> |
| 172 | <string name="city_item_13">東京都</string> | 173 | <string name="city_item_13">東京都</string> |
| 173 | <string name="city_item_14">神奈川県</string> | 174 | <string name="city_item_14">神奈川県</string> |
| 174 | <string name="city_item_15">新潟県</string> | 175 | <string name="city_item_15">新潟県</string> |
| 175 | <string name="city_item_16">富山県</string> | 176 | <string name="city_item_16">富山県</string> |
| 176 | <string name="city_item_17">石川県</string> | 177 | <string name="city_item_17">石川県</string> |
| 177 | <string name="city_item_18">福井県</string> | 178 | <string name="city_item_18">福井県</string> |
| 178 | <string name="city_item_19">山梨県</string> | 179 | <string name="city_item_19">山梨県</string> |
| 179 | <string name="city_item_20">長野県</string> | 180 | <string name="city_item_20">長野県</string> |
| 180 | <string name="city_item_21">岐阜県</string> | 181 | <string name="city_item_21">岐阜県</string> |
| 181 | <string name="city_item_22">静岡県</string> | 182 | <string name="city_item_22">静岡県</string> |
| 182 | <string name="city_item_23">愛知県</string> | 183 | <string name="city_item_23">愛知県</string> |
| 183 | <string name="city_item_24">三重県</string> | 184 | <string name="city_item_24">三重県</string> |
| 184 | <string name="city_item_25">滋賀県</string> | 185 | <string name="city_item_25">滋賀県</string> |
| 185 | <string name="city_item_26">京都府</string> | 186 | <string name="city_item_26">京都府</string> |
| 186 | <string name="city_item_27">大阪府</string> | 187 | <string name="city_item_27">大阪府</string> |
| 187 | <string name="city_item_28">兵庫県</string> | 188 | <string name="city_item_28">兵庫県</string> |
| 188 | <string name="city_item_29">奈良県</string> | 189 | <string name="city_item_29">奈良県</string> |
| 189 | <string name="city_item_30">和歌山県</string> | 190 | <string name="city_item_30">和歌山県</string> |
| 190 | <string name="city_item_31">鳥取県</string> | 191 | <string name="city_item_31">鳥取県</string> |
| 191 | <string name="city_item_32">島根県</string> | 192 | <string name="city_item_32">島根県</string> |
| 192 | <string name="city_item_33">岡山県</string> | 193 | <string name="city_item_33">岡山県</string> |
| 193 | <string name="city_item_34">広島県</string> | 194 | <string name="city_item_34">広島県</string> |
| 194 | <string name="city_item_35">山口県</string> | 195 | <string name="city_item_35">山口県</string> |
| 195 | <string name="city_item_36">徳島県</string> | 196 | <string name="city_item_36">徳島県</string> |
| 196 | <string name="city_item_37">香川県</string> | 197 | <string name="city_item_37">香川県</string> |
| 197 | <string name="city_item_38">愛媛県</string> | 198 | <string name="city_item_38">愛媛県</string> |
| 198 | <string name="city_item_39">高知県</string> | 199 | <string name="city_item_39">高知県</string> |
| 199 | <string name="city_item_40">福岡県</string> | 200 | <string name="city_item_40">福岡県</string> |
| 200 | <string name="city_item_41">佐賀県</string> | 201 | <string name="city_item_41">佐賀県</string> |
| 201 | <string name="city_item_42">長崎県</string> | 202 | <string name="city_item_42">長崎県</string> |
| 202 | <string name="city_item_43">熊本県</string> | 203 | <string name="city_item_43">熊本県</string> |
| 203 | <string name="city_item_44">大分県</string> | 204 | <string name="city_item_44">大分県</string> |
| 204 | <string name="city_item_45">宮崎県</string> | 205 | <string name="city_item_45">宮崎県</string> |
| 205 | <string name="city_item_46">鹿児島県</string> | 206 | <string name="city_item_46">鹿児島県</string> |
| 206 | <string name="city_item_47">沖縄県</string> | 207 | <string name="city_item_47">沖縄県</string> |
| 207 | 208 | ||
| 208 | <string name="one_day">1日</string> | 209 | <string name="one_day">1日</string> |
| 209 | <string name="one_week">1週間</string> | 210 | <string name="one_week">1週間</string> |
| 210 | <string name="one_month">1ヶ月</string> | 211 | <string name="one_month">1ヶ月</string> |
| 211 | <string name="three_month">3ヶ月</string> | 212 | <string name="three_month">3ヶ月</string> |
| 212 | <string name="six_month">6ヶ月</string> | 213 | <string name="six_month">6ヶ月</string> |
| 213 | <string name="calo_consume">消費カロリー</string> | 214 | <string name="calo_consume">消費カロリー</string> |
| 214 | <string name="distance">距離</string> | 215 | <string name="distance">距離</string> |
| 215 | 216 | ||
| 216 | <string name="sunday">日曜日</string> | 217 | <string name="sunday">日曜日</string> |
| 217 | <string name="monday">月曜日</string> | 218 | <string name="monday">月曜日</string> |
| 218 | <string name="tuesday">火曜日</string> | 219 | <string name="tuesday">火曜日</string> |
| 219 | <string name="wednesday">水曜日</string> | 220 | <string name="wednesday">水曜日</string> |
| 220 | <string name="thursday">木曜日</string> | 221 | <string name="thursday">木曜日</string> |
| 221 | <string name="friday">金曜日</string> | 222 | <string name="friday">金曜日</string> |
| 222 | <string name="saturday">土曜日</string> | 223 | <string name="saturday">土曜日</string> |
| 223 | 224 | ||
| 224 | <string name="facebook">facebook</string> | 225 | <string name="facebook">facebook</string> |
| 225 | <string name="twitter">twitter</string> | 226 | <string name="twitter">twitter</string> |
| 226 | <string name="line">line</string> | 227 | <string name="line">line</string> |
| 227 | <string name="mail">メール</string> | 228 | <string name="mail">メール</string> |
| 228 | <string name="other">その他</string> | 229 | <string name="other">その他</string> |
| 229 | <string name="kcal">kcal</string> | 230 | <string name="kcal">kcal</string> |
| 230 | <string name="favorable">好調</string> | 231 | <string name="favorable">好調</string> |
| 231 | <string name="little_more">もう少し</string> | 232 | <string name="little_more">もう少し</string> |
| 232 | 233 | ||
| 233 | <string name="mon">(月)</string> | 234 | <string name="mon">(月)</string> |
| 234 | <string name="tues">(火)</string> | 235 | <string name="tues">(火)</string> |
| 235 | <string name="wed">(水)</string> | 236 | <string name="wed">(水)</string> |
| 236 | <string name="thus">(木)</string> | 237 | <string name="thus">(木)</string> |
| 237 | <string name="fir">(金)</string> | 238 | <string name="fir">(金)</string> |
| 238 | <string name="sat">(土)</string> | 239 | <string name="sat">(土)</string> |
| 239 | <string name="sun">(日)</string> | 240 | <string name="sun">(日)</string> |
| 240 | 241 | ||
| 241 | <string name="weather">天気</string> | 242 | <string name="weather">天気</string> |
| 242 | 243 | ||
| 243 | <string name="calo_consumed">消費カロリー</string> | 244 | <string name="calo_consumed">消費カロリー</string> |
| 244 | <string name="can_not_get_data">データを取得できません。</string> | 245 | <string name="can_not_get_data">データを取得できません。</string> |
| 245 | <string name="loading">読み込み中</string> | 246 | <string name="loading">読み込み中</string> |
| 246 | 247 | ||
| 247 | <string name="sensor_available">カウントセンサーが使用できません。</string> | 248 | <string name="sensor_available">カウントセンサーが使用できません。</string> |
| 248 | 249 | ||
| 249 | </resources> | 250 | </resources> |