Skip to content

Commit

Permalink
1.修复若干导致崩溃得到BUG;
Browse files Browse the repository at this point in the history
2.优化分享功能;
3.更改主题色彩;
  • Loading branch information
sues-lee committed Mar 11, 2015
1 parent 4cd231e commit e92cabb
Showing 13 changed files with 40 additions and 20 deletions.
4 changes: 2 additions & 2 deletions SUESNews/app/build.gradle
Original file line number Diff line number Diff line change
@@ -12,8 +12,8 @@ android {
applicationId "com.example.lee.suesnews"
minSdkVersion 16
targetSdkVersion 21
versionCode 1
versionName "beta-1.0"
versionCode 2
versionName "beta-1.0.1"
}
buildTypes {
release {
5 changes: 4 additions & 1 deletion SUESNews/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -96,7 +96,10 @@
</activity>
<!--友盟APPKEY-->
<meta-data android:value="54fda2b3fd98c57a8f0008f6" android:name="UMENG_APPKEY"></meta-data>

<meta-data
android:name="UMENG_CHANNEL"
android:value="fir" >
</meta-data>
</application>

</manifest>
2 changes: 1 addition & 1 deletion SUESNews/app/src/main/assets/ShareSDK.xml
Original file line number Diff line number Diff line change
@@ -108,7 +108,7 @@
AppId="wx4868b35061f87885"
AppSecret="64020361b8ec4c99936c0e3999a9f249"
BypassApproval="true"
Enable="true" />
Enable="false" />

<WechatFavorite
Id="6"
Original file line number Diff line number Diff line change
@@ -186,23 +186,22 @@ protected void showShare(Context context,String text) {
ShareSDK.initSDK(this);

String appHomePage = getString(R.string.app_home_page);
String shareText = text != "" ? text : appHomePage;
String shareText = text != "" ? text : "\n分享自腾飞新闻:"+appHomePage;

OnekeyShare oks = new OnekeyShare();
//关闭sso授权
oks.disableSSOWhenAuthorize();

// 分享时Notification的图标和文字
oks.setNotification(R.drawable.ibooks, getString(R.string.app_name));
oks.setNotification(R.drawable.ic_suesnews, getString(R.string.app_name));
// title标题,印象笔记、邮箱、信息、微信、人人网和QQ空间使用
oks.setTitle(getString(R.string.share));
// titleUrl是标题的网络链接,仅在人人网和QQ空间使用
oks.setTitleUrl(appHomePage);
// text是分享文本,所有平台都需要这个字段
oks.setText(shareText);
// imagePath是图片的本地路径,Linked-In以外的平台都支持此参数
//oks.setImagePath(Environment.getExternalStorageDirectory().getPath()
// + "/test.jpg");//确保SDcard下面存在此张图片
oks.setImagePath(getPackageResourcePath()+"/drawable/ic_suesnews.png");//确保SDcard下面存在此张图片
// url仅在微信(包括好友和朋友圈)中使用
oks.setUrl(appHomePage);
// comment是我对这条分享的评论,仅在人人网和QQ空间使用
Original file line number Diff line number Diff line change
@@ -162,7 +162,7 @@ public void onDrawerStateChanged(int i) {
mContent = (ViewGroup) findViewById(R.id.content);
mDrawer = (ViewGroup) findViewById(R.id.drawer);
mMainPage = (ViewGroup) findViewById(R.id.main_page);
//因为顶栏透明,要让出顶栏和底栏空间
//因为导航栏透明,要让出顶部和底部空间
if (CURRENT_VERSION >= VERSION_KITKAT) {
mMainPage.setPadding(0, getStatusBarHeight(), 0, getNavigationBarHeight());
mDrawer.setPadding(0, 0, 0, getNavigationBarHeight());
Original file line number Diff line number Diff line change
@@ -28,6 +28,13 @@ public class MyRecyclerAdapter extends RecyclerView.Adapter<MyRecyclerAdapter.Vi

//当前显示的数据
private List<NewsItem> mNewsList = new ArrayList<NewsItem>();

public void setmDrawble(Drawable mDrawble) {
if (this.mDrawble == null) {
this.mDrawble = mDrawble;
}
}

private Drawable mDrawble;
// private Context mContext;

@@ -45,7 +52,7 @@ public MyRecyclerAdapter(Context context, List<NewsItem> myDataset){
mNewsList = myDataset != null ? myDataset : new ArrayList<NewsItem>();
Random random = new Random();
int i = random.nextInt(4);
mDrawble = context.getResources().getDrawable(getImageId(i));
setmDrawble(context.getResources().getDrawable(getImageId(i)));
}

/**
Original file line number Diff line number Diff line change
@@ -188,7 +188,13 @@ public boolean onOptionsItemSelected(MenuItem item) {

//noinspection SimplifiableIfStatement
if (id == R.id.action_share) {
showShare(this,mNewsContent.getTitle() + " 分享自SUESNews");
String title = null;
String url = null;
if(mNewsContent != null){
title = mNewsContent.getTitle();
url = mNewsContent.getUrl();
}
showShare(this, title +" 详见:" + url +" \n分享自腾飞新闻: http://fir.im/sues");
return true;
}

2 changes: 1 addition & 1 deletion SUESNews/app/src/main/res/anim/image_welcome.xml
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
android:toXScale="1.3"
android:fromYScale="1.0"
android:toYScale="1.3"
android:duration="4000"
android:duration="3000"
android:pivotY="50%"
android:pivotX="50%"
/>
Binary file modified SUESNews/app/src/main/res/drawable/materialdesign_pic_2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified SUESNews/app/src/main/res/drawable/pic_background_4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions SUESNews/app/src/main/res/layout/activity_news_content.xml
Original file line number Diff line number Diff line change
@@ -74,6 +74,8 @@
android:gravity="center_vertical"
android:singleLine="true"
android:ellipsize="marquee"
android:focusable="true"
android:focusableInTouchMode="true"
tools:text="TEST"
/>
<TextView
14 changes: 10 additions & 4 deletions SUESNews/app/src/main/res/values/color.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="dark_primary_color">#0097A7</color>
<color name="primary_color">#00BCD4</color>
<color name="light_primary_color">#B2EbF2</color>
<color name="accent_color">#FF9800</color>
<!--<color name="dark_primary_color">#0097A7</color>-->
<!--<color name="primary_color">#00BCD4</color>-->
<!--<color name="light_primary_color">#B2EbF2</color>-->
<!--<color name="accent_color">#FF9800</color>-->

<color name="dark_primary_color">#00796B</color>
<color name="primary_color">#009688</color>
<color name="light_primary_color">#B2DFDB</color>
<color name="accent_color">#FFC107</color>

<color name="primary_text">#212121</color>
<color name="secondary_text">#727272</color>
<color name="divider_color">#B6B6B6</color>
5 changes: 1 addition & 4 deletions SUESNews/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -7,18 +7,15 @@
<string name="action_share">分享</string>
<string name="about">关于</string>
<string name="main_activity_title">首页</string>
<string name="hello_blank_fragment">Hello blank fragment</string>
<string name="title_activity_news_content"> </string>
<string name="click_to_exit">再按一次退出程序</string>
<string name="delete_success">缓存清理成功</string>
<string name="app_home_page">http://fir.im/sues</string>
<string name="setting_key_clear_cache">clear_cache</string>
<string name="setting_key_post_back">post_back</string>
<string name="setting_key_check_update">check_update</string>
<string name="title_activity_about">AboutActivity</string>
<string name="title_activity_welcome">WelcomeActivity</string>
<string name="welcome_string">您好,请问有什么需要吐槽的吗</string>
<string name="share_app_string">发现一个有趣的APP,快来下载吧!</string>
<string name="share_app_string">发现一个有趣的APP,你也来下载试试吧! http://fir.im/sues</string>
<string name="net_unavaiable">刷新失败,请检查网络后重试</string>

</resources>

0 comments on commit e92cabb

Please sign in to comment.