Commit 505390d5d6eff5a965d3590c0ef0ed67950cfe7d
1 parent
50a62a39
分享
Showing
34 changed files
with
579 additions
and
2 deletions
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/ui/activity/ShareRecordActivity.java
| @@ -2,15 +2,18 @@ package com.cnlive.moudle.pedometer.ui.activity; | @@ -2,15 +2,18 @@ package com.cnlive.moudle.pedometer.ui.activity; | ||
| 2 | 2 | ||
| 3 | import android.app.Activity; | 3 | import android.app.Activity; |
| 4 | import android.content.Intent; | 4 | import android.content.Intent; |
| 5 | +import android.graphics.Bitmap; | ||
| 5 | import android.support.v7.app.AppCompatActivity; | 6 | import android.support.v7.app.AppCompatActivity; |
| 6 | import android.os.Bundle; | 7 | import android.os.Bundle; |
| 7 | import android.widget.ImageView; | 8 | import android.widget.ImageView; |
| 9 | +import android.widget.RelativeLayout; | ||
| 8 | import android.widget.TextView; | 10 | import android.widget.TextView; |
| 9 | 11 | ||
| 10 | import com.cnlive.libs.base.util.StatusBarUtil; | 12 | import com.cnlive.libs.base.util.StatusBarUtil; |
| 11 | import com.cnlive.libs.base.util.StatusBarUtil2; | 13 | import com.cnlive.libs.base.util.StatusBarUtil2; |
| 14 | +import com.cnlive.moudle.pedometer.utils.share.ShareDialog; | ||
| 12 | import com.example.moudle_pedometer.R; | 15 | import com.example.moudle_pedometer.R; |
| 13 | -import com.qmuiteam.qmui.widget.QMUITopBar; | 16 | +import com.qmuiteam.qmui.util.QMUIDrawableHelper; |
| 14 | 17 | ||
| 15 | /** | 18 | /** |
| 16 | * | 19 | * |
| @@ -20,6 +23,7 @@ public class ShareRecordActivity extends AppCompatActivity { | @@ -20,6 +23,7 @@ public class ShareRecordActivity extends AppCompatActivity { | ||
| 20 | 23 | ||
| 21 | private ImageView share_back; | 24 | private ImageView share_back; |
| 22 | private TextView share; | 25 | private TextView share; |
| 26 | + private RelativeLayout ry_cen; | ||
| 23 | public static void newInstance(Activity context){ | 27 | public static void newInstance(Activity context){ |
| 24 | Intent intent = new Intent(context,ShareRecordActivity.class); | 28 | Intent intent = new Intent(context,ShareRecordActivity.class); |
| 25 | context.startActivity(intent); | 29 | context.startActivity(intent); |
| @@ -34,11 +38,15 @@ public class ShareRecordActivity extends AppCompatActivity { | @@ -34,11 +38,15 @@ public class ShareRecordActivity extends AppCompatActivity { | ||
| 34 | 38 | ||
| 35 | share_back = findViewById(R.id.share_back); | 39 | share_back = findViewById(R.id.share_back); |
| 36 | share = findViewById(R.id.share); | 40 | share = findViewById(R.id.share); |
| 41 | + ry_cen = findViewById(R.id.ry_cen); | ||
| 37 | share_back.setOnClickListener(v -> finish()); | 42 | share_back.setOnClickListener(v -> finish()); |
| 38 | share.setOnClickListener(v -> share()); | 43 | share.setOnClickListener(v -> share()); |
| 39 | } | 44 | } |
| 40 | 45 | ||
| 41 | private void share(){ | 46 | private void share(){ |
| 42 | - MyRecordActivity.newInstance(this); | 47 | + Bitmap qrbm = QMUIDrawableHelper.createBitmapFromView(ry_cen); |
| 48 | + ShareDialog dialog = new ShareDialog(this,qrbm); | ||
| 49 | + dialog.show(); | ||
| 43 | } | 50 | } |
| 51 | + | ||
| 44 | } | 52 | } |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/utils/share/IconInfo.java
0 → 100644
| 1 | +package com.cnlive.moudle.pedometer.utils.share; | ||
| 2 | + | ||
| 3 | +/** | ||
| 4 | + * Created by Lynn on 2018/8/23. | ||
| 5 | + */ | ||
| 6 | + | ||
| 7 | +public class IconInfo { | ||
| 8 | + public static final String WJJ_FRIEND = "wjj_friend";//网家家好友 | ||
| 9 | + public static final String WJJ_CIRCLE = "wjj_circle";//网家家生活圈 | ||
| 10 | + public static final String WECHAT_FRIEND = "weChat_friend";//微信好友 | ||
| 11 | + public static final String WECHAT_CIRCLE = "weChat_circle";//微信朋友圈 | ||
| 12 | + public static final String QQ = "qq";//qq | ||
| 13 | + public static final String WEBO = "webo";//微博 | ||
| 14 | + public static final String BROWSER = "browser";//浏览器打开 | ||
| 15 | + public static final String REPORT = "report"; //举报 | ||
| 16 | + public static final String DOWNLOAD_ALBUM = "download_album";//保存到相册 | ||
| 17 | + | ||
| 18 | + public static final String IMG_WECHAT_FRIEND = "img_weChat_friend";//微信好友分享图片 | ||
| 19 | + public static final String IMG_WECHAT_CIRCLE = "img_weChat_circle";//微信朋友圈 | ||
| 20 | + private String id; | ||
| 21 | + private String title; | ||
| 22 | + private int icon; | ||
| 23 | + | ||
| 24 | + public IconInfo(String id, String title, int icon) { | ||
| 25 | + this.id = id; | ||
| 26 | + this.title = title; | ||
| 27 | + this.icon = icon; | ||
| 28 | + } | ||
| 29 | + | ||
| 30 | + public String getId() { | ||
| 31 | + return id; | ||
| 32 | + } | ||
| 33 | + | ||
| 34 | + public void setId(String id) { | ||
| 35 | + this.id = id; | ||
| 36 | + } | ||
| 37 | + | ||
| 38 | + public String getTitle() { | ||
| 39 | + return title; | ||
| 40 | + } | ||
| 41 | + | ||
| 42 | + public void setTitle(String title) { | ||
| 43 | + this.title = title; | ||
| 44 | + } | ||
| 45 | + | ||
| 46 | + public int getIcon() { | ||
| 47 | + return icon; | ||
| 48 | + } | ||
| 49 | + | ||
| 50 | + public void setIcon(int icon) { | ||
| 51 | + this.icon = icon; | ||
| 52 | + } | ||
| 53 | +} |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/utils/share/ShareDialog.java
0 → 100644
| 1 | +package com.cnlive.moudle.pedometer.utils.share; | ||
| 2 | + | ||
| 3 | +import android.app.Activity; | ||
| 4 | +import android.app.Dialog; | ||
| 5 | +import android.graphics.Bitmap; | ||
| 6 | +import android.os.Bundle; | ||
| 7 | +import android.support.annotation.NonNull; | ||
| 8 | +import android.support.v7.widget.LinearLayoutManager; | ||
| 9 | +import android.support.v7.widget.RecyclerView; | ||
| 10 | +import android.text.TextUtils; | ||
| 11 | +import android.util.DisplayMetrics; | ||
| 12 | +import android.view.View; | ||
| 13 | +import android.view.ViewGroup; | ||
| 14 | +import android.view.Window; | ||
| 15 | +import android.view.WindowManager; | ||
| 16 | +import android.widget.LinearLayout; | ||
| 17 | +import android.widget.RadioButton; | ||
| 18 | +import android.widget.RadioGroup; | ||
| 19 | + | ||
| 20 | +import com.cnlive.libs.base.application.AppConfig; | ||
| 21 | +import com.cnlive.libs.base.util.AlertUtil; | ||
| 22 | +import com.cnlive.libs.base.util.ShareReleaseInfoUtil; | ||
| 23 | +import com.example.moudle_pedometer.R; | ||
| 24 | + | ||
| 25 | + | ||
| 26 | +import java.util.ArrayList; | ||
| 27 | +import java.util.List; | ||
| 28 | + | ||
| 29 | +/** | ||
| 30 | + * 创建:wukuiqing | ||
| 31 | + * <p> | ||
| 32 | + * 时间:2017/10/11A | ||
| 33 | + * <p> | ||
| 34 | + * 描述:分享的dialog | ||
| 35 | + */ | ||
| 36 | + | ||
| 37 | +public class ShareDialog extends Dialog implements View.OnClickListener, ShareDialogListAdapter.ItemClick { | ||
| 38 | + | ||
| 39 | + private Activity mContext; | ||
| 40 | + private LinearLayout ll_cancle; | ||
| 41 | + private ShareInfo info; | ||
| 42 | + private RecyclerView shareRv; | ||
| 43 | + private RecyclerView shareOther; | ||
| 44 | + | ||
| 45 | + private ShareDialogListAdapter adapter; | ||
| 46 | + private boolean showOther; | ||
| 47 | + private boolean showWjj; | ||
| 48 | + private Bitmap bitmap; | ||
| 49 | + | ||
| 50 | + private ShareReleaseInfoUtil.ShareConfig config; | ||
| 51 | + | ||
| 52 | + public static final String SHARE_TITLE = "快来加入中国网家家,优享美好生活!"; | ||
| 53 | + public static final String SHARE_CONTENT = "中国网家家 让生活更美好!"; | ||
| 54 | + private List<IconInfo> list = new ArrayList<>(); | ||
| 55 | + | ||
| 56 | + | ||
| 57 | + public ShareDialog(@NonNull Activity context, Bitmap bitmap) { | ||
| 58 | + this(context, true, true,bitmap); | ||
| 59 | + } | ||
| 60 | + | ||
| 61 | + public ShareDialog(@NonNull Activity context, boolean showOther, boolean showWjj,Bitmap bitmap) { | ||
| 62 | + super(context, R.style.ShareDialogStyle); | ||
| 63 | + mContext = context; | ||
| 64 | + info = new ShareInfo(); | ||
| 65 | + info.setUrl(AppConfig.getShareDownload()); | ||
| 66 | + info.setTitle(SHARE_TITLE); | ||
| 67 | + info.setContent(SHARE_CONTENT); | ||
| 68 | + info.setImgurl(AppConfig.getShareIcon()); | ||
| 69 | + | ||
| 70 | + this.showOther = showOther; | ||
| 71 | + this.showWjj = showWjj; | ||
| 72 | + this.bitmap = bitmap; | ||
| 73 | + | ||
| 74 | + config = ShareReleaseInfoUtil.ShareConfig.newInstance(); | ||
| 75 | + } | ||
| 76 | + | ||
| 77 | + | ||
| 78 | + @Override | ||
| 79 | + protected void onCreate(Bundle savedInstanceState) { | ||
| 80 | + super.onCreate(savedInstanceState); | ||
| 81 | + setContentView(R.layout.layout_share_dialog); | ||
| 82 | + Window window = getWindow(); | ||
| 83 | + window.setWindowAnimations(R.style.Animation_Bottom_Rising); | ||
| 84 | + | ||
| 85 | + shareRv = findViewById(R.id.share_rv); | ||
| 86 | + shareOther = findViewById(R.id.share_other); | ||
| 87 | + | ||
| 88 | + ll_cancle = findViewById(R.id.ll_cancle); | ||
| 89 | + ll_cancle.setOnClickListener(this); | ||
| 90 | + setViewLocation(); | ||
| 91 | + setCanceledOnTouchOutside(true);//外部点击取消 | ||
| 92 | + init(); | ||
| 93 | + | ||
| 94 | + } | ||
| 95 | + | ||
| 96 | + private List<IconInfo> initList() { | ||
| 97 | + List<IconInfo> lists = new ArrayList<>(); | ||
| 98 | + lists.add(new IconInfo(IconInfo.IMG_WECHAT_FRIEND, "微信", R.drawable.wechat)); | ||
| 99 | + lists.add(new IconInfo(IconInfo.IMG_WECHAT_CIRCLE, "朋友圈", R.drawable.pengyouquan)); | ||
| 100 | + lists.add(new IconInfo(IconInfo.DOWNLOAD_ALBUM, "保存到相册", R.drawable.download_album)); | ||
| 101 | + return lists; | ||
| 102 | + } | ||
| 103 | + | ||
| 104 | + private List<IconInfo> initListOther() { | ||
| 105 | + List<IconInfo> list = new ArrayList<>(); | ||
| 106 | + list.add(new IconInfo(IconInfo.WJJ_FRIEND, "网家家好友", R.drawable.wjjhaoyou)); | ||
| 107 | + list.add(new IconInfo(IconInfo.WJJ_CIRCLE, "生活圈", R.drawable.shenghuoquan)); | ||
| 108 | + list.add(new IconInfo(IconInfo.WECHAT_FRIEND, "微信好友", R.drawable.wechat)); | ||
| 109 | + list.add(new IconInfo(IconInfo.WECHAT_CIRCLE, "微信朋友圈", R.drawable.pengyouquan)); | ||
| 110 | + list.add(new IconInfo(IconInfo.QQ, "QQ好友", R.drawable.qq)); | ||
| 111 | + return list; | ||
| 112 | + } | ||
| 113 | + | ||
| 114 | + private void init() { | ||
| 115 | + ((RadioButton) findViewById(R.id.rb_img)).setChecked(true); | ||
| 116 | + list.addAll(initList()); | ||
| 117 | + adapter = new ShareDialogListAdapter(mContext, list); | ||
| 118 | + adapter.setItemClick(this); | ||
| 119 | + LinearLayoutManager layoutManager1 = new LinearLayoutManager(mContext, LinearLayoutManager.HORIZONTAL, false); | ||
| 120 | + | ||
| 121 | + shareRv.setLayoutManager(layoutManager1); | ||
| 122 | + shareRv.setAdapter(adapter); | ||
| 123 | + | ||
| 124 | +// ((RadioGroup) findViewById(R.id.rd_group)).setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() { | ||
| 125 | +// @Override | ||
| 126 | +// public void onCheckedChanged(RadioGroup group, int checkedId) { | ||
| 127 | +// if (checkedId == R.id.rb_img) { | ||
| 128 | +// list.clear(); | ||
| 129 | +// list.addAll(initList()); | ||
| 130 | +// adapter.notifyDataSetChanged(); | ||
| 131 | +// } else { | ||
| 132 | +// list.clear(); | ||
| 133 | +// list.addAll(initListOther()); | ||
| 134 | +// adapter.notifyDataSetChanged(); | ||
| 135 | +// } | ||
| 136 | +// } | ||
| 137 | +// }); | ||
| 138 | + } | ||
| 139 | + | ||
| 140 | + | ||
| 141 | + @Override | ||
| 142 | + public void onClick(View v) { | ||
| 143 | + int i = v.getId(); | ||
| 144 | + if (i == R.id.ll_cancle) { | ||
| 145 | + cancel(); | ||
| 146 | + } | ||
| 147 | + } | ||
| 148 | + | ||
| 149 | + /** | ||
| 150 | + * 设置dialog位于屏幕底部 | ||
| 151 | + */ | ||
| 152 | + private void setViewLocation() { | ||
| 153 | + DisplayMetrics dm = new DisplayMetrics(); | ||
| 154 | + mContext.getWindowManager().getDefaultDisplay().getMetrics(dm); | ||
| 155 | + int height = dm.heightPixels; | ||
| 156 | + Window window = this.getWindow(); | ||
| 157 | + WindowManager.LayoutParams lp = window.getAttributes(); | ||
| 158 | + lp.x = 0; | ||
| 159 | + lp.y = height; | ||
| 160 | + lp.width = ViewGroup.LayoutParams.MATCH_PARENT; | ||
| 161 | + lp.height = ViewGroup.LayoutParams.WRAP_CONTENT; | ||
| 162 | + // 设置显示位置 | ||
| 163 | + onWindowAttributesChanged(lp); | ||
| 164 | + } | ||
| 165 | + | ||
| 166 | + @Override | ||
| 167 | + public void onItemClick(int position, String type) { | ||
| 168 | + switch (type) { | ||
| 169 | + case IconInfo.IMG_WECHAT_FRIEND: | ||
| 170 | + | ||
| 171 | + dismiss(); | ||
| 172 | + break; | ||
| 173 | + case IconInfo.IMG_WECHAT_CIRCLE: | ||
| 174 | + | ||
| 175 | + dismiss(); | ||
| 176 | + break; | ||
| 177 | + case IconInfo.DOWNLOAD_ALBUM: | ||
| 178 | + | ||
| 179 | + dismiss(); | ||
| 180 | + } | ||
| 181 | + } | ||
| 182 | +} | ||
| 0 | \ No newline at end of file | 183 | \ No newline at end of file |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/utils/share/ShareDialogListAdapter.java
0 → 100644
| 1 | +package com.cnlive.moudle.pedometer.utils.share; | ||
| 2 | + | ||
| 3 | +import android.content.Context; | ||
| 4 | +import android.support.annotation.NonNull; | ||
| 5 | +import android.support.v7.widget.RecyclerView; | ||
| 6 | +import android.view.LayoutInflater; | ||
| 7 | +import android.view.View; | ||
| 8 | +import android.view.ViewGroup; | ||
| 9 | +import android.widget.ImageView; | ||
| 10 | +import android.widget.TextView; | ||
| 11 | + | ||
| 12 | +import com.example.moudle_pedometer.R; | ||
| 13 | + | ||
| 14 | +import java.util.List; | ||
| 15 | + | ||
| 16 | +/** | ||
| 17 | + * Created by Lynn on 2018/8/23. | ||
| 18 | + */ | ||
| 19 | + | ||
| 20 | +public class ShareDialogListAdapter extends RecyclerView.Adapter<ShareDialogListAdapter.ShareDialogViewHolder> { | ||
| 21 | + private Context context; | ||
| 22 | + private List<IconInfo> data; | ||
| 23 | + private ItemClick itemClick; | ||
| 24 | + | ||
| 25 | + public ShareDialogListAdapter(Context context, List<IconInfo> data) { | ||
| 26 | + this.data = data; | ||
| 27 | + this.context = context; | ||
| 28 | + } | ||
| 29 | + | ||
| 30 | + public void setItemClick(ItemClick itemClick) { | ||
| 31 | + this.itemClick = itemClick; | ||
| 32 | + } | ||
| 33 | + | ||
| 34 | + @NonNull | ||
| 35 | + @Override | ||
| 36 | + public ShareDialogListAdapter.ShareDialogViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { | ||
| 37 | + View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.share_dialog_item, parent, false); | ||
| 38 | + ShareDialogViewHolder holder = new ShareDialogViewHolder(view); | ||
| 39 | + return holder; | ||
| 40 | + } | ||
| 41 | + | ||
| 42 | + @Override | ||
| 43 | + public void onBindViewHolder(@NonNull ShareDialogListAdapter.ShareDialogViewHolder holder, final int position) { | ||
| 44 | + holder.name.setText(data.get(position).getTitle()); | ||
| 45 | + holder.icon.setImageResource(data.get(position).getIcon()); | ||
| 46 | + holder.itemView.setOnClickListener(new View.OnClickListener() { | ||
| 47 | + @Override | ||
| 48 | + public void onClick(View v) { | ||
| 49 | + if (itemClick != null){ | ||
| 50 | + itemClick.onItemClick(position, data.get(position).getId()); | ||
| 51 | + } | ||
| 52 | + | ||
| 53 | + | ||
| 54 | + } | ||
| 55 | + }); | ||
| 56 | + } | ||
| 57 | + | ||
| 58 | + @Override | ||
| 59 | + public int getItemCount() { | ||
| 60 | + return data.size(); | ||
| 61 | + } | ||
| 62 | + | ||
| 63 | + class ShareDialogViewHolder extends RecyclerView.ViewHolder { | ||
| 64 | + public TextView name; | ||
| 65 | + public ImageView icon; | ||
| 66 | + public ShareDialogViewHolder(View itemView) { | ||
| 67 | + super(itemView); | ||
| 68 | + name = itemView.findViewById(R.id.name); | ||
| 69 | + icon = itemView.findViewById(R.id.icon); | ||
| 70 | + } | ||
| 71 | + } | ||
| 72 | + | ||
| 73 | + public interface ItemClick { | ||
| 74 | + void onItemClick(int position, String type); | ||
| 75 | + } | ||
| 76 | +} |
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/utils/share/ShareInfo.java
0 → 100644
| 1 | +package com.cnlive.moudle.pedometer.utils.share; | ||
| 2 | + | ||
| 3 | +/** | ||
| 4 | + * 创建:wukuiqing | ||
| 5 | + * <p> | ||
| 6 | + * 时间:2017/11/13 | ||
| 7 | + * <p> | ||
| 8 | + * 描述:分享的 数据类型 | ||
| 9 | + */ | ||
| 10 | + | ||
| 11 | +public class ShareInfo { | ||
| 12 | + //分享的标题 | ||
| 13 | + private String title; | ||
| 14 | + //分享的简介 | ||
| 15 | + private String content; | ||
| 16 | + //分享的图片 | ||
| 17 | + private String imgurl; | ||
| 18 | + private String siteUrl; | ||
| 19 | + //分享的Url | ||
| 20 | + private String url; | ||
| 21 | + //分享的类型 (默认: share_article 积分用) | ||
| 22 | + private String shareType; | ||
| 23 | + //分享的内容id | ||
| 24 | + private String contentId; | ||
| 25 | + //兼容低版本的网页链接 | ||
| 26 | + private String webpageUrl; | ||
| 27 | + //小程序原始id 示例(gh_d43f693ca31f); | ||
| 28 | + private String userName; | ||
| 29 | + //小程序页面路径 示例 ("/pages/media") | ||
| 30 | + private String path; | ||
| 31 | + //(int类型) 正式版:0,测试版:1,体验版:2 | ||
| 32 | + private int miniprogramType; | ||
| 33 | + // 1:目击者 2:生活圈 3:H5 4:点播 5:直播 | ||
| 34 | + public String getReportType() { | ||
| 35 | + return reportType; | ||
| 36 | + } | ||
| 37 | + | ||
| 38 | + public void setReportType(String reportType) { | ||
| 39 | + this.reportType = reportType; | ||
| 40 | + } | ||
| 41 | + | ||
| 42 | + //举报类型 | ||
| 43 | + private String reportType; | ||
| 44 | + | ||
| 45 | + public boolean isReport; | ||
| 46 | + | ||
| 47 | + public String getWebpageUrl() { | ||
| 48 | + return webpageUrl; | ||
| 49 | + } | ||
| 50 | + | ||
| 51 | + public void setWebpageUrl(String webpageUrl) { | ||
| 52 | + this.webpageUrl = webpageUrl; | ||
| 53 | + } | ||
| 54 | + | ||
| 55 | + public String getUserName() { | ||
| 56 | + return userName; | ||
| 57 | + } | ||
| 58 | + | ||
| 59 | + public void setUserName(String userName) { | ||
| 60 | + this.userName = userName; | ||
| 61 | + } | ||
| 62 | + | ||
| 63 | + public String getPath() { | ||
| 64 | + return path; | ||
| 65 | + } | ||
| 66 | + | ||
| 67 | + public void setPath(String path) { | ||
| 68 | + this.path = path; | ||
| 69 | + } | ||
| 70 | + | ||
| 71 | + public int getMiniprogramType() { | ||
| 72 | + return miniprogramType; | ||
| 73 | + } | ||
| 74 | + | ||
| 75 | + public void setMiniprogramType(int miniprogramType) { | ||
| 76 | + this.miniprogramType = miniprogramType; | ||
| 77 | + } | ||
| 78 | + | ||
| 79 | + | ||
| 80 | + public String getShareType() { | ||
| 81 | + return shareType; | ||
| 82 | + } | ||
| 83 | + | ||
| 84 | + public void setShareType(String shareType) { | ||
| 85 | + if (shareType == null) { | ||
| 86 | + shareType = "share_article"; | ||
| 87 | + } | ||
| 88 | + this.shareType = shareType; | ||
| 89 | + } | ||
| 90 | + | ||
| 91 | + public String getContentId() { | ||
| 92 | + return contentId; | ||
| 93 | + } | ||
| 94 | + | ||
| 95 | + public void setContentId(String contentId) { | ||
| 96 | + if (contentId == null) { | ||
| 97 | + contentId = ""; | ||
| 98 | + } | ||
| 99 | + this.contentId = contentId; | ||
| 100 | + } | ||
| 101 | + | ||
| 102 | + public String getTitle() { | ||
| 103 | + return title; | ||
| 104 | + } | ||
| 105 | + | ||
| 106 | + public void setTitle(String title) { | ||
| 107 | + if (title != null && title.length() >= 200) | ||
| 108 | + title = title.substring(0, 200); | ||
| 109 | + | ||
| 110 | + this.title = title; | ||
| 111 | + } | ||
| 112 | + | ||
| 113 | + public String getContent() { | ||
| 114 | + return content; | ||
| 115 | + } | ||
| 116 | + | ||
| 117 | + public void setContent(String content) { | ||
| 118 | + if (content != null && content.length() >= 200) | ||
| 119 | + content = content.substring(0, 200); | ||
| 120 | + | ||
| 121 | + this.content = content; | ||
| 122 | + } | ||
| 123 | + | ||
| 124 | + public String getImgurl() { | ||
| 125 | + return imgurl; | ||
| 126 | + } | ||
| 127 | + | ||
| 128 | + public void setImgurl(String imgurl) { | ||
| 129 | + this.imgurl = imgurl; | ||
| 130 | + } | ||
| 131 | + | ||
| 132 | + public String getSiteUrl() { | ||
| 133 | + return siteUrl; | ||
| 134 | + } | ||
| 135 | + | ||
| 136 | + public void setSiteUrl(String siteUrl) { | ||
| 137 | + this.siteUrl = siteUrl; | ||
| 138 | + } | ||
| 139 | + | ||
| 140 | + public String getUrl() { | ||
| 141 | + return url; | ||
| 142 | + } | ||
| 143 | + | ||
| 144 | + public void setUrl(String url) { | ||
| 145 | + this.url = url; | ||
| 146 | + } | ||
| 147 | +} |
moudle_pedometer/src/main/res/drawable-hdpi/download_album.png
0 → 100644
2.76 KB
moudle_pedometer/src/main/res/drawable-hdpi/no_selected.png
0 → 100644
931 Bytes
moudle_pedometer/src/main/res/drawable-hdpi/pengyouquan.png
0 → 100644
4.54 KB
moudle_pedometer/src/main/res/drawable-hdpi/qq.png
0 → 100644
3.8 KB
moudle_pedometer/src/main/res/drawable-hdpi/selected.png
0 → 100644
1.38 KB
moudle_pedometer/src/main/res/drawable-hdpi/shenghuoquan.png
0 → 100644
5.27 KB
moudle_pedometer/src/main/res/drawable-hdpi/wechat.png
0 → 100644
4.48 KB
moudle_pedometer/src/main/res/drawable-hdpi/wjjhaoyou.png
0 → 100644
4.27 KB
moudle_pedometer/src/main/res/drawable-xhdpi/download_album.png
0 → 100644
3.09 KB
moudle_pedometer/src/main/res/drawable-xhdpi/no_selected.png
0 → 100644
831 Bytes
moudle_pedometer/src/main/res/drawable-xhdpi/pengyouquan.png
0 → 100644
4.35 KB
moudle_pedometer/src/main/res/drawable-xhdpi/qq.png
0 → 100644
3.5 KB
moudle_pedometer/src/main/res/drawable-xhdpi/selected.png
0 → 100644
1.38 KB
moudle_pedometer/src/main/res/drawable-xhdpi/shenghuoquan.png
0 → 100644
5.87 KB
moudle_pedometer/src/main/res/drawable-xhdpi/wechat.png
0 → 100644
4.2 KB
moudle_pedometer/src/main/res/drawable-xhdpi/wjjhaoyou.png
0 → 100644
3.99 KB
moudle_pedometer/src/main/res/drawable-xxhdpi/download_album.png
0 → 100644
5.87 KB
moudle_pedometer/src/main/res/drawable-xxhdpi/no_selected.png
0 → 100644
1.92 KB
moudle_pedometer/src/main/res/drawable-xxhdpi/pengyouquan.png
0 → 100644
12 KB
moudle_pedometer/src/main/res/drawable-xxhdpi/qq.png
0 → 100644
9.69 KB
moudle_pedometer/src/main/res/drawable-xxhdpi/selected.png
0 → 100644
3.01 KB
moudle_pedometer/src/main/res/drawable-xxhdpi/shenghuoquan.png
0 → 100644
14.6 KB
moudle_pedometer/src/main/res/drawable-xxhdpi/wechat.png
0 → 100644
11.2 KB
moudle_pedometer/src/main/res/drawable-xxhdpi/wjjhaoyou.png
0 → 100644
11.4 KB
moudle_pedometer/src/main/res/drawable/ce_circle_bg.xml
0 → 100644
moudle_pedometer/src/main/res/drawable/rb_text_drawable_selector.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | +<selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||
| 3 | + <item android:state_checked="false" android:color="#333333"/> | ||
| 4 | + <item android:state_checked="true" android:color="#00D100"/> | ||
| 5 | +</selector> | ||
| 0 | \ No newline at end of file | 6 | \ No newline at end of file |
moudle_pedometer/src/main/res/drawable/rb_text_drawable_selector_bg.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | +<selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||
| 3 | + <item android:state_checked="false" android:drawable="@drawable/no_selected"/> | ||
| 4 | + <item android:state_checked="true" android:drawable="@drawable/selected"/> | ||
| 5 | +</selector> | ||
| 0 | \ No newline at end of file | 6 | \ No newline at end of file |
moudle_pedometer/src/main/res/layout/layout_share_dialog.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 3 | + xmlns:zhy="http://schemas.android.com/apk/res-auto" | ||
| 4 | + android:layout_width="match_parent" | ||
| 5 | + android:layout_height="match_parent" | ||
| 6 | + android:background="@color/white" | ||
| 7 | + android:orientation="vertical"> | ||
| 8 | + | ||
| 9 | + <RadioGroup | ||
| 10 | + android:id="@+id/rd_group" | ||
| 11 | + android:layout_width="match_parent" | ||
| 12 | + android:layout_height="wrap_content" | ||
| 13 | + android:layout_marginTop="20dp" | ||
| 14 | + android:orientation="horizontal" | ||
| 15 | + android:visibility="gone" | ||
| 16 | + android:weightSum="2"> | ||
| 17 | + | ||
| 18 | + <RadioButton | ||
| 19 | + android:id="@+id/rb_img" | ||
| 20 | + android:layout_width="wrap_content" | ||
| 21 | + android:layout_height="wrap_content" | ||
| 22 | + android:layout_weight="1" | ||
| 23 | + android:padding="10dp" | ||
| 24 | + android:text="分享图片" | ||
| 25 | + android:layout_marginLeft="50dp" | ||
| 26 | + style="@style/button_tag_style"/> | ||
| 27 | + | ||
| 28 | + <RadioButton | ||
| 29 | + android:id="@+id/rb_address" | ||
| 30 | + android:layout_width="wrap_content" | ||
| 31 | + android:layout_height="wrap_content" | ||
| 32 | + android:layout_weight="1" | ||
| 33 | + android:padding="10dp" | ||
| 34 | + style="@style/button_tag_style" | ||
| 35 | + android:text="分享链接"/> | ||
| 36 | + | ||
| 37 | + </RadioGroup> | ||
| 38 | + | ||
| 39 | + <android.support.v7.widget.RecyclerView | ||
| 40 | + android:id="@+id/share_rv" | ||
| 41 | + android:layout_width="match_parent" | ||
| 42 | + android:layout_height="wrap_content" | ||
| 43 | + android:layout_marginTop="10dp"/> | ||
| 44 | + | ||
| 45 | + <View | ||
| 46 | + android:layout_width="match_parent" | ||
| 47 | + android:layout_height="0.5dp" | ||
| 48 | + android:background="#EAEAEA" /> | ||
| 49 | + | ||
| 50 | + <android.support.v7.widget.RecyclerView | ||
| 51 | + android:id="@+id/share_other" | ||
| 52 | + android:layout_width="match_parent" | ||
| 53 | + android:layout_height="wrap_content" | ||
| 54 | + android:visibility="gone" /> | ||
| 55 | + | ||
| 56 | + <View | ||
| 57 | + android:id="@+id/line" | ||
| 58 | + android:layout_width="match_parent" | ||
| 59 | + android:layout_height="0.5dp" | ||
| 60 | + android:background="#EAEAEA" | ||
| 61 | + android:visibility="gone" /> | ||
| 62 | + | ||
| 63 | + <LinearLayout | ||
| 64 | + android:id="@+id/ll_cancle" | ||
| 65 | + android:layout_width="match_parent" | ||
| 66 | + android:layout_height="wrap_content" | ||
| 67 | + android:layout_gravity="center_horizontal" | ||
| 68 | + android:gravity="center" | ||
| 69 | + android:padding="16dp"> | ||
| 70 | + | ||
| 71 | + <TextView | ||
| 72 | + android:layout_width="wrap_content" | ||
| 73 | + android:layout_height="wrap_content" | ||
| 74 | + android:text="取消" | ||
| 75 | + android:textColor="#ff2c2c2d" | ||
| 76 | + android:textSize="16sp" /> | ||
| 77 | + | ||
| 78 | + </LinearLayout> | ||
| 79 | + | ||
| 80 | +</LinearLayout> | ||
| 0 | \ No newline at end of file | 81 | \ No newline at end of file |
moudle_pedometer/src/main/res/values/styles.xml
| @@ -24,4 +24,20 @@ | @@ -24,4 +24,20 @@ | ||
| 24 | <item name="android:background">@android:color/transparent</item> | 24 | <item name="android:background">@android:color/transparent</item> |
| 25 | </style> | 25 | </style> |
| 26 | 26 | ||
| 27 | + <style name="ShareDialogStyle" > | ||
| 28 | + <item name="android:windowFrame">@null</item><!--边框--> | ||
| 29 | + <item name="android:windowIsFloating">true</item><!--是否浮现在activity之上--> | ||
| 30 | + <item name="android:windowIsTranslucent">false</item><!--半透明--> | ||
| 31 | + <item name="android:windowNoTitle">true</item><!--无标题--> | ||
| 32 | + <item name="android:windowBackground">@color/transparent</item><!--背景透明--> | ||
| 33 | + <item name="android:backgroundDimEnabled">true</item><!--模糊--> | ||
| 34 | + <item name="android:backgroundDimAmount">0.6</item> | ||
| 35 | + </style> | ||
| 36 | + | ||
| 37 | + <style name="button_tag_style"> | ||
| 38 | + <item name="android:textSize">13sp</item> | ||
| 39 | + <item name="android:button">@drawable/rb_text_drawable_selector_bg</item> | ||
| 40 | + <item name="android:drawablePadding">5dp</item> | ||
| 41 | + <item name="android:textColor">@drawable/rb_text_drawable_selector</item> | ||
| 42 | + </style> | ||
| 27 | </resources> | 43 | </resources> |