Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
wangdan committed Oct 30, 2014
1 parent 6379722 commit af10af8
Show file tree
Hide file tree
Showing 53 changed files with 196 additions and 65 deletions.
Binary file modified AisenWeiBo/.DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion AisenWeiBo/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<!--加载被测主程序包名 -->
<instrumentation android:targetPackage="org.aisen.weibo.sina" android:name="android.test.InstrumentationTestRunner" />

<application android:allowBackup="true" android:icon="@drawable/a_icon" android:label="@string/app_name" android:theme="@style/BaseTheme"
<application android:allowBackup="true" android:icon="@drawable/a_icon_b" android:label="@string/app_name" android:theme="@style/BaseTheme"
android:name="org.aisen.weibo.sina.base.MyApplication">
<!-- 您从百度网站获取的APP KEY -->
<meta-data android:name="BaiduMobAd_STAT_ID" android:value="3124a3bb28" /> <!-- abcd1234 -->
Expand Down
Binary file modified AisenWeiBo/ic_launcher-web.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed AisenWeiBo/res/drawable-hdpi/a_icon.png
Binary file not shown.
Binary file added AisenWeiBo/res/drawable-hdpi/a_icon_b.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added AisenWeiBo/res/drawable-ldpi/a_icon_b.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added AisenWeiBo/res/drawable-mdpi/a_icon_b.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed AisenWeiBo/res/drawable-xhdpi/a_icon.png
Binary file not shown.
Binary file added AisenWeiBo/res/drawable-xhdpi/a_icon_b.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions AisenWeiBo/res/layout/lay_divider.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@

<LinearLayout android:layout_width="match_parent" android:layout_height="30dip" android:orientation="horizontal"
android:gravity="center_vertical" android:id="@+id/layDivider" >
<View android:layout_width="30dip" android:layout_height="1dip" android:background="?attr/text_color" />
<View android:id="@+id/viewDividerRight" android:layout_width="30dip" android:layout_height="1dip" android:background="?attr/text_color" />

<org.aisen.weibo.sina.ui.widget.TraditionalTextView android:id="@+id/txtDivider" android:layout_width="wrap_content" android:layout_height="match_parent"
android:textSize="14sp" android:gravity="center_vertical" android:textColor="?attr/text_color"
android:layout_marginLeft="8dip" android:layout_marginRight="8dip" />

<View android:layout_width="0dip" android:layout_height="1dip" android:layout_weight="1" android:background="?attr/text_color" />
<View android:id="@+id/viewDividerLeft" android:layout_width="0dip" android:layout_height="1dip" android:layout_weight="1" android:background="?attr/text_color" />
</LinearLayout>

</LinearLayout>
15 changes: 15 additions & 0 deletions AisenWeiBo/res/raw/actions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -455,4 +455,19 @@
<value>statuses/mentions/shield.json</value>
</setting>

<setting type="trendsHourly">
<des>返回最近一小时内的热门话题</des>
<value>trends/hourly.json</value>
</setting>

<setting type="trendsDaily">
<des>返回最近一天内的热门话题</des>
<value>trends/daily.json</value>
</setting>

<setting type="trendsWeekly">
<des>返回最近一周内的热门话题</des>
<value>trends/weekly.json</value>
</setting>

</app-settings>
11 changes: 7 additions & 4 deletions AisenWeiBo/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<string name="app_name">Aisen微博</string>
<string name="app_name">Aisen</string>

<string name="reload">刷新看看</string>
<string name="draw_open">打开</string>
Expand Down Expand Up @@ -33,7 +33,7 @@
<string name="draw_search">Search</string>
<string name="draw_profile">用户资料</string>
<string name="draw_timeline">微博首页</string>
<string name="draw_message">\@我的</string>
<string name="draw_message">提及</string>
<string name="draw_comment">评论</string>
<string name="draw_fav">收藏</string>
<string name="draw_fav_title">收藏的微博</string>
Expand Down Expand Up @@ -344,6 +344,8 @@
<string name="settings_share_aisen">推荐给好友</string>
<string name="settings_grade">给我好评</string>
<string name="settings_version_update">检查更新</string>
<string name="settings_main_blur">首页蒙版</string>
<string name="settings_main_blur_summary">首页壁纸添加一层灰色蒙版</string>

<!-- 高级设置 -->
<string name="title_advanced">高级设置</string>
Expand Down Expand Up @@ -407,18 +409,19 @@

<string name="category_operation">操作</string>
<string name="settings_list_auto_update">列表自动刷新</string>
<string name="settings_list_auto_update_summary">缓存数据过期后,自动刷新列表数据</string>
<string name="settings_dt_list_widget">设置列表控件</string>
<string name="settings_list_widget">列表刷新控件</string>
<string name="settings_doubleclick_update">置顶同时刷新列表</string>
<string name="settings_doubleclick_update_summary">双击操作栏列表置顶时</string>
<string name="settings_doubleclick_update_summary">双击操作栏将列表置顶的同时</string>

<string name="category_feedback">反馈</string>
<string name="settings_sound">音效</string>
<string name="settings_sound_summary">列表刷新后声音反馈</string>
<string name="settings_vibrate">震动反馈</string>
<string name="settings_vibrate_summary">内容发送成功后震动反馈</string>
<string name="settings_list_anim">列表动画</string>
<string name="settings_list_anim_summary">列表加载时显示动画</string>
<string name="settings_list_anim_summary">列表内容加载时,显示动画</string>
<string name="category_other">其他</string>
<string name="settings_pic_path">图片保存路径</string>
<string name="settings_mention_history">清理@好友历史记录</string>
Expand Down
6 changes: 3 additions & 3 deletions AisenWeiBo/res/values/theme_colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@
<item>#ff673ab7</item>
<item>#ff3f51b5</item>
<item>#ff5677fc</item>
<item>#ff03a9f4</item>
<item>#FF3F9FE0</item>
<item>#ff00bcd4</item>
<item>#ff009688</item>
<item>#ff259b24</item>
<item>#ff8bc34a</item>
<item>#ffcddc39</item>
<item>#ffffc107</item>
<item>#ffff9800</item>
<item>#FFF4842D</item>
<item>#ffff5722</item>
<item>#ff795548</item>
<item>#ff9e9e9e</item>
<item>#FF666666</item>
<item>#ff607d8b</item>
<item>#ff353535</item>
</string-array>
Expand Down
3 changes: 3 additions & 0 deletions AisenWeiBo/res/xml/ui_advanced.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,8 @@

<CheckBoxPreference android:key="pRotatePic" android:title="@string/settings_pic_rotate" android:defaultValue="false"
android:summary="@string/settings_pic_rotate_summary" />

<CheckBoxPreference android:key="pMainBlur" android:title="@string/settings_main_blur" android:defaultValue="true"
android:summary="@string/settings_main_blur_summary" />

</PreferenceScreen>
5 changes: 3 additions & 2 deletions AisenWeiBo/res/xml/ui_basic_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,14 @@
</PreferenceCategory>

<PreferenceCategory android:title="@string/category_operation">
<CheckBoxPreference android:key="pAutoRefresh" android:title="@string/settings_list_auto_update" android:defaultValue="true" />
<CheckBoxPreference android:key="pAutoRefresh" android:title="@string/settings_list_auto_update"
android:defaultValue="true" android:summary="@string/settings_list_auto_update_summary" />

<!-- <ListPreference android:key="pRefreshViewType" android:entries="@array/pRefreshViewType" android:entryValues="@array/prefValues"
android:dialogTitle="@string/settings_dt_list_widget" android:title="@string/settings_list_widget" android:defaultValue="0" /> -->

<CheckBoxPreference android:key="pDoubleClickToRefresh" android:title="@string/settings_doubleclick_update" android:defaultValue="true"
android:summary="" />
android:summary="@string/settings_doubleclick_update_summary" />
</PreferenceCategory>

<PreferenceCategory android:title="@string/category_feedback">
Expand Down
33 changes: 33 additions & 0 deletions AisenWeiBo/sdk/org/sina/android/SinaSDK.java
Original file line number Diff line number Diff line change
Expand Up @@ -1191,5 +1191,38 @@ public SuggestionsUser[] searchSuggestionsUsers(String q, int count) throws Task

return doGet(getSetting("searchSuggestionsUsers"), params, SuggestionsUser[].class);
}

/**
* 返回最近一小时内的热门话题
*
* @return
* @throws TaskException
*/
public String trendsHourly() throws TaskException {

return doGet(getSetting("trendsHourly"), configParams(null), String.class);
}

/**
* 返回最近一天内的热门话题
*
* @return
* @throws TaskException
*/
public String trendsDaily() throws TaskException {

return doGet(getSetting("trendsDaily"), configParams(null), String.class);
}

/**
* 返回最近一周内的热门话题
*
* @return
* @throws TaskException
*/
public String trendsWeekly() throws TaskException {

return doGet(getSetting("trendsWeekly"), configParams(null), String.class);
}

}
25 changes: 25 additions & 0 deletions AisenWeiBo/src/org/aisen/weibo/sina/base/MyApplication.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.aisen.weibo.sina.base;

import java.io.File;
import java.util.List;

import org.aisen.weibo.sina.R;
Expand All @@ -18,10 +19,14 @@
import org.aisen.weibo.sina.sys.receiver.TimingBroadcastReceiver;
import org.aisen.weibo.sina.sys.receiver.TimingIntent;
import org.aisen.weibo.sina.ui.fragment.account.AccountFragment;
import org.aisen.weibo.sina.ui.widget.WallpaperViewGroup;
import org.sina.android.bean.WeiBoUser;

import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.preference.PreferenceManager;

import com.m.common.context.GlobalContext;
import com.m.common.settings.SettingUtility;
Expand Down Expand Up @@ -59,6 +64,14 @@ public void onCreate() {
} catch (Exception e) {
}

// KitKat以下,禁用设置选项
if (!WallpaperViewGroup.isKitKat()) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(GlobalContext.getInstance());
Editor editor = prefs.edit();
editor.putBoolean("pTranslucent", false);
editor.commit();
}

// 默认设置壁纸
// 暂时不默认设置壁纸
if (false && ActivityHelper.getInstance().getBooleanShareData("app_wallpaper_init", true)) {
Expand All @@ -75,6 +88,13 @@ public void onCreate() {
if (settingList.size() > 0)
AppContext.setWallpaper(settingList.get(0));
}

if (ActivityHelper.getInstance().getBooleanShareData("theme_init", true)) {
ActivityHelper.getInstance().putBooleanShareData("theme_init", false);

if (WallpaperViewGroup.isKitKat())
CommSettings.setAppTheme(R.style.BaseTheme_Translucent);
}
}

@Override
Expand All @@ -84,6 +104,11 @@ public String getDataPath() {
// return super.getDataPath();
}

@Override
public String getImagePath() {
return super.getAppPath() + SettingUtility.getPermanentSettingAsStr("com_m_common_image", "image") + File.separator;
}

private void initBaiduAnalyze() {
com.baidu.mobstat.StatService.setAppChannel(this, SettingUtility.getStringSetting("app_channel"), true);
com.baidu.mobstat.StatService.setSessionTimeOut(5 * 60);
Expand Down
12 changes: 12 additions & 0 deletions AisenWeiBo/src/org/aisen/weibo/sina/support/utils/AisenUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -778,4 +778,16 @@ public static WallpaperBean generaterDefaultWallpaper() {
return launchWallpaper;
}

public static void setDivider(View divider) {
Resources res = GlobalContext.getInstance().getResources();

if (!AisenUtil.isTranslucent()) {
divider.findViewById(R.id.viewDividerLeft).setBackgroundColor(res.getColor(R.color.edit_hint));

((TextView) divider.findViewById(R.id.txtDivider)).setTextColor(res.getColor(R.color.edit_hint));

divider.findViewById(R.id.viewDividerRight).setBackgroundColor(res.getColor(R.color.edit_hint));
}
}

}
10 changes: 10 additions & 0 deletions AisenWeiBo/src/org/aisen/weibo/sina/support/utils/AppSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,16 @@ public static boolean isDisableCache() {
return prefs.getBoolean("pDisableCache", false);
}

/**
* 首页壁纸添加一层蒙版
*
* @return
*/
public static boolean isMainBlur() {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(GlobalContext.getInstance());
return prefs.getBoolean("pMainBlur", true);
}

/**
* 列表刷新控件
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
public class MainGuideActivity extends BaseActivity {

public static void launch(Activity from) {
// 屏蔽向导页
if (true)
return;

if (BaseActivity.getRunningActivity() != null && BaseActivity.getRunningActivity() instanceof MainActivity) {
Intent intent = new Intent(from, MainGuideActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import org.aisen.weibo.sina.support.bean.MenuBean;
import org.aisen.weibo.sina.support.iclass.IAcNavigation;
import org.aisen.weibo.sina.support.utils.AppContext;
import org.aisen.weibo.sina.support.utils.AppSettings;
import org.aisen.weibo.sina.support.utils.CheckChangedUtils;
import org.aisen.weibo.sina.ui.activity.common.WeiboBaseActivity;
import org.aisen.weibo.sina.ui.activity.publish.PublishActivity;
Expand Down Expand Up @@ -67,8 +68,8 @@ public static void login() {

@Override
protected void onCreate(Bundle savedInstanceState) {
org.aisen.weibo.sina.ui.fragment.base.ActivityHelper activityHelper = (org.aisen.weibo.sina.ui.fragment.base.ActivityHelper) getActivityHelper();
activityHelper.blur = true;
final org.aisen.weibo.sina.ui.fragment.base.ActivityHelper activityHelper = (org.aisen.weibo.sina.ui.fragment.base.ActivityHelper) getActivityHelper();
activityHelper.blur = AppSettings.isMainBlur();

super.onCreate(savedInstanceState);
setContentView(R.layout.ui_main);
Expand Down Expand Up @@ -118,7 +119,7 @@ public void onDrawerStateChanged(int newState) {
mDrawerLayout.setDrawerListener(mDrawerToggle);

getActionBar().setDisplayHomeAsUpEnabled(true);
// getActionBar().setIcon(R.drawable.ic_logo);
getActionBar().setIcon(R.drawable.ic_ab_app);
getActionBar().setDisplayShowHomeEnabled(true);

lastSelectedMenu = savedInstanceState == null ? null : (MenuBean) savedInstanceState.getSerializable("menu");
Expand Down Expand Up @@ -187,6 +188,16 @@ else if ("showDraft".equals(action)) {

// 每次启动应用,检测是否下载了壁纸
CheckChangedUtils.checkWallpaper();

// 2014-10-29 解决首次进入首页时,ActionBar的颜色总差一点点的BUG
new Handler().postDelayed(new Runnable() {

@Override
public void run() {
activityHelper.wallpaper.setWallpaper();
}

}, 200);
}

@Override
Expand Down Expand Up @@ -421,6 +432,9 @@ public void run() {

@Override
protected void onResume() {
final org.aisen.weibo.sina.ui.fragment.base.ActivityHelper activityHelper = (org.aisen.weibo.sina.ui.fragment.base.ActivityHelper) getActivityHelper();
activityHelper.wallpaper.blur = AppSettings.isMainBlur();

super.onResume();

if (!AppContext.isLogedin())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.ui_fragment_container);

getActionBar().setDisplayShowHomeEnabled(false);

// 接收分享
if (savedInstanceState == null) {
Intent intent = getIntent();
Expand Down Expand Up @@ -268,7 +270,6 @@ protected void onCreate(Bundle savedInstanceState) {
getFragmentManager().beginTransaction().add(R.id.fragmentContainer, fragment, "PublishFragment").commit();
}

getActionBar().setDisplayShowHomeEnabled(false);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import org.aisen.weibo.sina.R;
import org.aisen.weibo.sina.support.paging.CommentsPagingProcessor;
import org.aisen.weibo.sina.support.utils.AisenUtil;
import org.aisen.weibo.sina.support.utils.AppContext;
import org.aisen.weibo.sina.support.utils.AppSettings;
import org.aisen.weibo.sina.ui.activity.comment.TimelineCommentsActivity;
Expand Down Expand Up @@ -90,9 +91,10 @@ protected void initRefreshList(Bundle savedInstanceState) {
// headerDivider.setVisibility(View.GONE);
TextView txtDivider = (TextView) headerDivider.findViewById(R.id.txtDivider);
txtDivider.setText(getString(R.string.timelinecmt_divider_cmt));
AisenUtil.setDivider(headerDivider);

mStatusContent = savedInstanceState == null ? (StatusContent) getArguments().getSerializable("bean")
: (StatusContent) savedInstanceState.getSerializable("bean");
: (StatusContent) savedInstanceState.getSerializable("bean");

timelineItem.bindingData(headerView, mStatusContent);

Expand Down Expand Up @@ -199,13 +201,6 @@ protected void onFinished() {
// 第一次加载完数据,将评论置顶
if (mode == RefreshMode.reset)
listView.setSelectionFromTop(listView.getFooterViewsCount(), 0);

if (getAdapterItems().size() > 0) {
headerDivider.setVisibility(View.VISIBLE);
}
else {
headerDivider.setVisibility(View.GONE);
}
}

@Override
Expand Down
Loading

0 comments on commit af10af8

Please sign in to comment.