FANGLH vor 8 Jahren
Ursprung
Commit
011ef3a4d4

+ 12 - 0
WeiChat/src/main/res/menu/menu_uusport_list.xml

@@ -0,0 +1,12 @@
+<menu xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    xmlns:tools="http://schemas.android.com/tools"
+    tools:context="com.xzjmyk.pm.activity.MainActivity">
+
+    <item
+        android:id="@+id/more"
+        android:title="@string/sports_recode"
+        android:icon="@drawable/xlist"
+        app:showAsAction="ifRoom" />
+
+</menu>

+ 12 - 0
app_core/common/src/main/res/menu/menu_uusport_list.xml

@@ -0,0 +1,12 @@
+<menu xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    xmlns:tools="http://schemas.android.com/tools"
+    tools:context="com.xzjmyk.pm.activity.MainActivity">
+
+    <item
+        android:id="@+id/more"
+        android:title="@string/sports_recode"
+        android:icon="@drawable/xlist"
+        app:showAsAction="ifRoom" />
+
+</menu>

+ 2 - 0
app_modular/appme/src/main/AndroidManifest.xml

@@ -35,5 +35,7 @@
         <activity
             android:name="com.uas.appme.other.activity.SelectAreaActivity"
             android:screenOrientation="portrait" />
+        <activity android:name=".pedometer.view.UURanking"
+            android:label="排行榜"></activity>
     </application>
 </manifest>

+ 76 - 0
app_modular/appme/src/main/java/com/uas/appme/pedometer/adapter/UURankingAdapter.java

@@ -0,0 +1,76 @@
+package com.uas.appme.pedometer.adapter;
+
+import android.content.Context;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.common.data.ListUtils;
+import com.uas.appme.R;
+import com.uas.appme.pedometer.bean.StepEntity;
+
+import java.util.List;
+
+import de.hdodenhof.circleimageview.CircleImageView;
+
+/**
+ * Created by FANGlh on 2017/9/19.
+ * function:
+ */
+
+public class UURankingAdapter extends BaseAdapter{
+    private List<StepEntity> mList;
+    private Context mContext;
+
+    public List<StepEntity> getmList() {return mList;}
+    public void setmList(List<StepEntity> mList) {this.mList = mList;}
+    public UURankingAdapter(Context mContext){this.mContext = mContext;}
+    @Override
+    public int getCount() {
+        return ListUtils.isEmpty(mList) ? 0 : mList.size();
+    }
+
+    @Override
+    public Object getItem(int position) {
+        return mList.get(position);
+    }
+
+    @Override
+    public long getItemId(int position) {
+        return position;
+    }
+
+    @Override
+    public View getView(int position, View convertView, ViewGroup parent) {
+        ViewHolder viewHolder = null;
+        if (convertView == null){
+            viewHolder = new ViewHolder();
+            convertView =  View.inflate(mContext, R.layout.item_uuranking,null);
+            viewHolder.ranking_tv = (TextView) convertView.findViewById(R.id.ranking_tv);
+            viewHolder.name_tv = (TextView) convertView.findViewById(R.id.name_tv);
+            viewHolder.steps_tv = (TextView) convertView.findViewById(R.id.steps_tv);
+            viewHolder.prise_tv = (TextView) convertView.findViewById(R.id.prise_tv);
+            viewHolder.photo_img = (CircleImageView) convertView.findViewById(R.id.photo_img);
+            viewHolder.prise_im = (ImageView) convertView.findViewById(R.id.prise_im);
+            convertView.setTag(viewHolder);
+        }else {
+            viewHolder = (ViewHolder) convertView.getTag();
+        }
+        viewHolder.ranking_tv.setText(position+"");
+        viewHolder.name_tv.setText("方龙海");
+        viewHolder.steps_tv.setText(mList.get(position).getSteps());
+        viewHolder.prise_tv.setText("0");
+        return convertView;
+    }
+
+    class ViewHolder{
+        TextView ranking_tv;
+        CircleImageView photo_img;
+        TextView name_tv;
+        TextView steps_tv;
+        TextView prise_tv;
+        ImageView prise_im;
+    }
+}

+ 5 - 0
app_modular/appme/src/main/java/com/uas/appme/pedometer/view/NewStepActivity.java

@@ -299,6 +299,7 @@ public class NewStepActivity extends BaseActivity implements Handler.Callback {
 
     @Override
     public boolean onCreateOptionsMenu(Menu menu) {
+        getMenuInflater().inflate(R.menu.menu_uusport_list, menu);
         return super.onCreateOptionsMenu(menu);
     }
 
@@ -306,6 +307,9 @@ public class NewStepActivity extends BaseActivity implements Handler.Callback {
     public boolean onOptionsItemSelected(MenuItem item) {
         if (item.getItemId() == android.R.id.home){
             startActivity(new Intent(getApplicationContext(), SettingActivity.class));
+        }else if (item.getItemId() == R.id.more){
+            ToastMessage("UUSportList");
+            startActivity(new Intent(this,UURanking.class));
         }
         return super.onOptionsItemSelected(item);
     }
@@ -315,4 +319,5 @@ public class NewStepActivity extends BaseActivity implements Handler.Callback {
         startActivity(new Intent(getApplicationContext(), SettingActivity.class));
         super.onBackPressed();
     }
+
 }

+ 102 - 0
app_modular/appme/src/main/java/com/uas/appme/pedometer/view/UURanking.java

@@ -0,0 +1,102 @@
+package com.uas.appme.pedometer.view;
+
+import android.os.Bundle;
+import android.view.View;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+import com.core.app.MyApplication;
+import com.core.base.BaseActivity;
+import com.core.utils.CommonUtil;
+import com.core.utils.helper.AvatarHelper;
+import com.handmark.pulltorefresh.library.PullToRefreshListView;
+import com.uas.appme.R;
+import com.uas.appme.pedometer.adapter.UURankingAdapter;
+import com.uas.appme.pedometer.bean.StepEntity;
+import com.uas.appme.pedometer.db.StepDataDao;
+import com.uas.appme.pedometer.utils.TimeUtil;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import de.hdodenhof.circleimageview.CircleImageView;
+
+/**
+ * Created by FANGlh on 2017/9/19.
+ * function:
+ */
+
+public class UURanking extends BaseActivity {
+    private CircleImageView mPhotoImg;
+    private TextView mNameTv;
+    private TextView mRankingTv;
+    private TextView mStepsTv;
+    private TextView mPriseTv;
+    private ImageView mPriseIm;
+    private View mHideAboveAf;
+    private LinearLayout mAttentionLl;
+    private PullToRefreshListView mAttentionPtlv;
+    private LinearLayout mAllLl;
+    private PullToRefreshListView mAllPtlv;
+    private TextView mInviteFriendsTv;
+    private StepDataDao stepDataDao;
+    private String curSelDate;
+    private String myem_name;
+    private List<StepEntity> stepEntityList;
+    private UURankingAdapter mRankAdapter;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.uu_ranking_activity);
+        initView();
+        initData();
+    }
+
+    private void initView() {
+
+        mPhotoImg = (CircleImageView) findViewById(R.id.photo_img);
+        mNameTv = (TextView) findViewById(R.id.name_tv);
+        mRankingTv = (TextView) findViewById(R.id.ranking_tv);
+        mStepsTv = (TextView) findViewById(R.id.steps_tv);
+        mPriseTv = (TextView) findViewById(R.id.prise_tv);
+        mPriseIm = (ImageView) findViewById(R.id.prise_im);
+        mHideAboveAf = (View) findViewById(R.id.hide_above_af);
+        mAttentionLl = (LinearLayout) findViewById(R.id.attention_ll);
+        mAttentionPtlv = (PullToRefreshListView) findViewById(R.id.attention_ptlv);
+        mAllLl = (LinearLayout) findViewById(R.id.all_ll);
+        mAllPtlv = (PullToRefreshListView) findViewById(R.id.all_ptlv);
+        mInviteFriendsTv = (TextView) findViewById(R.id.invite_friends_tv);
+        stepDataDao = new StepDataDao(this);
+        curSelDate = TimeUtil.getCurrentDate();
+        stepEntityList = new ArrayList<>();
+        mRankAdapter = new UURankingAdapter(this);
+        mAllPtlv.getRefreshableView().setAdapter(mRankAdapter);
+
+        myem_name = CommonUtil.getSharedPreferences(MyApplication.getInstance(), "erp_emname");
+        mNameTv.setText(myem_name+"");
+        String loginUserId = MyApplication.getInstance().mLoginUser.getUserId();
+        AvatarHelper.getInstance().display(loginUserId, mPhotoImg, true, false);
+        StepEntity stepEntity = stepDataDao.getCurDataByDate(curSelDate);
+        if (stepEntity != null) {
+            int steps = Integer.parseInt(stepEntity.getSteps());
+            //获取全局的步数
+            mStepsTv.setText(String.valueOf(steps));
+        } else {
+            //获取全局的步数
+            mStepsTv.setText("0");
+        }
+
+        stepEntityList.clear();
+        stepEntityList.addAll(stepDataDao.getAllDatas());
+        mRankAdapter.setmList(stepEntityList);
+        mRankAdapter.notifyDataSetChanged();
+    }
+
+    private void initData() {
+
+    }
+
+
+}

+ 80 - 0
app_modular/appme/src/main/res/layout/item_uuattention.xml

@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent">
+    <RelativeLayout
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:padding="5dp"
+        android:layout_marginLeft="20dp"
+        android:layout_marginRight="10dp"
+        android:background="@color/bg_main"
+        >
+
+        <de.hdodenhof.circleimageview.CircleImageView
+            android:id="@+id/photo_img"
+            android:layout_width="45dp"
+            android:layout_height="45dp"
+            android:contentDescription="@string/app_name"
+            android:layout_marginTop="5dp"
+            android:layout_marginBottom="5dp"
+            android:src="@drawable/common_header_boy"/>
+
+        <TextView
+            android:id="@+id/name_tv"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginLeft="8dp"
+            android:layout_toRightOf="@+id/photo_img"
+            android:textColor="@color/black"
+            android:textSize="@dimen/text_hine"
+            android:layout_marginTop="10dp"
+            android:text="张三"
+
+            />
+        <TextView
+            android:id="@+id/ranking_tv"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginLeft="8dp"
+            android:layout_toRightOf="@+id/photo_img"
+            android:layout_below="@id/name_tv"
+            android:textColor="@color/gray"
+            android:textSize="@dimen/text_hine"
+            android:layout_marginTop="4dp"
+            android:text="第一名"/>
+
+        <TextView
+            android:id="@+id/steps_tv"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="20dp"
+            android:layout_marginBottom="0dp"
+            android:textSize="@dimen/BigTextSize"
+            android:text="9999"
+            android:textColor="@color/green"
+            android:layout_toLeftOf="@+id/prise_tv"
+            android:layout_marginRight="20dp"
+            />
+
+        <TextView
+            android:id="@+id/prise_tv"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_alignParentRight="true"
+            android:layout_marginTop="5dp"
+            android:layout_marginBottom="0dp"
+            android:textSize="@dimen/text_hine"
+            android:text="1"
+            android:textColor="@color/text_hine"
+            android:layout_marginRight="5dp"/>
+        <ImageView
+            android:id="@+id/prise_im"
+            android:layout_width="20dp"
+            android:layout_height="20dp"
+            android:src="@drawable/uuu"
+            android:layout_alignParentRight="true"
+            android:layout_below="@+id/prise_tv"
+            android:layout_marginTop="5dp"/>
+    </RelativeLayout>
+</LinearLayout>

+ 82 - 0
app_modular/appme/src/main/res/layout/item_uuranking.xml

@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="horizontal">
+
+    <TextView
+        android:id="@+id/ranking_tv"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_toRightOf="@+id/photo_img"
+        android:textColor="@color/black"
+        android:textSize="@dimen/text_main"
+        android:text="1"
+        android:layout_marginTop="20dp"
+        android:layout_alignParentLeft="true"
+        android:layout_marginLeft="5dp"
+        />
+
+    <RelativeLayout
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:padding="5dp"
+        android:layout_marginRight="10dp"
+        android:background="@color/bg_main"
+        >
+        <de.hdodenhof.circleimageview.CircleImageView
+            android:id="@+id/photo_img"
+            android:layout_width="45dp"
+            android:layout_height="45dp"
+            android:contentDescription="@string/app_name"
+            android:layout_marginTop="5dp"
+            android:layout_marginBottom="5dp"
+            android:src="@drawable/common_header_boy"/>
+
+        <TextView
+            android:id="@+id/name_tv"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginLeft="8dp"
+            android:layout_toRightOf="@+id/photo_img"
+            android:textColor="@color/black"
+            android:textSize="@dimen/text_hine"
+            android:text="张三"
+            android:layout_marginTop="20dp"
+            />
+
+
+        <TextView
+            android:id="@+id/steps_tv"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:textSize="@dimen/BigTextSize"
+            android:text="9999"
+            android:textColor="@color/green"
+            android:layout_marginRight="15dp"
+            android:layout_below="@+id/prise_tv"
+            android:layout_toLeftOf="@+id/prise_im"
+            android:layout_toStartOf="@+id/prise_im"
+            android:layout_marginEnd="15dp" />
+
+        <TextView
+            android:id="@+id/prise_tv"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_alignParentRight="true"
+            android:layout_marginTop="5dp"
+            android:layout_marginBottom="0dp"
+            android:textSize="@dimen/text_hine"
+            android:text="1"
+            android:textColor="@color/text_hine"
+            android:layout_marginRight="5dp"/>
+        <ImageView
+            android:id="@+id/prise_im"
+            android:layout_width="20dp"
+            android:layout_height="20dp"
+            android:src="@drawable/uuu"
+            android:layout_alignParentRight="true"
+            android:layout_below="@+id/prise_tv"
+            android:layout_marginTop="5dp"/>
+    </RelativeLayout>
+</LinearLayout>

+ 158 - 0
app_modular/appme/src/main/res/layout/uu_ranking_activity.xml

@@ -0,0 +1,158 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="vertical">
+
+    <ImageView
+        android:layout_width="match_parent"
+        android:layout_height="200dp"
+        android:background="@drawable/uuu"/>
+
+
+    <RelativeLayout
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:padding="5dp"
+        android:background="@color/bg_main"
+        >
+
+        <de.hdodenhof.circleimageview.CircleImageView
+            android:id="@+id/photo_img"
+            android:layout_width="45dp"
+            android:layout_height="45dp"
+            android:contentDescription="@string/app_name"
+            android:layout_marginTop="5dp"
+            android:layout_marginBottom="5dp"
+            android:src="@drawable/common_header_boy"
+            android:layout_marginLeft="20dp"
+            />
+
+        <TextView
+            android:id="@+id/name_tv"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginLeft="8dp"
+            android:layout_toRightOf="@+id/photo_img"
+            android:textColor="@color/black"
+            android:textSize="@dimen/text_hine"
+            android:layout_marginTop="10dp"
+            android:text="张三"
+
+            />
+        <TextView
+            android:id="@+id/ranking_tv"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginLeft="8dp"
+            android:layout_toRightOf="@+id/photo_img"
+            android:layout_below="@id/name_tv"
+            android:textColor="@color/gray"
+            android:textSize="@dimen/text_hine"
+            android:layout_marginTop="4dp"
+            android:text="第一名"/>
+
+        <TextView
+            android:id="@+id/steps_tv"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="20dp"
+            android:layout_marginBottom="0dp"
+            android:textSize="@dimen/BigTextSize"
+            android:text="9999"
+            android:textColor="@color/green"
+            android:layout_toLeftOf="@+id/prise_tv"
+            android:layout_marginRight="20dp"
+            />
+
+        <TextView
+            android:id="@+id/prise_tv"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_alignParentRight="true"
+            android:layout_marginTop="5dp"
+            android:layout_marginBottom="0dp"
+            android:textSize="@dimen/text_hine"
+            android:text="1"
+            android:textColor="@color/text_hine"
+            android:layout_marginRight="15dp"
+            />
+        <ImageView
+            android:id="@+id/prise_im"
+            android:layout_width="20dp"
+            android:layout_height="20dp"
+            android:src="@drawable/uuu"
+            android:layout_alignParentRight="true"
+            android:layout_below="@+id/prise_tv"
+            android:layout_marginTop="5dp"
+            android:layout_marginRight="10dp"/>
+    </RelativeLayout>
+    <View
+        android:id="@+id/hide_above_af"
+        android:layout_width="match_parent"
+        android:layout_height="10dp"
+        android:background="@color/black_gray"
+        android:layout_marginTop="1dp"
+        android:visibility="visible"/>
+  <com.core.widget.CustomerScrollView
+      android:layout_width="match_parent"
+      android:layout_height="match_parent"
+      android:fillViewport="true"
+      android:scrollbars="none"
+      android:visibility="visible">
+      <LinearLayout
+          android:layout_width="match_parent"
+          android:layout_height="wrap_content"
+          android:focusable="true"
+          android:focusableInTouchMode="true"
+          android:orientation="vertical">
+        <LinearLayout
+            android:id="@+id/attention_ll"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:orientation="vertical">
+            <com.handmark.pulltorefresh.library.PullToRefreshListView
+                android:id="@+id/attention_ptlv"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:layout_below="@id/seach_top"
+                android:background="@color/item_line"
+                android:dividerHeight="2px"
+                android:scrollbars="none" />
+            <View
+                android:layout_width="match_parent"
+                android:layout_height="10dp"
+                android:background="@color/black_gray"
+                android:layout_marginTop="1dp"
+                android:visibility="visible"/>
+        </LinearLayout>
+          <LinearLayout
+              android:id="@+id/all_ll"
+              android:layout_width="match_parent"
+              android:layout_height="wrap_content"
+              android:orientation="vertical">
+              <com.handmark.pulltorefresh.library.PullToRefreshListView
+                  android:id="@+id/all_ptlv"
+                  android:layout_width="match_parent"
+                  android:layout_height="match_parent"
+                  android:layout_below="@id/seach_top"
+                  android:background="@color/item_line"
+                  android:dividerHeight="2px"
+                  android:scrollbars="none" />
+              <View
+                  android:layout_width="match_parent"
+                  android:layout_height="10dp"
+                  android:background="@color/black_gray"
+                  android:layout_marginTop="1dp"
+                  android:visibility="visible"/>
+          </LinearLayout>
+      </LinearLayout>
+  </com.core.widget.CustomerScrollView>
+    <TextView
+        android:id="@+id/invite_friends_tv"
+        android:textColor="@color/green"
+        android:layout_width="match_parent"
+        android:layout_height="30dp"
+        android:text="邀请好友参加UU运行"
+        />
+</LinearLayout>

+ 0 - 4
app_modular/appworks/src/main/java/com/uas/appworks/OA/erp/adapter/WorkDailyAdapter.java

@@ -53,10 +53,6 @@ public class WorkDailyAdapter extends BaseAdapter {
         this.mContext = mContext;
     }
 
-//    public List<WorkDailyBean> getmWorkDailyBeanList() {
-//        return mWorkDailyBeanList;
-//    }
-
     public void setmWorkDailyBeanList(List<WorkDailyBean> mWorkDailyBeans) {
         this.mWorkDailyBeanList = mWorkDailyBeans;
     }