├── .gitignore
├── .idea
├── .name
├── compiler.xml
├── copyright
│ └── profiles_settings.xml
├── encodings.xml
├── gradle.xml
├── misc.xml
├── modules.xml
├── runConfigurations.xml
└── vcs.xml
├── README.md
├── WeiboSdk
├── .gitignore
├── build.gradle
├── libs
│ └── weibosdkcore.jar
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── sina
│ │ └── weibo
│ │ └── sdk
│ │ └── ApplicationTest.java
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── com
│ │ └── sina
│ │ └── weibo
│ │ └── sdk
│ │ ├── codestyle
│ │ ├── CodingRuler.java
│ │ └── SampleCode.java
│ │ ├── openapi
│ │ ├── AbsOpenAPI.java
│ │ ├── CommentsAPI.java
│ │ ├── InviteAPI.java
│ │ ├── LogoutAPI.java
│ │ ├── StatusesAPI.java
│ │ ├── UsersAPI.java
│ │ ├── legacy
│ │ │ ├── AccountAPI.java
│ │ │ ├── ActivityInvokeAPI.java
│ │ │ ├── CommonAPI.java
│ │ │ ├── FavoritesAPI.java
│ │ │ ├── FriendshipsAPI.java
│ │ │ ├── GroupAPI.java
│ │ │ ├── LocationAPI.java
│ │ │ ├── PlaceAPI.java
│ │ │ ├── RegisterAPI.java
│ │ │ ├── SearchAPI.java
│ │ │ ├── ShortUrlAPI.java
│ │ │ ├── StatusesAPI.java
│ │ │ ├── SuggestionsAPI.java
│ │ │ ├── TagsAPI.java
│ │ │ └── TrendsAPI.java
│ │ └── models
│ │ │ ├── AbsDataObject.java
│ │ │ ├── Comment.java
│ │ │ ├── CommentList.java
│ │ │ ├── Coordinate.java
│ │ │ ├── ErrorInfo.java
│ │ │ ├── Favorite.java
│ │ │ ├── FavoriteList.java
│ │ │ ├── Geo.java
│ │ │ ├── GeoList.java
│ │ │ ├── Group.java
│ │ │ ├── GroupList.java
│ │ │ ├── GroupTag.java
│ │ │ ├── IParseable.java
│ │ │ ├── MusicInfo.java
│ │ │ ├── OffsetGeo.java
│ │ │ ├── Poi.java
│ │ │ ├── PoiList.java
│ │ │ ├── Privacy.java
│ │ │ ├── Remind.java
│ │ │ ├── Status.java
│ │ │ ├── StatusList.java
│ │ │ ├── Tag.java
│ │ │ ├── User.java
│ │ │ └── Visible.java
│ │ └── widget
│ │ ├── LoginButton.java
│ │ └── LoginoutButton.java
│ └── res
│ ├── drawable-hdpi
│ ├── ic_com_sina_weibo_sdk_button_blue_focused.9.png
│ ├── ic_com_sina_weibo_sdk_button_blue_normal.9.png
│ ├── ic_com_sina_weibo_sdk_button_blue_pressed.9.png
│ ├── ic_com_sina_weibo_sdk_button_grey_focused.9.png
│ ├── ic_com_sina_weibo_sdk_button_grey_normal.9.png
│ ├── ic_com_sina_weibo_sdk_button_grey_pressed.9.png
│ ├── ic_com_sina_weibo_sdk_login_button_with_frame_logo_focused.png
│ ├── ic_com_sina_weibo_sdk_login_button_with_frame_logo_normal.png
│ ├── ic_com_sina_weibo_sdk_login_button_with_frame_logo_pressed.png
│ ├── ic_com_sina_weibo_sdk_login_with_account_text_focused.png
│ ├── ic_com_sina_weibo_sdk_login_with_account_text_normal.png
│ ├── ic_com_sina_weibo_sdk_login_with_account_text_pressed.png
│ ├── ic_com_sina_weibo_sdk_login_with_text.png
│ └── ic_com_sina_weibo_sdk_logo.png
│ ├── drawable-ldpi
│ ├── ic_com_sina_weibo_sdk_login_button_with_frame_logo_focused.png
│ ├── ic_com_sina_weibo_sdk_login_button_with_frame_logo_normal.png
│ ├── ic_com_sina_weibo_sdk_login_button_with_frame_logo_pressed.png
│ ├── ic_com_sina_weibo_sdk_login_with_account_text_focused.png
│ ├── ic_com_sina_weibo_sdk_login_with_account_text_normal.png
│ ├── ic_com_sina_weibo_sdk_login_with_account_text_pressed.png
│ ├── ic_com_sina_weibo_sdk_login_with_text.png
│ └── ic_com_sina_weibo_sdk_logo.png
│ ├── drawable-mdpi
│ ├── ic_com_sina_weibo_sdk_button_blue_focused.9.png
│ ├── ic_com_sina_weibo_sdk_button_blue_normal.9.png
│ ├── ic_com_sina_weibo_sdk_button_blue_pressed.9.png
│ ├── ic_com_sina_weibo_sdk_button_grey_focused.9.png
│ ├── ic_com_sina_weibo_sdk_button_grey_normal.9.png
│ ├── ic_com_sina_weibo_sdk_button_grey_pressed.9.png
│ ├── ic_com_sina_weibo_sdk_login_button_with_frame_logo_focused.png
│ ├── ic_com_sina_weibo_sdk_login_button_with_frame_logo_normal.png
│ ├── ic_com_sina_weibo_sdk_login_button_with_frame_logo_pressed.png
│ ├── ic_com_sina_weibo_sdk_login_with_account_text_focused.png
│ ├── ic_com_sina_weibo_sdk_login_with_account_text_normal.png
│ ├── ic_com_sina_weibo_sdk_login_with_account_text_pressed.png
│ ├── ic_com_sina_weibo_sdk_login_with_text.png
│ └── ic_com_sina_weibo_sdk_logo.png
│ ├── drawable-xhdpi
│ ├── ic_com_sina_weibo_sdk_button_blue_focused.9.png
│ ├── ic_com_sina_weibo_sdk_button_blue_normal.9.png
│ ├── ic_com_sina_weibo_sdk_button_blue_pressed.9.png
│ ├── ic_com_sina_weibo_sdk_button_grey_focused.9.png
│ ├── ic_com_sina_weibo_sdk_button_grey_normal.9.png
│ ├── ic_com_sina_weibo_sdk_button_grey_pressed.9.png
│ ├── ic_com_sina_weibo_sdk_login_button_with_frame_logo_focused.png
│ ├── ic_com_sina_weibo_sdk_login_button_with_frame_logo_normal.png
│ ├── ic_com_sina_weibo_sdk_login_button_with_frame_logo_pressed.png
│ ├── ic_com_sina_weibo_sdk_login_with_account_text_focused.png
│ ├── ic_com_sina_weibo_sdk_login_with_account_text_normal.png
│ ├── ic_com_sina_weibo_sdk_login_with_account_text_pressed.png
│ └── ic_com_sina_weibo_sdk_logo.png
│ ├── drawable-xxhdpi
│ ├── ic_com_sina_weibo_sdk_login_button_with_frame_logo_focused.png
│ ├── ic_com_sina_weibo_sdk_login_button_with_frame_logo_normal.png
│ ├── ic_com_sina_weibo_sdk_login_button_with_frame_logo_pressed.png
│ ├── ic_com_sina_weibo_sdk_login_with_account_text_focused.png
│ ├── ic_com_sina_weibo_sdk_login_with_account_text_normal.png
│ └── ic_com_sina_weibo_sdk_login_with_account_text_pressed.png
│ ├── drawable
│ ├── com_sina_weibo_sdk_button_blue.xml
│ ├── com_sina_weibo_sdk_button_grey.xml
│ ├── com_sina_weibo_sdk_login_button_with_account_text.xml
│ ├── com_sina_weibo_sdk_login_button_with_frame_logo.xml
│ └── com_sina_weibo_sdk_login_button_with_original_logo.xml
│ ├── values-en
│ └── strings.xml
│ ├── values-large-long
│ └── dimens.xml
│ ├── values-large
│ └── dimens.xml
│ ├── values-normal-notlong
│ └── dimens.xml
│ ├── values-v11
│ └── styles.xml
│ ├── values-v14
│ └── styles.xml
│ ├── values-zh-rTW
│ └── strings.xml
│ └── values
│ ├── dimens.xml
│ ├── strings.xml
│ └── styles.xml
├── app
├── .gitignore
├── app-release.apk
├── build.gradle
├── jianwei.apk
├── libs
│ ├── avoscloud-sdk-v3.13.7.jar
│ ├── avoscloud-statistics-v3.13.7.jar
│ ├── fastjson.jar
│ ├── httpmime-4.2.4.jar
│ ├── okhttp-2.6.0-leancloud.jar
│ └── okio-1.6.0-leancloud.jar
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── me
│ │ └── pkhope
│ │ └── jianwei
│ │ └── ApplicationTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── me
│ │ │ └── pkhope
│ │ │ └── jianwei
│ │ │ ├── API
│ │ │ ├── MyCommentsAPI.java
│ │ │ ├── MyStatusesAPI.java
│ │ │ └── WeiboAPI.java
│ │ │ ├── App.java
│ │ │ ├── Constants.java
│ │ │ ├── PostService.java
│ │ │ ├── interfaces
│ │ │ └── Identifier.java
│ │ │ ├── models
│ │ │ └── UserList.java
│ │ │ ├── ui
│ │ │ ├── activity
│ │ │ │ ├── AboutActivity.java
│ │ │ │ ├── AuthActivity.java
│ │ │ │ ├── FeedbackActivity.java
│ │ │ │ ├── ImageDetailActivity.java
│ │ │ │ ├── MainActivity.java
│ │ │ │ ├── ReplyActivity.java
│ │ │ │ ├── SendWeiboActivity.java
│ │ │ │ ├── SettingActivity.java
│ │ │ │ ├── UserActivity.java
│ │ │ │ ├── WebActivity.java
│ │ │ │ └── WeiboDetailActivity.java
│ │ │ ├── adapter
│ │ │ │ ├── CommentAdapter.java
│ │ │ │ ├── FriendsTimelineAdapter.java
│ │ │ │ ├── MyFragmentPagerAdapter.java
│ │ │ │ ├── UserAdapter.java
│ │ │ │ └── ViewPagerAdapter.java
│ │ │ ├── base
│ │ │ │ ├── BaseActivity.java
│ │ │ │ └── BaseFragment.java
│ │ │ └── fragment
│ │ │ │ ├── CommentByMeFragment.java
│ │ │ │ ├── CommentFragment.java
│ │ │ │ ├── CommentToMeFragment.java
│ │ │ │ ├── FollowersFragment.java
│ │ │ │ ├── FriendsFragment.java
│ │ │ │ ├── FriendsTimelineFragment.java
│ │ │ │ ├── MeFragment.java
│ │ │ │ ├── MentionsFragment.java
│ │ │ │ ├── MessageFragment.java
│ │ │ │ ├── RepostFragment.java
│ │ │ │ └── UserTimelineFragment.java
│ │ │ ├── utils
│ │ │ ├── AccessTokenPreference.java
│ │ │ ├── AdditionText.java
│ │ │ ├── StatusFilter.java
│ │ │ ├── TimeConverter.java
│ │ │ └── ToastUtils.java
│ │ │ └── widget
│ │ │ ├── DividerItemDecoration.java
│ │ │ ├── HackyViewPager.java
│ │ │ ├── MyViewPager.java
│ │ │ ├── ProgressWebView.java
│ │ │ ├── RecyclerViewDivider.java
│ │ │ ├── RoundConerImageView.java
│ │ │ └── emojitextview
│ │ │ ├── EmojiTextView.java
│ │ │ ├── MyLinkMovementMethod.java
│ │ │ ├── WeiBoContentClickableSpan.java
│ │ │ └── WeiBoContentTextUtil.java
│ ├── jniLibs
│ │ ├── armeabi-v7a
│ │ │ └── libweibosdkcore.so
│ │ ├── armeabi
│ │ │ └── libweibosdkcore.so
│ │ ├── mips
│ │ │ └── libweibosdkcore.so
│ │ └── x86
│ │ │ └── libweibosdkcore.so
│ └── res
│ │ ├── drawable
│ │ ├── add_image.png
│ │ ├── de.png
│ │ ├── default_image.png
│ │ ├── item_bg.xml
│ │ ├── list_divider.xml
│ │ └── progress_bar_states.xml
│ │ ├── layout
│ │ ├── activity_about.xml
│ │ ├── activity_feedback.xml
│ │ ├── activity_image_detail.xml
│ │ ├── activity_main.xml
│ │ ├── activity_reply.xml
│ │ ├── activity_send_weibo.xml
│ │ ├── activity_setting.xml
│ │ ├── activity_user.xml
│ │ ├── activity_web.xml
│ │ ├── activity_weibo_detail.xml
│ │ ├── bottom_navigation_bar.xml
│ │ ├── comment_item.xml
│ │ ├── fragment_me.xml
│ │ ├── fragment_message.xml
│ │ ├── image_detail.xml
│ │ ├── list_layout.xml
│ │ ├── user_item.xml
│ │ ├── view_toolbar.xml
│ │ ├── webview_layout.xml
│ │ ├── weibo_image_item.xml
│ │ ├── weibo_text_item.xml
│ │ └── weibo_with_retweet_item.xml
│ │ ├── menu
│ │ ├── menu.xml
│ │ └── menu_send.xml
│ │ ├── mipmap-hdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-mdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xhdpi
│ │ ├── ic_account_box_white_48dp.png
│ │ ├── ic_add_white_48dp.png
│ │ ├── ic_home_white_24dp.png
│ │ ├── ic_launcher.png
│ │ ├── ic_message_white_24dp.png
│ │ └── ic_send.png
│ │ ├── mipmap-xxhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxxhdpi
│ │ └── ic_launcher.png
│ │ ├── values-w820dp
│ │ └── dimens.xml
│ │ └── values
│ │ ├── attrs.xml
│ │ ├── colors.xml
│ │ ├── dimens.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ └── test
│ └── java
│ └── me
│ └── pkhope
│ └── jianwei
│ └── ExampleUnitTest.java
├── build.gradle
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── screenshot
├── pic1.jpg
├── pic2.jpg
└── pic3.jpg
└── settings.gradle
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/workspace.xml
5 | /.idea/libraries
6 | .DS_Store
7 | /build
8 | /captures
9 |
--------------------------------------------------------------------------------
/.idea/.name:
--------------------------------------------------------------------------------
1 | Jianwei
--------------------------------------------------------------------------------
/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/.idea/copyright/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
25 |
26 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 | 1.7
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ##介绍
2 | 微博第三方客户端,界面简洁漂亮,没有任何广告。
3 |
4 |
5 | ##说明
6 | 目前新浪微博已不接受第三方客户端审核,练习或自己用的话可以使用weico的appkey。使用方法可以参考weico分支。
7 |
8 | ##下载地址
9 | http://fir.im/ba78
10 |
11 | ##截图
12 | 
13 | 
14 | 
15 |
16 | ##License
17 |
18 | Copyright 2016 pkhope.
19 |
20 | Licensed under the Apache License, Version 2.0 (the "License");
21 | you may not use this file except in compliance with the License.
22 | You may obtain a copy of the License at
23 |
24 | http://www.apache.org/licenses/LICENSE-2.0
25 |
26 | Unless required by applicable law or agreed to in writing, software
27 | distributed under the License is distributed on an "AS IS" BASIS,
28 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
29 | See the License for the specific language governing permissions and
30 | limitations under the License.
31 |
--------------------------------------------------------------------------------
/WeiboSdk/.gitignore:
--------------------------------------------------------------------------------
1 | # Created by .ignore support plugin (hsz.mobi)
2 | ### Android template
3 | # Built application files
4 | *.apk
5 | *.ap_
6 |
7 | # Files for the Dalvik VM
8 | *.dex
9 |
10 | # Java class files
11 | *.class
12 |
13 | # Generated files
14 | bin/
15 | gen/
16 |
17 | # Gradle files
18 | .gradle/
19 | build/
20 | /*/build/
21 |
22 | # Local configuration file (sdk path, etc)
23 | local.properties
24 |
25 | # Proguard folder generated by Eclipse
26 | proguard/
27 |
28 | # Log Files
29 | *.log
30 |
31 |
32 | ### JetBrains template
33 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion
34 |
35 | *.iml
36 |
37 | ## Directory-based project format:
38 | .idea/
39 | # if you remove the above rule, at least ignore the following:
40 |
41 | # User-specific stuff:
42 | # .idea/workspace.xml
43 | # .idea/tasks.xml
44 | # .idea/dictionaries
45 |
46 | # Sensitive or high-churn files:
47 | # .idea/dataSources.ids
48 | # .idea/dataSources.xml
49 | # .idea/sqlDataSources.xml
50 | # .idea/dynamic.xml
51 | # .idea/uiDesigner.xml
52 |
53 | # Gradle:
54 | # .idea/gradle.xml
55 | # .idea/libraries
56 |
57 | # Mongo Explorer plugin:
58 | # .idea/mongoSettings.xml
59 |
60 | ## File-based project format:
61 | *.ipr
62 | *.iws
63 |
64 | ## Plugin-specific files:
65 |
66 | # IntelliJ
67 | /out/
68 |
69 | # mpeltonen/sbt-idea plugin
70 | .idea_modules/
71 |
72 | # JIRA plugin
73 | atlassian-ide-plugin.xml
74 |
75 | # Crashlytics plugin (for Android Studio and IntelliJ)
76 | com_crashlytics_export_strings.xml
77 | crashlytics.properties
78 | crashlytics-build.properties
79 |
80 |
81 | ### Windows template
82 | # Windows image file caches
83 | Thumbs.db
84 | ehthumbs.db
85 |
86 | # Folder config file
87 | Desktop.ini
88 |
89 | # Recycle Bin used on file shares
90 | $RECYCLE.BIN/
91 |
92 | # Windows Installer files
93 | *.cab
94 | *.msi
95 | *.msm
96 | *.msp
97 |
98 | # Windows shortcuts
99 | *.lnk
100 |
101 |
102 |
--------------------------------------------------------------------------------
/WeiboSdk/build.gradle:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2015 Coder.HanXin
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | apply plugin: 'com.android.library'
18 |
19 | android {
20 | compileOptions {
21 | sourceCompatibility JavaVersion.VERSION_1_7
22 | targetCompatibility JavaVersion.VERSION_1_7
23 | }
24 | compileSdkVersion 22
25 | buildToolsVersion "22.0.1"
26 | defaultConfig {
27 | minSdkVersion 8
28 | targetSdkVersion 22
29 | versionCode 8
30 | versionName "3.0.1"
31 | }
32 | buildTypes {
33 | release {
34 | minifyEnabled false
35 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
36 | }
37 | }
38 | }
39 |
40 | dependencies {
41 | compile fileTree(include: ['*.jar'], dir: 'libs')
42 | compile 'com.android.support:appcompat-v7:22.1.1'
43 | compile files('libs/weibosdkcore.jar')
44 | }
45 |
--------------------------------------------------------------------------------
/WeiboSdk/libs/weibosdkcore.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/WeiboSdk/libs/weibosdkcore.jar
--------------------------------------------------------------------------------
/WeiboSdk/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in C:\Android\sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/WeiboSdk/src/androidTest/java/com/sina/weibo/sdk/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2015 Coder.HanXin
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.sina.weibo.sdk;
18 |
19 | import android.app.Application;
20 | import android.test.ApplicationTestCase;
21 |
22 | /**
23 | * Testing Fundamentals
24 | */
25 | public class ApplicationTest extends ApplicationTestCase {
26 | public ApplicationTest() {
27 | super(Application.class);
28 | }
29 | }
--------------------------------------------------------------------------------
/WeiboSdk/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/WeiboSdk/src/main/java/com/sina/weibo/sdk/codestyle/SampleCode.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2010-2013 The SINA WEIBO Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.sina.weibo.sdk.codestyle;
18 |
19 | /**
20 | * 类的大体描述放在这里。
21 | *
22 | * @author 作者名
23 | * @since 2013-XX-XX
24 | */
25 | @SuppressWarnings("unused")
26 | public class SampleCode {
27 |
28 | /** 公有的常量注释 */
29 | public static final String ACTION_MAIN = "android.intent.action.MAIN";
30 |
31 | /** 私有的常量注释(同类型的常量可以分块并紧凑定义) */
32 | private static final int MSG_AUTH_NONE = 0;
33 | private static final int MSG_AUTH_SUCCESS = 1;
34 | private static final int MSG_AUTH_FAILED = 2;
35 |
36 | /** 保护的成员变量注释 */
37 | protected Object mObject0;
38 |
39 | /** 私有的成员变量 mObject1 注释(同类型的成员变量可以分块并紧凑定义) */
40 | private Object mObject1;
41 | /** 私有的成员变量 mObject2 注释 */
42 | private Object mObject2;
43 | /** 私有的成员变量 mObject3 注释 */
44 | private Object mObject3;
45 |
46 | /**
47 | * 对于注释多于一行的,采用这种方式来
48 | * 定义该变量
49 | */
50 | private Object mObject4;
51 |
52 | /**
53 | * 公有方法描述...
54 | *
55 | * @param param1 参数1描述...
56 | * @param param2 参数2描述...
57 | * @param paramXX 参数XX描述... (注意:请将参数、描述都对齐)
58 | */
59 | public void doSomething(int param1, float param2, String paramXX) {
60 | // ...implementation
61 | }
62 |
63 | /**
64 | * 保护方法描述...
65 | */
66 | protected void doSomething() {
67 | // ...implementation
68 | }
69 |
70 | /**
71 | * 私有方法描述...
72 | *
73 | * @param param1 参数1描述...
74 | * @param param2 参数2描述...
75 | */
76 | private void doSomethingInternal(int param1, float param2) {
77 | // ...implementation
78 | }
79 | }
80 |
--------------------------------------------------------------------------------
/WeiboSdk/src/main/java/com/sina/weibo/sdk/openapi/InviteAPI.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2010-2013 The SINA WEIBO Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.sina.weibo.sdk.openapi;
18 |
19 | import org.json.JSONObject;
20 |
21 | import android.content.Context;
22 | import android.text.TextUtils;
23 | import com.sina.weibo.sdk.auth.Oauth2AccessToken;
24 | import com.sina.weibo.sdk.net.RequestListener;
25 | import com.sina.weibo.sdk.net.WeiboParameters;
26 | import com.sina.weibo.sdk.utils.LogUtil;
27 |
28 | /**
29 | * 该类提供了好友邀请接口,支持登录用户向自己的微博互粉好友发送私信邀请、礼物。
30 | * 详情请参考:
31 | * 好友邀请接口
32 | * 申请接入流程
33 | *
34 | * @author SINA
35 | * @since 2013-11-04
36 | */
37 | public class InviteAPI extends AbsOpenAPI {
38 | private final static String TAG = InviteAPI.class.getName();
39 |
40 | /** 邀请地址 */
41 | private final String INVITE_URL = "https://m.api.weibo.com/2/messages/invite.json";
42 |
43 | /**(必须)要回复的私信文本内容。文本大小必须小于300个汉字 */
44 | public final static String KEY_TEXT = "text";
45 | /**(可选)邀请点击后跳转链接。默认为当前应用地址 */
46 | public final static String KEY_URL = "url";
47 | /**(可选)邀请 Card 展示时的图标地址,大小必须为 80px X 80px,仅支持 PNG、JPG 格式。默认为当前应用 Logo 地址 */
48 | public final static String KEY_INVITE_LOGO = "invite_logo";
49 |
50 | /**
51 | * 构造函数。
52 | *
53 | * @param oauth2AccessToken Token 实例
54 | */
55 | public InviteAPI(Context context, String appKey, Oauth2AccessToken accessToken) {
56 | super(context, appKey, accessToken);
57 | }
58 |
59 | /**
60 | * 向好友发送邀请。支持登录用户向自己的微博互粉好友发送私信邀请、礼物。
61 | *
62 | * @param uid 被邀请人的 Uid,需要为当前用户互粉好友
63 | * @param jsonData 邀请数据。以 {@link JSONObject} 数据填充
64 | * @param listener 邀请接口对应的回调
65 | */
66 | public void sendInvite(String uid, JSONObject jsonData, RequestListener listener) {
67 | if (!TextUtils.isEmpty(uid)
68 | && jsonData != null
69 | && !TextUtils.isEmpty(jsonData.toString())) {
70 |
71 | WeiboParameters params = new WeiboParameters(mAppKey);
72 | params.put("uid", uid);
73 | params.put("data", jsonData.toString());
74 | requestAsync(INVITE_URL, params, HTTPMETHOD_POST, listener);
75 | } else {
76 | LogUtil.d(TAG, "Invite args error!");
77 | }
78 | }
79 | }
80 |
--------------------------------------------------------------------------------
/WeiboSdk/src/main/java/com/sina/weibo/sdk/openapi/LogoutAPI.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2010-2013 The SINA WEIBO Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.sina.weibo.sdk.openapi;
18 |
19 | import android.content.Context;
20 | import com.sina.weibo.sdk.auth.Oauth2AccessToken;
21 | import com.sina.weibo.sdk.net.RequestListener;
22 | import com.sina.weibo.sdk.net.WeiboParameters;
23 |
24 | /**
25 | * 该类提供了授权回收接口,帮助开发者主动取消用户的授权。
26 | * 详情请参考授权回收
27 | *
28 | * @author SINA
29 | * @since 2013-11-05
30 | */
31 | public class LogoutAPI extends AbsOpenAPI {
32 | /** 注销地址(URL) */
33 | private static final String REVOKE_OAUTH_URL = "https://api.weibo.com/oauth2/revokeoauth2";
34 |
35 | /**
36 | * 构造函数。
37 | *
38 | * @param oauth2AccessToken Token 实例
39 | */
40 | public LogoutAPI(Context context, String appKey, Oauth2AccessToken accessToken) {
41 | super(context, appKey, accessToken);
42 | }
43 |
44 | /**
45 | * 异步取消用户的授权。
46 | *
47 | * @param listener 异步请求回调接口
48 | */
49 | public void logout(RequestListener listener) {
50 | requestAsync(REVOKE_OAUTH_URL, new WeiboParameters(mAppKey), HTTPMETHOD_POST, listener);
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/WeiboSdk/src/main/java/com/sina/weibo/sdk/openapi/legacy/RegisterAPI.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2010-2013 The SINA WEIBO Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.sina.weibo.sdk.openapi.legacy;
18 |
19 | import android.content.Context;
20 | import com.sina.weibo.sdk.auth.Oauth2AccessToken;
21 | import com.sina.weibo.sdk.net.RequestListener;
22 | import com.sina.weibo.sdk.net.WeiboParameters;
23 | import com.sina.weibo.sdk.openapi.AbsOpenAPI;
24 |
25 | /**
26 | * 该类封装了微博的注册接口。
27 | * 详情请参考注册接口
28 | *
29 | * @author SINA
30 | * @date 2014-03-03
31 | */
32 | public class RegisterAPI extends AbsOpenAPI {
33 | public RegisterAPI(Context context, String appKey, Oauth2AccessToken accessToken) {
34 | super(context, appKey, accessToken);
35 | }
36 |
37 | private static final String SERVER_URL_PRIX = API_SERVER + "/register";
38 |
39 | /**
40 | * 验证昵称是否可用。
41 | *
42 | * @param nickname 需要验证的昵称。4-20个字符,支持中英文、数字、"_"或减号
43 | * @param listener 异步请求回调接口
44 | */
45 | public void suggestions(String nickname, RequestListener listener) {
46 | WeiboParameters params = new WeiboParameters(mAppKey);
47 | params.put("nickname", nickname);
48 | requestAsync(SERVER_URL_PRIX + "/verify_nickname.json", params, HTTPMETHOD_GET, listener);
49 | }
50 |
51 | }
52 |
--------------------------------------------------------------------------------
/WeiboSdk/src/main/java/com/sina/weibo/sdk/openapi/models/AbsDataObject.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2010-2013 The SINA WEIBO Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.sina.weibo.sdk.openapi.models;
18 |
19 | import org.json.JSONException;
20 | import org.json.JSONObject;
21 |
22 | import android.text.TextUtils;
23 |
24 | /**
25 | * 该类用于解析Object类型数据。
26 | *
27 | * @author SINA
28 | * @date 2014-03-03
29 | */
30 | public class AbsDataObject implements IParseable {
31 |
32 | @Override
33 | public Object parse(String parseString) {
34 | if (TextUtils.isEmpty(parseString)) {
35 | return null;
36 | }
37 |
38 | try {
39 | JSONObject object = new JSONObject(parseString);
40 | return parse(object);
41 | } catch (JSONException e) {
42 | e.printStackTrace();
43 | }
44 |
45 | return null;
46 | }
47 |
48 | @Override
49 | public Object parse(JSONObject jsonObject) {
50 | if (null == jsonObject) {
51 | return null;
52 | }
53 |
54 | return null;
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/WeiboSdk/src/main/java/com/sina/weibo/sdk/openapi/models/Comment.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2010-2013 The SINA WEIBO Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.sina.weibo.sdk.openapi.models;
18 |
19 | import org.json.JSONObject;
20 |
21 | /**
22 | * 评论结构体。
23 | *
24 | * @author SINA
25 | * @since 2013-11-24
26 | */
27 | public class Comment {
28 |
29 | /** 评论创建时间 */
30 | public String created_at;
31 | /** 评论的 ID */
32 | public String id;
33 | /** 评论的内容 */
34 | public String text;
35 | /** 评论的来源 */
36 | public String source;
37 | /** 评论作者的用户信息字段 */
38 | public User user;
39 | /** 评论的 MID */
40 | public String mid;
41 | /** 字符串型的评论 ID */
42 | public String idstr;
43 | /** 评论的微博信息字段 */
44 | public Status status;
45 | /** 评论来源评论,当本评论属于对另一评论的回复时返回此字段 */
46 | public Comment reply_comment;
47 |
48 | public static Comment parse(JSONObject jsonObject) {
49 | if (null == jsonObject) {
50 | return null;
51 | }
52 |
53 | Comment comment = new Comment();
54 | comment.created_at = jsonObject.optString("created_at");
55 | comment.id = jsonObject.optString("id");
56 | comment.text = jsonObject.optString("text");
57 | comment.source = jsonObject.optString("source");
58 | comment.user = User.parse(jsonObject.optJSONObject("user"));
59 | comment.mid = jsonObject.optString("mid");
60 | comment.idstr = jsonObject.optString("idstr");
61 | comment.status = Status.parse(jsonObject.optJSONObject("status"));
62 | comment.reply_comment = Comment.parse(jsonObject.optJSONObject("reply_comment"));
63 |
64 | return comment;
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/WeiboSdk/src/main/java/com/sina/weibo/sdk/openapi/models/CommentList.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2010-2013 The SINA WEIBO Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.sina.weibo.sdk.openapi.models;
18 |
19 | import java.util.ArrayList;
20 |
21 | import org.json.JSONArray;
22 | import org.json.JSONException;
23 | import org.json.JSONObject;
24 |
25 | import android.text.TextUtils;
26 |
27 | /**
28 | * 评论列表结构体。
29 | *
30 | * @author SINA
31 | * @since 2013-11-24
32 | */
33 | public class CommentList {
34 |
35 | /** 微博列表 */
36 | public ArrayList commentList;
37 | public String previous_cursor;
38 | public String next_cursor;
39 | public int total_number;
40 |
41 | public static CommentList parse(String jsonString) {
42 | if (TextUtils.isEmpty(jsonString)) {
43 | return null;
44 | }
45 |
46 | CommentList comments = new CommentList();
47 | try {
48 | JSONObject jsonObject = new JSONObject(jsonString);
49 | comments.previous_cursor = jsonObject.optString("previous_cursor", "0");
50 | comments.next_cursor = jsonObject.optString("next_cursor", "0");
51 | comments.total_number = jsonObject.optInt("total_number", 0);
52 |
53 | JSONArray jsonArray = jsonObject.optJSONArray("comments");
54 | if (jsonArray != null && jsonArray.length() > 0) {
55 | int length = jsonArray.length();
56 | comments.commentList = new ArrayList(length);
57 | for (int ix = 0; ix < length; ix++) {
58 | comments.commentList.add(Comment.parse(jsonArray.optJSONObject(ix)));
59 | }
60 | }
61 | } catch (JSONException e) {
62 | e.printStackTrace();
63 | }
64 |
65 | return comments;
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/WeiboSdk/src/main/java/com/sina/weibo/sdk/openapi/models/Coordinate.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2010-2013 The SINA WEIBO Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.sina.weibo.sdk.openapi.models;
18 |
19 | import org.json.JSONObject;
20 |
21 | /**
22 | * 该类用于解析JSONObject类型数据。
23 | *
24 | * @author SINA
25 | * @date 2014-03-03
26 | */
27 | public class Coordinate {
28 | public Double Longtitude;
29 | public Double Latitude;
30 |
31 | public static Coordinate parse(JSONObject jsonObject) {
32 | if (jsonObject == null) {
33 | return null;
34 | }
35 |
36 | Coordinate coordinate = new Coordinate();
37 | coordinate.Longtitude = jsonObject.optDouble("longitude");
38 | coordinate.Latitude = jsonObject.optDouble("latitude");
39 |
40 | return coordinate;
41 | }
42 | }
--------------------------------------------------------------------------------
/WeiboSdk/src/main/java/com/sina/weibo/sdk/openapi/models/ErrorInfo.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2010-2013 The SINA WEIBO Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.sina.weibo.sdk.openapi.models;
18 |
19 | import org.json.JSONException;
20 | import org.json.JSONObject;
21 |
22 | import android.text.TextUtils;
23 |
24 | /**
25 | * 错误信息结构体。
26 | *
27 | * @author SINA
28 | * @since 2013-11-24
29 | */
30 | public class ErrorInfo {
31 | public String error;
32 | public String error_code;
33 | public String request;
34 |
35 | public static ErrorInfo parse(String jsonString) {
36 | if (TextUtils.isEmpty(jsonString)) {
37 | return null;
38 | }
39 |
40 | ErrorInfo errorInfo = new ErrorInfo();
41 | try {
42 | JSONObject jsonObject = new JSONObject(jsonString);
43 | errorInfo.error = jsonObject.optString("error");
44 | errorInfo.error_code = jsonObject.optString("error_code");
45 | errorInfo.request = jsonObject.optString("request");
46 | } catch (JSONException e) {
47 | e.printStackTrace();
48 | }
49 | return errorInfo;
50 | }
51 |
52 | /* (non-Javadoc)
53 | * @see java.lang.Object#toString()
54 | */
55 | @Override
56 | public String toString() {
57 | return "error: " + error +
58 | ", error_code: " + error_code +
59 | ", request: " + request;
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/WeiboSdk/src/main/java/com/sina/weibo/sdk/openapi/models/Favorite.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2010-2013 The SINA WEIBO Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.sina.weibo.sdk.openapi.models;
18 |
19 | import java.util.ArrayList;
20 |
21 | import org.json.JSONArray;
22 | import org.json.JSONException;
23 | import org.json.JSONObject;
24 |
25 | /**
26 | * 我喜欢的微博信息结构体。
27 | *
28 | * @author SINA
29 | * @since 2013-11-24
30 | */
31 | public class Favorite {
32 |
33 | /** 我喜欢的微博信息 */
34 | public Status status;
35 | /** 我喜欢的微博的 Tag 信息 */
36 | public ArrayList tags;
37 | /** 创建我喜欢的微博信息的时间 */
38 | public String favorited_time;
39 |
40 | public static Favorite parse(String jsonString) {
41 | try {
42 | JSONObject object = new JSONObject(jsonString);
43 | return Favorite.parse(object);
44 | } catch (JSONException e) {
45 | e.printStackTrace();
46 | }
47 |
48 | return null;
49 | }
50 |
51 | public static Favorite parse(JSONObject jsonObject) {
52 | if (null == jsonObject) {
53 | return null;
54 | }
55 |
56 | Favorite favorite = new Favorite();
57 | favorite.status = Status.parse(jsonObject.optJSONObject("status"));
58 | favorite.favorited_time = jsonObject.optString("favorited_time");
59 |
60 | JSONArray jsonArray = jsonObject.optJSONArray("tags");
61 | if (jsonArray != null && jsonArray.length() > 0) {
62 | int length = jsonArray.length();
63 | favorite.tags = new ArrayList(length);
64 | for (int ix = 0; ix < length; ix++) {
65 | favorite.tags.add(Tag.parse(jsonArray.optJSONObject(ix)));
66 | }
67 | }
68 |
69 | return favorite;
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/WeiboSdk/src/main/java/com/sina/weibo/sdk/openapi/models/FavoriteList.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2010-2013 The SINA WEIBO Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.sina.weibo.sdk.openapi.models;
18 |
19 | import java.util.ArrayList;
20 |
21 | import org.json.JSONArray;
22 | import org.json.JSONException;
23 | import org.json.JSONObject;
24 |
25 | import android.text.TextUtils;
26 |
27 | /**
28 | * 我喜欢的微博信息列表结构体。
29 | *
30 | * @author SINA
31 | * @since 2013-11-24
32 | */
33 | public class FavoriteList {
34 |
35 | /** 微博列表 */
36 | public ArrayList favoriteList;
37 | public int total_number;
38 |
39 | public static FavoriteList parse(String jsonString) {
40 | if (TextUtils.isEmpty(jsonString)) {
41 | return null;
42 | }
43 |
44 | FavoriteList favorites = new FavoriteList();
45 | try {
46 | JSONObject jsonObject = new JSONObject(jsonString);
47 | favorites.total_number = jsonObject.optInt("total_number", 0);
48 |
49 | JSONArray jsonArray = jsonObject.optJSONArray("favorites");
50 | if (jsonArray != null && jsonArray.length() > 0) {
51 | int length = jsonArray.length();
52 | favorites.favoriteList = new ArrayList(length);
53 | for (int ix = 0; ix < length; ix++) {
54 | favorites.favoriteList.add(Favorite.parse(jsonArray.optJSONObject(ix)));
55 | }
56 | }
57 | } catch (JSONException e) {
58 | e.printStackTrace();
59 | }
60 |
61 | return favorites;
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/WeiboSdk/src/main/java/com/sina/weibo/sdk/openapi/models/Geo.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2010-2013 The SINA WEIBO Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.sina.weibo.sdk.openapi.models;
18 |
19 | import org.json.JSONException;
20 | import org.json.JSONObject;
21 |
22 | import android.text.TextUtils;
23 |
24 | /**
25 | * 地理信息结构体。
26 | *
27 | * @author SINA
28 | * @since 2013-11-24
29 | */
30 | public class Geo {
31 |
32 | /** 经度坐标 */
33 | public String longitude;
34 | /** 维度坐标 */
35 | public String latitude;
36 | /** 所在城市的城市代码 */
37 | public String city;
38 | /** 所在省份的省份代码 */
39 | public String province;
40 | /** 所在城市的城市名称 */
41 | public String city_name;
42 | /** 所在省份的省份名称 */
43 | public String province_name;
44 | /** 所在的实际地址,可以为空 */
45 | public String address;
46 | /** 地址的汉语拼音,不是所有情况都会返回该字段 */
47 | public String pinyin;
48 | /** 更多信息,不是所有情况都会返回该字段 */
49 | public String more;
50 |
51 | public static Geo parse(String jsonString) {
52 | if (TextUtils.isEmpty(jsonString)) {
53 | return null;
54 | }
55 |
56 | Geo geo = null;
57 | try {
58 | JSONObject jsonObject = new JSONObject(jsonString);
59 | geo = parse(jsonObject);
60 | } catch (JSONException e) {
61 | e.printStackTrace();
62 | }
63 |
64 | return geo;
65 | }
66 |
67 | public static Geo parse(JSONObject jsonObject) {
68 | if (null == jsonObject) {
69 | return null;
70 | }
71 |
72 | Geo geo = new Geo();
73 | geo.longitude = jsonObject.optString("longitude");
74 | geo.latitude = jsonObject.optString("latitude");
75 | geo.city = jsonObject.optString("city");
76 | geo.province = jsonObject.optString("province");
77 | geo.city_name = jsonObject.optString("city_name");
78 | geo.province_name = jsonObject.optString("province_name");
79 | geo.address = jsonObject.optString("address");
80 | geo.pinyin = jsonObject.optString("pinyin");
81 | geo.more = jsonObject.optString("more");
82 |
83 | return geo;
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/WeiboSdk/src/main/java/com/sina/weibo/sdk/openapi/models/GeoList.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2010-2013 The SINA WEIBO Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.sina.weibo.sdk.openapi.models;
18 |
19 | import java.util.ArrayList;
20 |
21 | import org.json.JSONArray;
22 | import org.json.JSONException;
23 | import org.json.JSONObject;
24 |
25 | import android.text.TextUtils;
26 |
27 | /**
28 | * 地理信息结构体。
29 | *
30 | * @author SINA
31 | * @since 2013-11-24
32 | */
33 | public class GeoList {
34 | public ArrayList Geos;
35 |
36 | public static GeoList parse(String jsonString) {
37 | if (TextUtils.isEmpty(jsonString)) {
38 | return null;
39 | }
40 |
41 | GeoList geoList = new GeoList();
42 | try {
43 | JSONObject jsonObject = new JSONObject(jsonString);
44 |
45 | JSONArray jsonArray = jsonObject.optJSONArray("geos");
46 | if (jsonArray != null && jsonArray.length() > 0) {
47 | int length = jsonArray.length();
48 | geoList.Geos = new ArrayList(length);
49 | for (int ix = 0; ix < length; ix++) {
50 | geoList.Geos.add(Geo.parse(jsonArray.optJSONObject(ix)));
51 | }
52 | }
53 |
54 | } catch (JSONException e) {
55 | e.printStackTrace();
56 | }
57 |
58 | return geoList;
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/WeiboSdk/src/main/java/com/sina/weibo/sdk/openapi/models/Group.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2010-2013 The SINA WEIBO Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.sina.weibo.sdk.openapi.models;
18 |
19 | import java.util.ArrayList;
20 |
21 | import org.json.JSONArray;
22 | import org.json.JSONObject;
23 |
24 | /**
25 | * 好友分组信息。
26 | *
27 | * @author SINA
28 | * @date 2013-11-27
29 | */
30 | public class Group {
31 | public static final String GROUP_ID_ALL = "1";
32 |
33 | /** 微博分组ID **/
34 | public String id;
35 | /** 微博分组字符串ID **/
36 | public String idStr;
37 | /** 分组名称 **/
38 | public String name;
39 | /** 类型(不公开分组等) **/
40 | public String mode;
41 | /** 是否公开 **/
42 | public int visible;
43 | /** 喜欢数 **/
44 | public int like_count;
45 | /** 分组成员数 **/
46 | public int member_count;
47 | /** 分组描述 **/
48 | public String description;
49 | /** 分组的Tag 信息 **/
50 | public ArrayList tags;
51 | /** 头像信息 **/
52 | public String profile_image_url;
53 | /** 分组所属用户信息 **/
54 | public User user;
55 | /** 分组创建时间 **/
56 | public String createAtTime;
57 |
58 | public static Group parse(JSONObject jsonObject) {
59 | if (null == jsonObject) {
60 | return null;
61 | }
62 |
63 | Group group = new Group();
64 | group.user = User.parse(jsonObject.optJSONObject("user"));
65 | group.id = jsonObject.optString("id");
66 | group.idStr = jsonObject.optString("idstr");
67 | group.name = jsonObject.optString("name");
68 | group.mode = jsonObject.optString("mode");
69 | group.visible = jsonObject.optInt("visible");
70 | group.like_count = jsonObject.optInt("like_count");
71 | group.member_count = jsonObject.optInt("member_count");
72 | group.description = jsonObject.optString("description");
73 | group.profile_image_url = jsonObject.optString("profile_image_url");
74 | group.createAtTime = jsonObject.optString("create_time", "");
75 |
76 | JSONArray jsonArray = jsonObject.optJSONArray("tags");
77 | if (jsonArray != null && jsonObject.length() > 0) {
78 | int length = jsonArray.length();
79 | group.tags = new ArrayList(length);
80 | for (int ix = 0; ix < length; ix++) {
81 | group.tags.add(Tag.parse(jsonArray.optJSONObject(ix)));
82 | }
83 | }
84 |
85 | return group;
86 | }
87 | }
88 |
--------------------------------------------------------------------------------
/WeiboSdk/src/main/java/com/sina/weibo/sdk/openapi/models/GroupList.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2010-2013 The SINA WEIBO Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.sina.weibo.sdk.openapi.models;
18 |
19 | import java.util.ArrayList;
20 |
21 | import org.json.JSONArray;
22 | import org.json.JSONException;
23 | import org.json.JSONObject;
24 |
25 | import android.text.TextUtils;
26 |
27 | /**
28 | * 好友分组列表。
29 | *
30 | * @author SINA
31 | * @since 2013-11-27
32 | */
33 | public class GroupList {
34 | /** 分组列表 **/
35 | public ArrayList groupList;
36 | /** 分组数目 **/
37 | public int total_number;
38 |
39 | public static GroupList parse(String jsonString) {
40 | if (TextUtils.isEmpty(jsonString)) {
41 | return null;
42 | }
43 |
44 | GroupList groupList = new GroupList();
45 | try {
46 | JSONObject jsonObject = new JSONObject(jsonString);
47 | groupList.total_number = jsonObject.optInt("total_number");
48 |
49 | JSONArray jsonArray = jsonObject.optJSONArray("lists");
50 | if (jsonArray != null && jsonArray.length() > 0) {
51 | int length = jsonArray.length();
52 | groupList.groupList = new ArrayList(length);
53 | for (int ix = 0; ix < length; ix++) {
54 | groupList.groupList.add(Group.parse(jsonArray.optJSONObject(ix)));
55 | }
56 | }
57 | } catch (JSONException e) {
58 | e.printStackTrace();
59 | }
60 |
61 | return groupList;
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/WeiboSdk/src/main/java/com/sina/weibo/sdk/openapi/models/GroupTag.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2010-2013 The SINA WEIBO Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.sina.weibo.sdk.openapi.models;
18 |
19 | import org.json.JSONObject;
20 |
21 | /**
22 | * 分组标签结构体。
23 | *
24 | * @author SINA
25 | * @since 2013-11-24
26 | */
27 | public class GroupTag {
28 | /** 分组的组号 */
29 | public String tag;
30 |
31 | public static GroupTag parse(JSONObject jsonObject) {
32 | if (jsonObject == null) {
33 | return null;
34 | }
35 |
36 | GroupTag tag = new GroupTag();
37 | // TODO: 结构不明?
38 | //tag.tag = jsonObject.optString("", "");
39 | return tag;
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/WeiboSdk/src/main/java/com/sina/weibo/sdk/openapi/models/IParseable.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2010-2013 The SINA WEIBO Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.sina.weibo.sdk.openapi.models;
18 |
19 | import org.json.JSONObject;
20 |
21 | public interface IParseable {
22 | public Object parse(String parseString);
23 | public Object parse(JSONObject jsonObject);
24 | }
25 |
--------------------------------------------------------------------------------
/WeiboSdk/src/main/java/com/sina/weibo/sdk/openapi/models/MusicInfo.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2010-2013 The SINA WEIBO Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.sina.weibo.sdk.openapi.models;
18 |
19 | import org.json.JSONObject;
20 |
21 | /**
22 | * 音乐结构体。
23 | *
24 | * @author SINA
25 | * @since 2013-11-22
26 | */
27 | public class MusicInfo {
28 |
29 | //public boolean result;
30 | public String author;
31 | public String title;
32 | public String album;
33 | public String playUrl;
34 |
35 | public static MusicInfo parser(String jsonString) {
36 | return null;
37 | }
38 |
39 | public static MusicInfo parse(JSONObject jsonObject) {
40 | if (null == jsonObject) {
41 | return null;
42 | }
43 |
44 | MusicInfo music = new MusicInfo();
45 | music.author = jsonObject.optString("author");
46 | music.title = jsonObject.optString("title");
47 | music.album = jsonObject.optString("album");
48 | music.playUrl = jsonObject.optString("playUrl");
49 |
50 | return music;
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/WeiboSdk/src/main/java/com/sina/weibo/sdk/openapi/models/OffsetGeo.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2010-2013 The SINA WEIBO Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.sina.weibo.sdk.openapi.models;
18 |
19 | import java.util.ArrayList;
20 |
21 | import org.json.JSONArray;
22 | import org.json.JSONException;
23 | import org.json.JSONObject;
24 |
25 | import android.text.TextUtils;
26 |
27 | /**
28 | * 地理位置纠正信息.
29 | *
30 | * @author SINA
31 | * @since 2013-12-4
32 | */
33 | public class OffsetGeo {
34 |
35 | public ArrayList Geos;
36 |
37 | public static OffsetGeo parse(String jsonString) {
38 | if (TextUtils.isEmpty(jsonString)) {
39 | return null;
40 | }
41 |
42 | OffsetGeo offsetGeo = new OffsetGeo();
43 | try {
44 | JSONObject jsonObject = new JSONObject(jsonString);
45 |
46 | JSONArray jsonArray = jsonObject.optJSONArray("geos");
47 | if (jsonArray != null && jsonArray.length() > 0) {
48 | int length = jsonArray.length();
49 | offsetGeo.Geos = new ArrayList(length);
50 | for (int ix = 0; ix < length; ix++) {
51 | offsetGeo.Geos.add(Coordinate.parse(jsonArray.optJSONObject(ix)));
52 | }
53 | }
54 |
55 | } catch (JSONException e) {
56 | e.printStackTrace();
57 | }
58 |
59 | return offsetGeo;
60 | }
61 | }
62 |
63 |
--------------------------------------------------------------------------------
/WeiboSdk/src/main/java/com/sina/weibo/sdk/openapi/models/PoiList.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2010-2013 The SINA WEIBO Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.sina.weibo.sdk.openapi.models;
18 |
19 | import java.util.ArrayList;
20 |
21 | import org.json.JSONArray;
22 | import org.json.JSONException;
23 | import org.json.JSONObject;
24 |
25 | import android.text.TextUtils;
26 |
27 | /**
28 | * 地理列表结构体。
29 | *
30 | * @author SINA
31 | * @since 2013-11-24
32 | */
33 | public class PoiList {
34 | public ArrayList pois;
35 | public String totalNumber;
36 |
37 | public static PoiList parse(String jsonString) {
38 | if (TextUtils.isEmpty(jsonString)) {
39 | return null;
40 | }
41 |
42 | PoiList poiList = new PoiList();
43 | try {
44 | JSONObject jsonObject = new JSONObject(jsonString);
45 |
46 | poiList.totalNumber = jsonObject.optString("total_number");
47 | JSONArray jsonArray = jsonObject.optJSONArray("geos");
48 | if (jsonArray != null && jsonArray.length() > 0) {
49 | int length = jsonArray.length();
50 | poiList.pois = new ArrayList(length);
51 | for (int ix = 0; ix < length; ix++) {
52 | poiList.pois.add(Poi.parse(jsonArray.optJSONObject(ix)));
53 | }
54 | }
55 |
56 | } catch (JSONException e) {
57 | e.printStackTrace();
58 | }
59 | return poiList;
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/WeiboSdk/src/main/java/com/sina/weibo/sdk/openapi/models/Privacy.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2010-2013 The SINA WEIBO Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.sina.weibo.sdk.openapi.models;
18 |
19 | public class Privacy {
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/WeiboSdk/src/main/java/com/sina/weibo/sdk/openapi/models/Remind.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2010-2013 The SINA WEIBO Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.sina.weibo.sdk.openapi.models;
18 |
19 | public class Remind {
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/WeiboSdk/src/main/java/com/sina/weibo/sdk/openapi/models/StatusList.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2010-2013 The SINA WEIBO Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.sina.weibo.sdk.openapi.models;
18 |
19 | import java.util.ArrayList;
20 |
21 | import org.json.JSONArray;
22 | import org.json.JSONException;
23 | import org.json.JSONObject;
24 |
25 | import android.text.TextUtils;
26 |
27 | /**
28 | * 微博列表结构。
29 | * @see 常见返回对象数据结构
30 | *
31 | * @author SINA
32 | * @since 2013-11-22
33 | */
34 | public class StatusList {
35 |
36 | /** 微博列表 */
37 | public ArrayList statusList;
38 | public Status statuses;
39 | public boolean hasvisible;
40 | public String previous_cursor;
41 | public String next_cursor;
42 | public int total_number;
43 | public Object[] advertises;
44 |
45 | public static StatusList parse(String jsonString) {
46 | if (TextUtils.isEmpty(jsonString)) {
47 | return null;
48 | }
49 |
50 | StatusList statuses = new StatusList();
51 | try {
52 | JSONObject jsonObject = new JSONObject(jsonString);
53 | statuses.hasvisible = jsonObject.optBoolean("hasvisible", false);
54 | statuses.previous_cursor = jsonObject.optString("previous_cursor", "0");
55 | statuses.next_cursor = jsonObject.optString("next_cursor", "0");
56 | statuses.total_number = jsonObject.optInt("total_number", 0);
57 |
58 | JSONArray jsonArray = jsonObject.optJSONArray("statuses");
59 | if (jsonArray != null && jsonArray.length() > 0) {
60 | int length = jsonArray.length();
61 | statuses.statusList = new ArrayList(length);
62 | for (int ix = 0; ix < length; ix++) {
63 | statuses.statusList.add(Status.parse(jsonArray.getJSONObject(ix)));
64 | }
65 | }
66 | } catch (JSONException e) {
67 | e.printStackTrace();
68 | }
69 |
70 | return statuses;
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/WeiboSdk/src/main/java/com/sina/weibo/sdk/openapi/models/Tag.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2010-2013 The SINA WEIBO Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.sina.weibo.sdk.openapi.models;
18 |
19 | import org.json.JSONObject;
20 |
21 | /**
22 | * 我喜欢的微博标签(Tag)结构体。
23 | *
24 | * @author SINA
25 | * @since 2013-11-24
26 | */
27 | public class Tag {
28 |
29 | /** type 取值,0:普通微博,1:私密微博,3:指定分组微博,4:密友微博 */
30 | public int id;
31 | /** 分组的组号 */
32 | public String tag;
33 |
34 | public static Tag parse(JSONObject jsonObject) {
35 | if (null == jsonObject) {
36 | return null;
37 | }
38 |
39 | Tag tag = new Tag();
40 | tag.id = jsonObject.optInt("id", 0);
41 | tag.tag = jsonObject.optString("tag", "");
42 |
43 | return tag;
44 | }
45 | }
--------------------------------------------------------------------------------
/WeiboSdk/src/main/java/com/sina/weibo/sdk/openapi/models/Visible.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2010-2013 The SINA WEIBO Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.sina.weibo.sdk.openapi.models;
18 |
19 | import org.json.JSONObject;
20 |
21 | /**
22 | * 微博可见性结构体。
23 | *
24 | * @author SINA
25 | * @since 2013-11-24
26 | */
27 | public class Visible {
28 |
29 | public static final int VISIBLE_NORMAL = 0;
30 | public static final int VISIBLE_PRIVACY = 1;
31 | public static final int VISIBLE_GROUPED = 2;
32 | public static final int VISIBLE_FRIEND = 3;
33 |
34 | /** type 取值,0:普通微博,1:私密微博,3:指定分组微博,4:密友微博 */
35 | public int type;
36 | /** 分组的组号 */
37 | public int list_id;
38 |
39 | public static Visible parse(JSONObject jsonObject) {
40 | if (null == jsonObject) {
41 | return null;
42 | }
43 |
44 | Visible visible = new Visible();
45 | visible.type = jsonObject.optInt("type", 0);
46 | visible.list_id = jsonObject.optInt("list_id", 0);
47 |
48 | return visible;
49 | }
50 | }
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/drawable-hdpi/ic_com_sina_weibo_sdk_button_blue_focused.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/WeiboSdk/src/main/res/drawable-hdpi/ic_com_sina_weibo_sdk_button_blue_focused.9.png
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/drawable-hdpi/ic_com_sina_weibo_sdk_button_blue_normal.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/WeiboSdk/src/main/res/drawable-hdpi/ic_com_sina_weibo_sdk_button_blue_normal.9.png
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/drawable-hdpi/ic_com_sina_weibo_sdk_button_blue_pressed.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/WeiboSdk/src/main/res/drawable-hdpi/ic_com_sina_weibo_sdk_button_blue_pressed.9.png
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/drawable-hdpi/ic_com_sina_weibo_sdk_button_grey_focused.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/WeiboSdk/src/main/res/drawable-hdpi/ic_com_sina_weibo_sdk_button_grey_focused.9.png
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/drawable-hdpi/ic_com_sina_weibo_sdk_button_grey_normal.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/WeiboSdk/src/main/res/drawable-hdpi/ic_com_sina_weibo_sdk_button_grey_normal.9.png
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/drawable-hdpi/ic_com_sina_weibo_sdk_button_grey_pressed.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/WeiboSdk/src/main/res/drawable-hdpi/ic_com_sina_weibo_sdk_button_grey_pressed.9.png
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/drawable-hdpi/ic_com_sina_weibo_sdk_login_button_with_frame_logo_focused.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/WeiboSdk/src/main/res/drawable-hdpi/ic_com_sina_weibo_sdk_login_button_with_frame_logo_focused.png
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/drawable-hdpi/ic_com_sina_weibo_sdk_login_button_with_frame_logo_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/WeiboSdk/src/main/res/drawable-hdpi/ic_com_sina_weibo_sdk_login_button_with_frame_logo_normal.png
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/drawable-hdpi/ic_com_sina_weibo_sdk_login_button_with_frame_logo_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/WeiboSdk/src/main/res/drawable-hdpi/ic_com_sina_weibo_sdk_login_button_with_frame_logo_pressed.png
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/drawable-hdpi/ic_com_sina_weibo_sdk_login_with_account_text_focused.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/WeiboSdk/src/main/res/drawable-hdpi/ic_com_sina_weibo_sdk_login_with_account_text_focused.png
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/drawable-hdpi/ic_com_sina_weibo_sdk_login_with_account_text_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/WeiboSdk/src/main/res/drawable-hdpi/ic_com_sina_weibo_sdk_login_with_account_text_normal.png
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/drawable-hdpi/ic_com_sina_weibo_sdk_login_with_account_text_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/WeiboSdk/src/main/res/drawable-hdpi/ic_com_sina_weibo_sdk_login_with_account_text_pressed.png
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/drawable-hdpi/ic_com_sina_weibo_sdk_login_with_text.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/WeiboSdk/src/main/res/drawable-hdpi/ic_com_sina_weibo_sdk_login_with_text.png
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/drawable-hdpi/ic_com_sina_weibo_sdk_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/WeiboSdk/src/main/res/drawable-hdpi/ic_com_sina_weibo_sdk_logo.png
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/drawable-ldpi/ic_com_sina_weibo_sdk_login_button_with_frame_logo_focused.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/WeiboSdk/src/main/res/drawable-ldpi/ic_com_sina_weibo_sdk_login_button_with_frame_logo_focused.png
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/drawable-ldpi/ic_com_sina_weibo_sdk_login_button_with_frame_logo_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/WeiboSdk/src/main/res/drawable-ldpi/ic_com_sina_weibo_sdk_login_button_with_frame_logo_normal.png
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/drawable-ldpi/ic_com_sina_weibo_sdk_login_button_with_frame_logo_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/WeiboSdk/src/main/res/drawable-ldpi/ic_com_sina_weibo_sdk_login_button_with_frame_logo_pressed.png
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/drawable-ldpi/ic_com_sina_weibo_sdk_login_with_account_text_focused.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/WeiboSdk/src/main/res/drawable-ldpi/ic_com_sina_weibo_sdk_login_with_account_text_focused.png
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/drawable-ldpi/ic_com_sina_weibo_sdk_login_with_account_text_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/WeiboSdk/src/main/res/drawable-ldpi/ic_com_sina_weibo_sdk_login_with_account_text_normal.png
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/drawable-ldpi/ic_com_sina_weibo_sdk_login_with_account_text_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/WeiboSdk/src/main/res/drawable-ldpi/ic_com_sina_weibo_sdk_login_with_account_text_pressed.png
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/drawable-ldpi/ic_com_sina_weibo_sdk_login_with_text.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/WeiboSdk/src/main/res/drawable-ldpi/ic_com_sina_weibo_sdk_login_with_text.png
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/drawable-ldpi/ic_com_sina_weibo_sdk_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/WeiboSdk/src/main/res/drawable-ldpi/ic_com_sina_weibo_sdk_logo.png
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/drawable-mdpi/ic_com_sina_weibo_sdk_button_blue_focused.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/WeiboSdk/src/main/res/drawable-mdpi/ic_com_sina_weibo_sdk_button_blue_focused.9.png
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/drawable-mdpi/ic_com_sina_weibo_sdk_button_blue_normal.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/WeiboSdk/src/main/res/drawable-mdpi/ic_com_sina_weibo_sdk_button_blue_normal.9.png
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/drawable-mdpi/ic_com_sina_weibo_sdk_button_blue_pressed.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/WeiboSdk/src/main/res/drawable-mdpi/ic_com_sina_weibo_sdk_button_blue_pressed.9.png
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/drawable-mdpi/ic_com_sina_weibo_sdk_button_grey_focused.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/WeiboSdk/src/main/res/drawable-mdpi/ic_com_sina_weibo_sdk_button_grey_focused.9.png
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/drawable-mdpi/ic_com_sina_weibo_sdk_button_grey_normal.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/WeiboSdk/src/main/res/drawable-mdpi/ic_com_sina_weibo_sdk_button_grey_normal.9.png
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/drawable-mdpi/ic_com_sina_weibo_sdk_button_grey_pressed.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/WeiboSdk/src/main/res/drawable-mdpi/ic_com_sina_weibo_sdk_button_grey_pressed.9.png
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/drawable-mdpi/ic_com_sina_weibo_sdk_login_button_with_frame_logo_focused.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/WeiboSdk/src/main/res/drawable-mdpi/ic_com_sina_weibo_sdk_login_button_with_frame_logo_focused.png
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/drawable-mdpi/ic_com_sina_weibo_sdk_login_button_with_frame_logo_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/WeiboSdk/src/main/res/drawable-mdpi/ic_com_sina_weibo_sdk_login_button_with_frame_logo_normal.png
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/drawable-mdpi/ic_com_sina_weibo_sdk_login_button_with_frame_logo_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/WeiboSdk/src/main/res/drawable-mdpi/ic_com_sina_weibo_sdk_login_button_with_frame_logo_pressed.png
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/drawable-mdpi/ic_com_sina_weibo_sdk_login_with_account_text_focused.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/WeiboSdk/src/main/res/drawable-mdpi/ic_com_sina_weibo_sdk_login_with_account_text_focused.png
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/drawable-mdpi/ic_com_sina_weibo_sdk_login_with_account_text_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/WeiboSdk/src/main/res/drawable-mdpi/ic_com_sina_weibo_sdk_login_with_account_text_normal.png
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/drawable-mdpi/ic_com_sina_weibo_sdk_login_with_account_text_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/WeiboSdk/src/main/res/drawable-mdpi/ic_com_sina_weibo_sdk_login_with_account_text_pressed.png
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/drawable-mdpi/ic_com_sina_weibo_sdk_login_with_text.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/WeiboSdk/src/main/res/drawable-mdpi/ic_com_sina_weibo_sdk_login_with_text.png
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/drawable-mdpi/ic_com_sina_weibo_sdk_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/WeiboSdk/src/main/res/drawable-mdpi/ic_com_sina_weibo_sdk_logo.png
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/drawable-xhdpi/ic_com_sina_weibo_sdk_button_blue_focused.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/WeiboSdk/src/main/res/drawable-xhdpi/ic_com_sina_weibo_sdk_button_blue_focused.9.png
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/drawable-xhdpi/ic_com_sina_weibo_sdk_button_blue_normal.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/WeiboSdk/src/main/res/drawable-xhdpi/ic_com_sina_weibo_sdk_button_blue_normal.9.png
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/drawable-xhdpi/ic_com_sina_weibo_sdk_button_blue_pressed.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/WeiboSdk/src/main/res/drawable-xhdpi/ic_com_sina_weibo_sdk_button_blue_pressed.9.png
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/drawable-xhdpi/ic_com_sina_weibo_sdk_button_grey_focused.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/WeiboSdk/src/main/res/drawable-xhdpi/ic_com_sina_weibo_sdk_button_grey_focused.9.png
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/drawable-xhdpi/ic_com_sina_weibo_sdk_button_grey_normal.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/WeiboSdk/src/main/res/drawable-xhdpi/ic_com_sina_weibo_sdk_button_grey_normal.9.png
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/drawable-xhdpi/ic_com_sina_weibo_sdk_button_grey_pressed.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/WeiboSdk/src/main/res/drawable-xhdpi/ic_com_sina_weibo_sdk_button_grey_pressed.9.png
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/drawable-xhdpi/ic_com_sina_weibo_sdk_login_button_with_frame_logo_focused.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/WeiboSdk/src/main/res/drawable-xhdpi/ic_com_sina_weibo_sdk_login_button_with_frame_logo_focused.png
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/drawable-xhdpi/ic_com_sina_weibo_sdk_login_button_with_frame_logo_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/WeiboSdk/src/main/res/drawable-xhdpi/ic_com_sina_weibo_sdk_login_button_with_frame_logo_normal.png
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/drawable-xhdpi/ic_com_sina_weibo_sdk_login_button_with_frame_logo_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/WeiboSdk/src/main/res/drawable-xhdpi/ic_com_sina_weibo_sdk_login_button_with_frame_logo_pressed.png
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/drawable-xhdpi/ic_com_sina_weibo_sdk_login_with_account_text_focused.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/WeiboSdk/src/main/res/drawable-xhdpi/ic_com_sina_weibo_sdk_login_with_account_text_focused.png
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/drawable-xhdpi/ic_com_sina_weibo_sdk_login_with_account_text_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/WeiboSdk/src/main/res/drawable-xhdpi/ic_com_sina_weibo_sdk_login_with_account_text_normal.png
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/drawable-xhdpi/ic_com_sina_weibo_sdk_login_with_account_text_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/WeiboSdk/src/main/res/drawable-xhdpi/ic_com_sina_weibo_sdk_login_with_account_text_pressed.png
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/drawable-xhdpi/ic_com_sina_weibo_sdk_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/WeiboSdk/src/main/res/drawable-xhdpi/ic_com_sina_weibo_sdk_logo.png
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/drawable-xxhdpi/ic_com_sina_weibo_sdk_login_button_with_frame_logo_focused.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/WeiboSdk/src/main/res/drawable-xxhdpi/ic_com_sina_weibo_sdk_login_button_with_frame_logo_focused.png
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/drawable-xxhdpi/ic_com_sina_weibo_sdk_login_button_with_frame_logo_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/WeiboSdk/src/main/res/drawable-xxhdpi/ic_com_sina_weibo_sdk_login_button_with_frame_logo_normal.png
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/drawable-xxhdpi/ic_com_sina_weibo_sdk_login_button_with_frame_logo_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/WeiboSdk/src/main/res/drawable-xxhdpi/ic_com_sina_weibo_sdk_login_button_with_frame_logo_pressed.png
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/drawable-xxhdpi/ic_com_sina_weibo_sdk_login_with_account_text_focused.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/WeiboSdk/src/main/res/drawable-xxhdpi/ic_com_sina_weibo_sdk_login_with_account_text_focused.png
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/drawable-xxhdpi/ic_com_sina_weibo_sdk_login_with_account_text_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/WeiboSdk/src/main/res/drawable-xxhdpi/ic_com_sina_weibo_sdk_login_with_account_text_normal.png
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/drawable-xxhdpi/ic_com_sina_weibo_sdk_login_with_account_text_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/WeiboSdk/src/main/res/drawable-xxhdpi/ic_com_sina_weibo_sdk_login_with_account_text_pressed.png
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/drawable/com_sina_weibo_sdk_button_blue.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
20 |
25 |
30 |
34 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/drawable/com_sina_weibo_sdk_button_grey.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
21 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/drawable/com_sina_weibo_sdk_login_button_with_account_text.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
21 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/drawable/com_sina_weibo_sdk_login_button_with_frame_logo.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
21 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/drawable/com_sina_weibo_sdk_login_button_with_original_logo.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
20 |
22 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/values-en/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 | Login with Weibo
20 | Login
21 | Logout
22 |
23 |
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/values-large-long/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/values-large/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/values-normal-notlong/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/values-v11/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
23 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/values-v14/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
24 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/values-zh-rTW/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 | 用微博登錄
20 | 登錄
21 | 註銷
22 |
23 |
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
23 | 16dp
24 | 16dp
25 |
--------------------------------------------------------------------------------
/WeiboSdk/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 | 用微博登录
20 | 登录
21 | 注销
22 |
23 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/app/app-release.apk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/app/app-release.apk
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 23
5 | buildToolsVersion "23.0.0"
6 |
7 | defaultConfig {
8 | applicationId "me.pkhope.jianwei"
9 | minSdkVersion 14
10 | targetSdkVersion 23
11 | versionCode 1
12 | versionName "0.1.0"
13 | }
14 | buildTypes {
15 | release {
16 | minifyEnabled false
17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18 | }
19 | }
20 | }
21 |
22 | dependencies {
23 | compile fileTree(include: ['*.jar'], dir: 'libs')
24 | testCompile 'junit:junit:4.12'
25 | compile 'com.android.support:appcompat-v7:23.2.1'
26 | compile 'com.android.support:design:23.2.1'
27 | compile project(':WeiboSdk')
28 | compile 'com.ashokvarma.android:bottom-navigation-bar:1.2.2'
29 | compile 'com.github.bumptech.glide:glide:3.6.1'
30 | compile 'com.squareup.picasso:picasso:2.5.1'
31 | compile 'de.hdodenhof:circleimageview:2.0.0'
32 | compile 'com.nineoldandroids:library:2.4.0'
33 | compile 'me.iwf.photopicker:PhotoPicker:0.8.1@aar'
34 | compile 'com.github.chrisbanes:PhotoView:1.2.6'
35 | }
36 |
--------------------------------------------------------------------------------
/app/jianwei.apk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/app/jianwei.apk
--------------------------------------------------------------------------------
/app/libs/avoscloud-sdk-v3.13.7.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/app/libs/avoscloud-sdk-v3.13.7.jar
--------------------------------------------------------------------------------
/app/libs/avoscloud-statistics-v3.13.7.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/app/libs/avoscloud-statistics-v3.13.7.jar
--------------------------------------------------------------------------------
/app/libs/fastjson.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/app/libs/fastjson.jar
--------------------------------------------------------------------------------
/app/libs/httpmime-4.2.4.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/app/libs/httpmime-4.2.4.jar
--------------------------------------------------------------------------------
/app/libs/okhttp-2.6.0-leancloud.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/app/libs/okhttp-2.6.0-leancloud.jar
--------------------------------------------------------------------------------
/app/libs/okio-1.6.0-leancloud.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/app/libs/okio-1.6.0-leancloud.jar
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in E:\Android\sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/me/pkhope/jianwei/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package me.pkhope.jianwei;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
73 |
74 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
--------------------------------------------------------------------------------
/app/src/main/java/me/pkhope/jianwei/API/MyCommentsAPI.java:
--------------------------------------------------------------------------------
1 | package me.pkhope.jianwei.api;
2 |
3 | import android.content.Context;
4 |
5 | import com.sina.weibo.sdk.auth.Oauth2AccessToken;
6 | import com.sina.weibo.sdk.net.RequestListener;
7 | import com.sina.weibo.sdk.openapi.CommentsAPI;
8 |
9 | /**
10 | * Created by pkhope on 2016/6/11.
11 | */
12 | public class MyCommentsAPI {
13 |
14 | private CommentsAPI commentsAPI;
15 |
16 | public MyCommentsAPI(Context context, String appKey, Oauth2AccessToken token){
17 | commentsAPI = new CommentsAPI(context,appKey,token);
18 | }
19 |
20 | public void toME(int page, int count, RequestListener listener){
21 | commentsAPI.toME(0,0,count,page,0,0,listener);
22 | }
23 |
24 | public void byME(int page, int count, RequestListener listener){
25 | commentsAPI.byME(0,0,count,page,0,listener);
26 | }
27 |
28 | public void mentions(int page, int count, RequestListener listener){
29 | commentsAPI.mentions(0,0,count,page,0,0,listener);
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/app/src/main/java/me/pkhope/jianwei/API/MyStatusesAPI.java:
--------------------------------------------------------------------------------
1 | package me.pkhope.jianwei.api;
2 |
3 | import android.content.Context;
4 |
5 | import com.sina.weibo.sdk.auth.Oauth2AccessToken;
6 | import com.sina.weibo.sdk.net.RequestListener;
7 | import com.sina.weibo.sdk.openapi.StatusesAPI;
8 |
9 | /**
10 | * Created by pkhope on 2016/6/8.
11 | */
12 | public class MyStatusesAPI {
13 |
14 | private StatusesAPI statusesAPI;
15 |
16 | public MyStatusesAPI(Context context, String appKey, Oauth2AccessToken token){
17 | statusesAPI = new StatusesAPI(context,appKey,token);
18 | }
19 |
20 | public void friendsTimeline(int page, int count, RequestListener listener){
21 | statusesAPI.friendsTimeline(0, 0, count, page, false, 0, false,listener);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/app/src/main/java/me/pkhope/jianwei/App.java:
--------------------------------------------------------------------------------
1 | package me.pkhope.jianwei;
2 |
3 | import android.app.Application;
4 |
5 | import com.avos.avoscloud.AVOSCloud;
6 |
7 | import me.pkhope.jianwei.api.WeiboAPI;
8 |
9 | /**
10 | * Created by pkhope on 2016/6/12.
11 | */
12 | public class App extends Application {
13 |
14 | private static WeiboAPI weiboAPI = null;
15 |
16 | @Override
17 | public void onCreate() {
18 | super.onCreate();
19 |
20 | AVOSCloud.initialize(this, "YkRIg5nxMoflYSTb9sQMVfaq-gzGzoHsz", "6pbfFmJ1IK0gxc3aN2iT72UE");
21 |
22 | }
23 |
24 | public static void setWeiboAPI(WeiboAPI api){
25 | weiboAPI = api;
26 | }
27 |
28 | public static WeiboAPI getWeiboAPI(){
29 | return weiboAPI;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/app/src/main/java/me/pkhope/jianwei/Constants.java:
--------------------------------------------------------------------------------
1 | package me.pkhope.jianwei;
2 |
3 | import android.text.TextUtils;
4 |
5 | /**
6 | * Created by pkhope on 2016/6/3.
7 | */
8 | public interface Constants {
9 |
10 | public static final String APP_KEY = "2822669109";
11 |
12 | public static final String REDIRECT_URL = "https://api.weibo.com/oauth2/default.html";
13 |
14 | public static final String SCOPE = "";
15 |
16 | public static final int PAGE_COUNT = 20;
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/app/src/main/java/me/pkhope/jianwei/interfaces/Identifier.java:
--------------------------------------------------------------------------------
1 | package me.pkhope.jianwei.interfaces;
2 |
3 | /**
4 | * Created by pkhope on 2016/6/19.
5 | */
6 | public interface Identifier {
7 |
8 | public String getIdentifier();
9 |
10 | }
11 |
--------------------------------------------------------------------------------
/app/src/main/java/me/pkhope/jianwei/models/UserList.java:
--------------------------------------------------------------------------------
1 | package me.pkhope.jianwei.models;
2 |
3 | import android.text.TextUtils;
4 |
5 | import com.sina.weibo.sdk.openapi.models.User;
6 |
7 | import org.json.JSONArray;
8 | import org.json.JSONException;
9 | import org.json.JSONObject;
10 |
11 | import java.util.ArrayList;
12 | import java.util.List;
13 |
14 | /**
15 | * Created by thinkpad on 2016/6/12.
16 | */
17 | public class UserList {
18 |
19 | public ArrayList userList;
20 | public boolean hasvisible;
21 | public String previous_cursor;
22 | public String next_cursor;
23 | public int total_number;
24 | public Object[] advertises;
25 |
26 | public static UserList parse(String jsonString){
27 | if (TextUtils.isEmpty(jsonString)) {
28 | return null;
29 | }
30 |
31 | UserList users = new UserList();
32 | try {
33 | JSONObject jsonObject = new JSONObject(jsonString);
34 | users.hasvisible = jsonObject.optBoolean("hasvisible", false);
35 | users.previous_cursor = jsonObject.optString("previous_cursor", "0");
36 | users.next_cursor = jsonObject.optString("next_cursor", "0");
37 | users.total_number = jsonObject.optInt("total_number", 0);
38 |
39 | JSONArray jsonArray = jsonObject.optJSONArray("users");
40 | int length = jsonArray.length();
41 | if (jsonArray != null && length > 0){
42 |
43 | users.userList = new ArrayList<>();
44 | for (int ix = 0; ix < length; ix++){
45 | users.userList.add(User.parse(jsonArray.getJSONObject(ix)));
46 | }
47 | }
48 | } catch (JSONException e){
49 | e.printStackTrace();
50 | }
51 |
52 | return users;
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/app/src/main/java/me/pkhope/jianwei/ui/activity/AboutActivity.java:
--------------------------------------------------------------------------------
1 | package me.pkhope.jianwei.ui.activity;
2 |
3 | import android.os.Bundle;
4 | import android.support.annotation.Nullable;
5 | import android.support.v7.app.AppCompatActivity;
6 | import android.support.v7.widget.Toolbar;
7 | import android.view.View;
8 |
9 | import me.pkhope.jianwei.R;
10 |
11 | /**
12 | * Created by pkhope on 2016/6/22.
13 | */
14 | public class AboutActivity extends AppCompatActivity{
15 |
16 | private Toolbar toolbar;
17 |
18 | @Override
19 | protected void onCreate(@Nullable Bundle savedInstanceState) {
20 | super.onCreate(savedInstanceState);
21 | setContentView(R.layout.activity_about);
22 |
23 | toolbar = (Toolbar)findViewById(R.id.toolbar);
24 | setSupportActionBar(toolbar);
25 | toolbar.setTitle(getString(R.string.app_name));
26 | getSupportActionBar().setDisplayHomeAsUpEnabled(true);
27 | toolbar.setNavigationOnClickListener(new View.OnClickListener() {
28 | @Override
29 | public void onClick(View v) {
30 | onBackPressed();
31 | }
32 | });
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/app/src/main/java/me/pkhope/jianwei/ui/activity/FeedbackActivity.java:
--------------------------------------------------------------------------------
1 | package me.pkhope.jianwei.ui.activity;
2 |
3 | import android.os.Bundle;
4 | import android.support.annotation.Nullable;
5 | import android.support.v7.app.AppCompatActivity;
6 | import android.support.v7.widget.Toolbar;
7 | import android.view.View;
8 | import android.widget.EditText;
9 | import android.widget.ImageView;
10 |
11 | import com.avos.avoscloud.AVObject;
12 |
13 | import me.pkhope.jianwei.R;
14 |
15 | /**
16 | * Created by pkhope on 2016/6/22.
17 | */
18 | public class FeedbackActivity extends AppCompatActivity {
19 |
20 | private Toolbar toolbar;
21 | private EditText feedbackEt;
22 |
23 | @Override
24 | protected void onCreate(@Nullable Bundle savedInstanceState) {
25 | super.onCreate(savedInstanceState);
26 |
27 | setContentView(R.layout.activity_feedback);
28 |
29 | toolbar = (Toolbar)findViewById(R.id.toolbar);
30 | setSupportActionBar(toolbar);
31 | toolbar.setTitle(getString(R.string.app_name));
32 | getSupportActionBar().setDisplayHomeAsUpEnabled(true);
33 | toolbar.setNavigationOnClickListener(new View.OnClickListener() {
34 | @Override
35 | public void onClick(View v) {
36 | onBackPressed();
37 | }
38 | });
39 |
40 | feedbackEt = (EditText) findViewById(R.id.feedback_et);
41 | ImageView send = (ImageView) findViewById(R.id.send);
42 | send.setOnClickListener(new View.OnClickListener() {
43 | @Override
44 | public void onClick(View v) {
45 | AVObject feedBack = new AVObject("feedback");
46 | feedBack.put("content",feedbackEt.getText());
47 | feedBack.saveInBackground();
48 | finish();
49 | }
50 | });
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/app/src/main/java/me/pkhope/jianwei/ui/activity/ImageDetailActivity.java:
--------------------------------------------------------------------------------
1 | package me.pkhope.jianwei.ui.activity;
2 |
3 | import android.content.Intent;
4 | import android.os.Bundle;
5 | import android.support.annotation.Nullable;
6 | import android.support.v4.view.ViewPager;
7 | import android.support.v7.app.AppCompatActivity;
8 | import android.view.View;
9 | import android.view.WindowManager;
10 | import android.widget.TextView;
11 |
12 | import java.util.List;
13 |
14 | import me.pkhope.jianwei.R;
15 | import me.pkhope.jianwei.ui.adapter.ViewPagerAdapter;
16 | import me.pkhope.jianwei.widget.HackyViewPager;
17 | import uk.co.senab.photoview.PhotoViewAttacher;
18 |
19 | /**
20 | * Created by pkhope on 2016/6/17.
21 | */
22 | public class ImageDetailActivity extends AppCompatActivity implements PhotoViewAttacher.OnPhotoTapListener{
23 |
24 | private TextView numTv;
25 | private HackyViewPager viewPager;
26 |
27 | @Override
28 | protected void onCreate(@Nullable Bundle savedInstanceState) {
29 | super.onCreate(savedInstanceState);
30 |
31 | setContentView(R.layout.activity_image_detail);
32 |
33 | getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
34 | WindowManager.LayoutParams.FLAG_FULLSCREEN);
35 |
36 | Intent intent = getIntent();
37 | final List images = intent.getStringArrayListExtra("images");
38 | ViewPagerAdapter adapter = new ViewPagerAdapter(this,images);
39 | adapter.setPhotoTapListener(this);
40 | numTv = (TextView) findViewById(R.id.num_tv);
41 | viewPager = (HackyViewPager) findViewById(R.id.view_pager);
42 | viewPager.setAdapter(adapter);
43 | viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
44 | @Override
45 | public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
46 |
47 | }
48 |
49 | @Override
50 | public void onPageSelected(int position) {
51 | numTv.setText((position+1) + "/" + images.size());
52 | }
53 |
54 | @Override
55 | public void onPageScrollStateChanged(int state) {
56 |
57 | }
58 | });
59 |
60 | if (images.size() == 1){
61 | numTv.setVisibility(View.GONE);
62 | } else {
63 | numTv.setText(1 + "/" + images.size());
64 | }
65 | }
66 |
67 | @Override
68 | public void onPhotoTap(View view, float v, float v1) {
69 | finish();
70 | }
71 |
72 | @Override
73 | public void onOutsidePhotoTap() {
74 | finish();
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/app/src/main/java/me/pkhope/jianwei/ui/activity/ReplyActivity.java:
--------------------------------------------------------------------------------
1 | package me.pkhope.jianwei.ui.activity;
2 |
3 | import android.content.Intent;
4 | import android.os.Bundle;
5 | import android.support.annotation.Nullable;
6 | import android.support.v7.app.AppCompatActivity;
7 | import android.support.v7.widget.Toolbar;
8 | import android.view.Menu;
9 | import android.view.MenuItem;
10 | import android.view.View;
11 | import android.widget.EditText;
12 | import android.widget.ImageButton;
13 | import android.widget.ImageView;
14 |
15 | import com.sina.weibo.sdk.exception.WeiboException;
16 | import com.sina.weibo.sdk.net.RequestListener;
17 |
18 | import me.pkhope.jianwei.PostService;
19 | import me.pkhope.jianwei.R;
20 |
21 | /**
22 | * Created by pkhope on 2016/6/16.
23 | */
24 | public class ReplyActivity extends AppCompatActivity {
25 |
26 | private Toolbar toolbar;
27 | private EditText contentEt;
28 |
29 | private String operation;
30 | private long id;
31 |
32 | @Override
33 | protected void onCreate(@Nullable Bundle savedInstanceState) {
34 | super.onCreate(savedInstanceState);
35 |
36 | setContentView(R.layout.activity_reply);
37 |
38 | toolbar = (Toolbar)findViewById(R.id.toolbar);
39 | setSupportActionBar(toolbar);
40 | toolbar.setTitle(getString(R.string.app_name));
41 | getSupportActionBar().setDisplayHomeAsUpEnabled(true);
42 | toolbar.setNavigationOnClickListener(new View.OnClickListener() {
43 | @Override
44 | public void onClick(View v) {
45 | onBackPressed();
46 | }
47 | });
48 |
49 | contentEt = (EditText) findViewById(R.id.content);
50 |
51 | Intent intent = getIntent();
52 | operation = intent.getStringExtra("operation");
53 | id = intent.getLongExtra("id",0);
54 | }
55 |
56 | @Override
57 | public boolean onCreateOptionsMenu(Menu menu) {
58 | getMenuInflater().inflate(R.menu.menu_send, menu);
59 | return true;
60 | }
61 |
62 | @Override
63 | public boolean onOptionsItemSelected(MenuItem item) {
64 |
65 | switch(item.getItemId()) {
66 | case R.id.action_send: {
67 | Intent intent = new Intent(ReplyActivity.this, PostService.class);
68 | intent.putExtra("operation",operation);
69 | intent.putExtra("content",contentEt.getText().toString());
70 | intent.putExtra("id",id);
71 | startService(intent);
72 | finish();
73 | break;
74 | }
75 | }
76 | return super.onOptionsItemSelected(item);
77 | }
78 |
79 | }
80 |
--------------------------------------------------------------------------------
/app/src/main/java/me/pkhope/jianwei/ui/activity/SettingActivity.java:
--------------------------------------------------------------------------------
1 | package me.pkhope.jianwei.ui.activity;
2 |
3 | import android.content.Intent;
4 | import android.content.SharedPreferences;
5 | import android.os.Bundle;
6 | import android.preference.PreferenceManager;
7 | import android.support.annotation.Nullable;
8 | import android.support.v7.app.AppCompatActivity;
9 | import android.support.v7.widget.Toolbar;
10 | import android.view.View;
11 | import android.widget.CompoundButton;
12 | import android.widget.Switch;
13 |
14 | import me.pkhope.jianwei.R;
15 | import me.pkhope.jianwei.utils.AccessTokenPreference;
16 |
17 | /**
18 | * Created by pkhope on 2016/6/21.
19 | */
20 | public class SettingActivity extends AppCompatActivity implements View.OnClickListener{
21 |
22 | private Toolbar toolbar;
23 |
24 | @Override
25 | protected void onCreate(@Nullable Bundle savedInstanceState) {
26 | super.onCreate(savedInstanceState);
27 | setContentView(R.layout.activity_setting);
28 |
29 | toolbar = (Toolbar)findViewById(R.id.toolbar);
30 | setSupportActionBar(toolbar);
31 | toolbar.setTitle(getString(R.string.app_name));
32 | getSupportActionBar().setDisplayHomeAsUpEnabled(true);
33 | toolbar.setNavigationOnClickListener(new View.OnClickListener() {
34 | @Override
35 | public void onClick(View v) {
36 | onBackPressed();
37 | }
38 | });
39 |
40 | final SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);
41 | boolean checked = sp.getBoolean("original",false);
42 | Switch switcher = (Switch) findViewById(R.id.swith);
43 | switcher.setChecked(checked);
44 |
45 | switcher.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
46 | @Override
47 | public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
48 | SharedPreferences.Editor editor = sp.edit();
49 | editor.putBoolean("original",isChecked);
50 | editor.commit();
51 | }
52 | });
53 |
54 | View feedback = findViewById(R.id.ll_feedback);
55 | feedback.setOnClickListener(this);
56 | View about = findViewById(R.id.ll_about);
57 | about.setOnClickListener(this);
58 | View exit = findViewById(R.id.ll_exit);
59 | exit.setOnClickListener(this);
60 | }
61 |
62 | @Override
63 | public void onClick(View v) {
64 | switch (v.getId()){
65 | case R.id.ll_about: {
66 | Intent intent = new Intent(SettingActivity.this, AboutActivity.class);
67 | startActivity(intent);
68 | break;
69 | }
70 | case R.id.ll_feedback: {
71 | Intent intent = new Intent(SettingActivity.this, FeedbackActivity.class);
72 | startActivity(intent);
73 | break;
74 | }
75 | case R.id.ll_exit: {
76 | AccessTokenPreference.clear(this);
77 | break;
78 | }
79 | }
80 | }
81 | }
82 |
83 |
--------------------------------------------------------------------------------
/app/src/main/java/me/pkhope/jianwei/ui/activity/WebActivity.java:
--------------------------------------------------------------------------------
1 | package me.pkhope.jianwei.ui.activity;
2 |
3 | import android.content.Intent;
4 | import android.os.Bundle;
5 | import android.support.annotation.Nullable;
6 | import android.support.v7.app.AppCompatActivity;
7 | import android.support.v7.widget.Toolbar;
8 | import android.view.View;
9 | import android.webkit.WebView;
10 | import android.webkit.WebViewClient;
11 |
12 | import me.pkhope.jianwei.R;
13 |
14 | /**
15 | * Created by pkhope on 2016/6/18.
16 | */
17 | public class WebActivity extends AppCompatActivity{
18 |
19 | private Toolbar toolbar;
20 | private WebView webView;
21 |
22 | @Override
23 | protected void onCreate(@Nullable Bundle savedInstanceState) {
24 | super.onCreate(savedInstanceState);
25 |
26 | setContentView(R.layout.activity_web);
27 |
28 | toolbar = (Toolbar)findViewById(R.id.toolbar);
29 | setSupportActionBar(toolbar);
30 | toolbar.setTitle(getString(R.string.app_name));
31 | getSupportActionBar().setDisplayHomeAsUpEnabled(true);
32 | toolbar.setNavigationOnClickListener(new View.OnClickListener() {
33 | @Override
34 | public void onClick(View v) {
35 | onBackPressed();
36 | }
37 | });
38 |
39 | initWebview();
40 |
41 | Intent intent = getIntent();
42 | String url = intent.getStringExtra("url");
43 | webView.loadUrl(url);
44 | }
45 |
46 | public void initWebview(){
47 | webView = (WebView) findViewById(R.id.webview);
48 | webView.getSettings().setJavaScriptEnabled(true);
49 | webView.setWebViewClient(new WebViewClient(){
50 | @Override
51 | public boolean shouldOverrideUrlLoading(WebView view, String url) {
52 | view.loadUrl(url);
53 | return true;
54 | }
55 | });
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/app/src/main/java/me/pkhope/jianwei/ui/adapter/CommentAdapter.java:
--------------------------------------------------------------------------------
1 | package me.pkhope.jianwei.ui.adapter;
2 |
3 | import android.content.Context;
4 | import android.support.v7.widget.RecyclerView;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 | import android.widget.ImageView;
9 | import android.widget.TextView;
10 |
11 | import com.bumptech.glide.Glide;
12 | import com.sina.weibo.sdk.openapi.models.Comment;
13 |
14 | import java.util.ArrayList;
15 | import java.util.List;
16 |
17 | import me.pkhope.jianwei.R;
18 | import me.pkhope.jianwei.utils.AdditionText;
19 | import me.pkhope.jianwei.utils.TimeConverter;
20 | import me.pkhope.jianwei.widget.emojitextview.EmojiTextView;
21 |
22 | /**
23 | * Created by pkhope on 2016/6/11.
24 | */
25 | public class CommentAdapter extends RecyclerView.Adapter {
26 |
27 | private Context context;
28 | private List commentList = new ArrayList<>();
29 |
30 | public CommentAdapter(Context context, List list){
31 | this.context = context;
32 | commentList = list;
33 | }
34 |
35 | @Override
36 | public CommentViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
37 |
38 | View view = LayoutInflater.from(parent.getContext())
39 | .inflate(R.layout.comment_item,parent,false);
40 | return new CommentViewHolder(view);
41 | }
42 |
43 | @Override
44 | public void onBindViewHolder(CommentViewHolder holder, int position) {
45 |
46 | Comment comment = commentList.get(position);
47 | if (comment.reply_comment == null){
48 | holder.comment.setText(comment.text);
49 | } else {
50 | Comment reply = comment.reply_comment;
51 | String replyText = "";
52 | while(reply != null){
53 | replyText += AdditionText.retweet(reply.user.name) + reply.text;
54 | reply = reply.reply_comment;
55 | }
56 | holder.comment.setText(comment.text + replyText);
57 | }
58 |
59 | holder.nickname.setText(comment.user.name);
60 | holder.time.setText(TimeConverter.convert(comment.created_at));
61 |
62 | Glide.with(context)
63 | .load(comment.user.profile_image_url)
64 | .centerCrop()
65 | .into(holder.avatar);
66 |
67 | holder.source.setText(AdditionText.retweet(comment.status.user.name) + comment.status.text);
68 | }
69 |
70 | @Override
71 | public int getItemCount() {
72 | return commentList.size();
73 | }
74 |
75 | public class CommentViewHolder extends RecyclerView.ViewHolder{
76 |
77 | private ImageView avatar;
78 | private EmojiTextView comment;
79 | private TextView nickname;
80 | private TextView time;
81 |
82 | private EmojiTextView source;
83 |
84 | public CommentViewHolder(View itemView) {
85 | super(itemView);
86 |
87 | avatar = (ImageView)itemView.findViewById(R.id.avatar);
88 | comment = (EmojiTextView) itemView.findViewById(R.id.comment);
89 | nickname = (TextView)itemView.findViewById(R.id.nickname);
90 | time = (TextView)itemView.findViewById(R.id.time);
91 |
92 | source = (EmojiTextView)itemView.findViewById(R.id.source);
93 | }
94 | }
95 | }
96 |
--------------------------------------------------------------------------------
/app/src/main/java/me/pkhope/jianwei/ui/adapter/MyFragmentPagerAdapter.java:
--------------------------------------------------------------------------------
1 | package me.pkhope.jianwei.ui.adapter;
2 |
3 | import android.support.v4.app.Fragment;
4 | import android.support.v4.app.FragmentManager;
5 | import android.support.v4.app.FragmentPagerAdapter;
6 | import android.support.v4.app.ListFragment;
7 |
8 | import java.util.ArrayList;
9 | import java.util.List;
10 |
11 | import uk.co.senab.photoview.PhotoViewAttacher;
12 |
13 | /**
14 | * Created by pkhope on 2016/6/7.
15 | */
16 | public class MyFragmentPagerAdapter extends FragmentPagerAdapter{
17 |
18 |
19 | private List titleList = new ArrayList<>();
20 | private List fragmentList = new ArrayList<>();
21 |
22 | public MyFragmentPagerAdapter(FragmentManager fm, List list){
23 | super(fm);
24 | fragmentList = list;
25 | }
26 |
27 | @Override
28 | public Fragment getItem(int position) {
29 | return fragmentList.get(position);
30 | }
31 |
32 | @Override
33 | public int getCount() {
34 | return fragmentList.size();
35 | }
36 |
37 | @Override
38 | public CharSequence getPageTitle(int position) {
39 | return titleList.get(position);
40 | }
41 |
42 | public void setTitleList(List list){
43 | titleList = list;
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/app/src/main/java/me/pkhope/jianwei/ui/adapter/UserAdapter.java:
--------------------------------------------------------------------------------
1 | package me.pkhope.jianwei.ui.adapter;
2 |
3 | import android.content.Context;
4 | import android.support.v7.widget.RecyclerView;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 | import android.widget.ImageView;
9 | import android.widget.TextView;
10 |
11 | import com.bumptech.glide.Glide;
12 | import com.sina.weibo.sdk.openapi.models.Status;
13 | import com.sina.weibo.sdk.openapi.models.User;
14 |
15 | import java.util.ArrayList;
16 | import java.util.List;
17 |
18 | import me.pkhope.jianwei.R;
19 |
20 | /**
21 | * Created by pkhope on 2016/6/12.
22 | */
23 | public class UserAdapter extends RecyclerView.Adapter{
24 |
25 | private List userList = new ArrayList<>();
26 |
27 | private Context context;
28 |
29 | public UserAdapter(Context context, List list){
30 | this.context = context;
31 | userList = list;
32 | }
33 |
34 | @Override
35 | public UserViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
36 | View view = LayoutInflater.from(parent.getContext())
37 | .inflate(R.layout.user_item,parent,false);
38 | return new UserViewHolder(view);
39 | }
40 |
41 | @Override
42 | public void onBindViewHolder(UserViewHolder holder, int position) {
43 | User user = userList.get(position);
44 | holder.nickname.setText(user.name);
45 | holder.content.setText(user.description);
46 |
47 | Glide.with(context)
48 | .load(user.profile_image_url)
49 | .centerCrop()
50 | .into(holder.avatar);
51 | }
52 |
53 | @Override
54 | public int getItemCount() {
55 | return userList.size();
56 | }
57 |
58 | public class UserViewHolder extends RecyclerView.ViewHolder{
59 |
60 | ImageView avatar;
61 | TextView nickname;
62 | TextView content;
63 |
64 | public UserViewHolder(View itemView) {
65 | super(itemView);
66 |
67 | avatar = (ImageView)itemView.findViewById(R.id.avatar);
68 | nickname = (TextView)itemView.findViewById(R.id.nickname);
69 | content = (TextView)itemView.findViewById(R.id.content);
70 | }
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/app/src/main/java/me/pkhope/jianwei/ui/adapter/ViewPagerAdapter.java:
--------------------------------------------------------------------------------
1 | package me.pkhope.jianwei.ui.adapter;
2 |
3 | import android.content.Context;
4 | import android.support.v4.view.PagerAdapter;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 |
9 | import com.bumptech.glide.Glide;
10 |
11 | import java.util.ArrayList;
12 | import java.util.List;
13 |
14 | import me.pkhope.jianwei.R;
15 | import uk.co.senab.photoview.PhotoView;
16 | import uk.co.senab.photoview.PhotoViewAttacher;
17 |
18 | /**
19 | * Created by pkhope on 2016/6/17.
20 | */
21 | public class ViewPagerAdapter extends PagerAdapter{
22 |
23 | private Context context;
24 | private List images = new ArrayList<>();
25 |
26 | private PhotoViewAttacher.OnPhotoTapListener photoTapListener;
27 |
28 | public ViewPagerAdapter(Context context, List images){
29 | this.context = context;
30 | this.images = images;
31 | }
32 |
33 | @Override
34 | public Object instantiateItem(ViewGroup container, int position) {
35 | View view = LayoutInflater.from(container.getContext()).inflate(R.layout.image_detail, null);
36 | PhotoView pv = (PhotoView) view.findViewById(R.id.pv);
37 | pv.setOnPhotoTapListener(photoTapListener);
38 | Glide.with(context)
39 | .load(images.get(position).replace("thumbnail", "large"))
40 | .into(pv);
41 | container.addView(view, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
42 | return view;
43 | }
44 |
45 | @Override
46 | public void destroyItem(ViewGroup container, int position, Object object) {
47 | container.removeView((View) object);
48 | }
49 |
50 | @Override
51 | public boolean isViewFromObject(View view, Object object) {
52 | return view == object;
53 | }
54 |
55 | @Override
56 | public int getCount() {
57 | return images.size();
58 | }
59 |
60 | public void setPhotoTapListener(PhotoViewAttacher.OnPhotoTapListener listener){
61 | photoTapListener = listener;
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/app/src/main/java/me/pkhope/jianwei/ui/base/BaseActivity.java:
--------------------------------------------------------------------------------
1 | package me.pkhope.jianwei.ui.base;
2 |
3 | import android.os.Bundle;
4 | import android.support.annotation.Nullable;
5 | import android.support.v7.app.AppCompatActivity;
6 |
7 | /**
8 | * Created by pkhope on 2016/6/19.
9 | */
10 | public class BaseActivity extends AppCompatActivity {
11 |
12 | @Override
13 | protected void onCreate(@Nullable Bundle savedInstanceState) {
14 | super.onCreate(savedInstanceState);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/app/src/main/java/me/pkhope/jianwei/ui/fragment/CommentByMeFragment.java:
--------------------------------------------------------------------------------
1 | package me.pkhope.jianwei.ui.fragment;
2 |
3 | import android.os.Bundle;
4 | import android.support.annotation.Nullable;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 |
9 | import com.sina.weibo.sdk.exception.WeiboException;
10 | import com.sina.weibo.sdk.net.RequestListener;
11 | import com.sina.weibo.sdk.openapi.models.Comment;
12 | import com.sina.weibo.sdk.openapi.models.CommentList;
13 |
14 | import java.util.ArrayList;
15 | import java.util.List;
16 |
17 | import me.pkhope.jianwei.App;
18 | import me.pkhope.jianwei.ui.activity.MainActivity;
19 | import me.pkhope.jianwei.ui.adapter.CommentAdapter;
20 | import me.pkhope.jianwei.Constants;
21 | import me.pkhope.jianwei.ui.base.BaseFragment;
22 |
23 | /**
24 | * Created by pkhope on 2016/6/10.
25 | */
26 | public class CommentByMeFragment extends BaseFragment {
27 |
28 | private int currentPage = 2;
29 | private List commentList = new ArrayList<>();
30 |
31 | @Nullable
32 | @Override
33 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
34 |
35 | adapter = new CommentAdapter(getContext(),commentList);
36 | return super.onCreateView(inflater, container, savedInstanceState);
37 | }
38 |
39 | @Override
40 | protected void loadMore() {
41 |
42 | setRefreshing(true);
43 |
44 | App.getWeiboAPI().byME(currentPage++, Constants.PAGE_COUNT, new RequestListener() {
45 | @Override
46 | public void onComplete(String s) {
47 |
48 | setRefreshing(false);
49 |
50 | CommentList data = CommentList.parse(s);
51 | if (data.commentList == null){
52 | return;
53 | }
54 | commentList.addAll(data.commentList);
55 | adapter.notifyDataSetChanged();
56 |
57 | }
58 |
59 | @Override
60 | public void onWeiboException(WeiboException e) {
61 | e.printStackTrace();
62 | }
63 | });
64 | }
65 |
66 |
67 | @Override
68 | protected void refreshData() {
69 |
70 | App.getWeiboAPI().byME(1, Constants.PAGE_COUNT, new RequestListener() {
71 | @Override
72 | public void onComplete(String s) {
73 | setRefreshing(false);
74 |
75 | commentList.clear();
76 | currentPage = 2;
77 | CommentList data = CommentList.parse(s);
78 | if (data.commentList == null){
79 | return;
80 | }
81 | commentList.addAll(data.commentList);
82 | adapter.notifyDataSetChanged();
83 |
84 | }
85 |
86 | @Override
87 | public void onWeiboException(WeiboException e) {
88 | e.printStackTrace();
89 | }
90 | });
91 | }
92 | }
93 |
94 |
--------------------------------------------------------------------------------
/app/src/main/java/me/pkhope/jianwei/ui/fragment/CommentFragment.java:
--------------------------------------------------------------------------------
1 | package me.pkhope.jianwei.ui.fragment;
2 |
3 | import android.os.Bundle;
4 | import android.support.annotation.Nullable;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 |
9 | import com.sina.weibo.sdk.exception.WeiboException;
10 | import com.sina.weibo.sdk.net.RequestListener;
11 | import com.sina.weibo.sdk.openapi.models.Comment;
12 | import com.sina.weibo.sdk.openapi.models.CommentList;
13 |
14 | import java.util.ArrayList;
15 | import java.util.List;
16 |
17 | import me.pkhope.jianwei.App;
18 | import me.pkhope.jianwei.Constants;
19 | import me.pkhope.jianwei.interfaces.Identifier;
20 | import me.pkhope.jianwei.ui.activity.MainActivity;
21 | import me.pkhope.jianwei.ui.adapter.CommentAdapter;
22 | import me.pkhope.jianwei.ui.base.BaseFragment;
23 |
24 | /**
25 | * Created by pkhope on 2016/6/19.
26 | */
27 | public class CommentFragment extends BaseFragment{
28 |
29 | private int currentPage = 2;
30 | private List commentList = new ArrayList<>();
31 |
32 | @Nullable
33 | @Override
34 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
35 |
36 | adapter = new CommentAdapter(getContext(),commentList);
37 | return super.onCreateView(inflater, container, savedInstanceState);
38 | }
39 |
40 | @Override
41 | protected void loadMore() {
42 |
43 | setRefreshing(true);
44 |
45 | App.getWeiboAPI().show(Long.parseLong(((Identifier)getActivity()).getIdentifier()),currentPage++, Constants.PAGE_COUNT, new RequestListener() {
46 | @Override
47 | public void onComplete(String s) {
48 |
49 | setRefreshing(false);
50 |
51 | CommentList data = CommentList.parse(s);
52 | if (data.commentList == null){
53 | return;
54 | }
55 | commentList.addAll(data.commentList);
56 | adapter.notifyDataSetChanged();
57 |
58 | }
59 |
60 | @Override
61 | public void onWeiboException(WeiboException e) {
62 | e.printStackTrace();
63 | }
64 | });
65 | }
66 |
67 |
68 | @Override
69 | protected void refreshData() {
70 |
71 | App.getWeiboAPI().show(Long.parseLong(((Identifier)getActivity()).getIdentifier()),1, Constants.PAGE_COUNT, new RequestListener() {
72 | @Override
73 | public void onComplete(String s) {
74 | setRefreshing(false);
75 |
76 | commentList.clear();
77 | currentPage = 2;
78 | CommentList data = CommentList.parse(s);
79 | if (data.commentList == null){
80 | return;
81 | }
82 | commentList.addAll(data.commentList);
83 | adapter.notifyDataSetChanged();
84 |
85 | }
86 |
87 | @Override
88 | public void onWeiboException(WeiboException e) {
89 | e.printStackTrace();
90 | }
91 | });
92 | }
93 | }
94 |
--------------------------------------------------------------------------------
/app/src/main/java/me/pkhope/jianwei/ui/fragment/CommentToMeFragment.java:
--------------------------------------------------------------------------------
1 | package me.pkhope.jianwei.ui.fragment;
2 |
3 | import android.os.Bundle;
4 | import android.support.annotation.Nullable;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 |
9 | import com.sina.weibo.sdk.exception.WeiboException;
10 | import com.sina.weibo.sdk.net.RequestListener;
11 | import com.sina.weibo.sdk.openapi.models.Comment;
12 | import com.sina.weibo.sdk.openapi.models.CommentList;
13 |
14 | import java.util.ArrayList;
15 | import java.util.List;
16 |
17 | import me.pkhope.jianwei.App;
18 | import me.pkhope.jianwei.Constants;
19 | import me.pkhope.jianwei.ui.activity.MainActivity;
20 | import me.pkhope.jianwei.ui.adapter.CommentAdapter;
21 | import me.pkhope.jianwei.ui.base.BaseFragment;
22 |
23 | /**
24 | * Created by pkhope on 2016/6/10.
25 | */
26 | public class CommentToMeFragment extends BaseFragment {
27 |
28 | private int currentPage = 1;
29 | private List commentList = new ArrayList<>();
30 |
31 | @Nullable
32 | @Override
33 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
34 |
35 | adapter = new CommentAdapter(getContext(),commentList);
36 | return super.onCreateView(inflater, container, savedInstanceState);
37 | }
38 |
39 | @Override
40 | protected void loadMore() {
41 |
42 | setRefreshing(true);
43 |
44 | App.getWeiboAPI().toME(currentPage++, Constants.PAGE_COUNT, new RequestListener() {
45 |
46 | @Override
47 | public void onComplete(String s) {
48 |
49 | setRefreshing(false);
50 |
51 | CommentList data = CommentList.parse(s);
52 | if (data.commentList == null){
53 | return;
54 | }
55 | commentList.addAll(data.commentList);
56 | adapter.notifyDataSetChanged();
57 |
58 | }
59 |
60 | @Override
61 | public void onWeiboException(WeiboException e) {
62 | e.printStackTrace();
63 | }
64 | });
65 | }
66 |
67 |
68 | @Override
69 | protected void refreshData() {
70 |
71 | App.getWeiboAPI().toME(1, Constants.PAGE_COUNT, new RequestListener() {
72 | @Override
73 | public void onComplete(String s) {
74 | setRefreshing(false);
75 | commentList.clear();
76 | currentPage = 2;
77 | CommentList data = CommentList.parse(s);
78 | if (data.commentList == null){
79 | return;
80 | }
81 | commentList.addAll(data.commentList);
82 | adapter.notifyDataSetChanged();
83 |
84 | }
85 |
86 | @Override
87 | public void onWeiboException(WeiboException e) {
88 | e.printStackTrace();
89 | }
90 | });
91 | }
92 | }
93 |
--------------------------------------------------------------------------------
/app/src/main/java/me/pkhope/jianwei/ui/fragment/FollowersFragment.java:
--------------------------------------------------------------------------------
1 | package me.pkhope.jianwei.ui.fragment;
2 |
3 | import com.sina.weibo.sdk.exception.WeiboException;
4 | import com.sina.weibo.sdk.net.RequestListener;
5 |
6 | import me.pkhope.jianwei.App;
7 | import me.pkhope.jianwei.Constants;
8 | import me.pkhope.jianwei.interfaces.Identifier;
9 | import me.pkhope.jianwei.models.UserList;
10 | import me.pkhope.jianwei.ui.activity.MainActivity;
11 |
12 | /**
13 | * Created by pkhope on 2016/6/12.
14 | */
15 | public class FollowersFragment extends FriendsFragment {
16 |
17 | @Override
18 | protected void loadMore() {
19 | // super.loadPage(page);
20 | setRefreshing(true);
21 | App.getWeiboAPI().follower(((Identifier)getActivity()).getIdentifier(), currentCursor++, Constants.PAGE_COUNT, new RequestListener() {
22 | @Override
23 | public void onComplete(String s) {
24 | setRefreshing(false);
25 | UserList data = UserList.parse(s);
26 | if (data.userList == null){
27 | return;
28 | }
29 | userList.addAll(data.userList);
30 | adapter.notifyDataSetChanged();
31 | // currentCursor = Integer.parseInt(data.next_cursor);
32 |
33 | }
34 |
35 | @Override
36 | public void onWeiboException(WeiboException e) {
37 | e.printStackTrace();
38 | }
39 | });
40 | }
41 |
42 | @Override
43 | protected void refreshData() {
44 |
45 | App.getWeiboAPI().follower(((Identifier)getActivity()).getIdentifier(), 0, Constants.PAGE_COUNT, new RequestListener() {
46 | @Override
47 | public void onComplete(String s) {
48 | setRefreshing(false);
49 | userList.clear();
50 | currentCursor = 1;
51 | UserList data = UserList.parse(s);
52 | if (data.userList == null){
53 | return;
54 | }
55 | userList.addAll(data.userList);
56 | adapter.notifyDataSetChanged();
57 | // currentCursor = Integer.parseInt(data.next_cursor);
58 |
59 | }
60 |
61 | @Override
62 | public void onWeiboException(WeiboException e) {
63 | e.printStackTrace();
64 | }
65 | });
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/app/src/main/java/me/pkhope/jianwei/ui/fragment/MentionsFragment.java:
--------------------------------------------------------------------------------
1 | package me.pkhope.jianwei.ui.fragment;
2 |
3 | import android.os.Bundle;
4 | import android.support.annotation.Nullable;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 |
9 | import com.sina.weibo.sdk.exception.WeiboException;
10 | import com.sina.weibo.sdk.net.RequestListener;
11 | import com.sina.weibo.sdk.openapi.models.Comment;
12 | import com.sina.weibo.sdk.openapi.models.CommentList;
13 | import com.sina.weibo.sdk.openapi.models.Status;
14 | import com.sina.weibo.sdk.openapi.models.StatusList;
15 |
16 | import java.util.ArrayList;
17 | import java.util.List;
18 |
19 | import me.pkhope.jianwei.App;
20 | import me.pkhope.jianwei.ui.activity.MainActivity;
21 | import me.pkhope.jianwei.ui.adapter.CommentAdapter;
22 | import me.pkhope.jianwei.Constants;
23 | import me.pkhope.jianwei.ui.adapter.FriendsTimelineAdapter;
24 | import me.pkhope.jianwei.ui.base.BaseFragment;
25 |
26 | /**
27 | * Created by pkhope on 2016/6/10.
28 | */
29 | public class MentionsFragment extends BaseFragment {
30 |
31 | private int currentPage = 2;
32 | private List statusList = new ArrayList<>();
33 |
34 | @Nullable
35 | @Override
36 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
37 |
38 | adapter = new FriendsTimelineAdapter(getContext(),statusList);
39 | return super.onCreateView(inflater, container, savedInstanceState);
40 | }
41 |
42 |
43 | @Override
44 | protected void loadMore() {
45 |
46 | setRefreshing(true);
47 | App.getWeiboAPI().mentions(currentPage++, Constants.PAGE_COUNT, new RequestListener() {
48 | @Override
49 | public void onComplete(String s) {
50 | setRefreshing(false);
51 | StatusList data = StatusList.parse(s);
52 | if (data.statusList == null){
53 | return;
54 | }
55 | statusList.addAll(data.statusList);
56 | adapter.notifyDataSetChanged();
57 |
58 | }
59 |
60 | @Override
61 | public void onWeiboException(WeiboException e) {
62 | e.printStackTrace();
63 | }
64 | });
65 | }
66 |
67 | @Override
68 | protected void refreshData() {
69 |
70 | setRefreshing(true);
71 | App.getWeiboAPI().mentions(1, Constants.PAGE_COUNT, new RequestListener() {
72 | @Override
73 | public void onComplete(String s) {
74 |
75 | setRefreshing(false);
76 |
77 | statusList.clear();
78 | currentPage = 2;
79 | StatusList data = StatusList.parse(s);
80 | if (data.statusList == null){
81 | return;
82 | }
83 | statusList.addAll(data.statusList);
84 | adapter.notifyDataSetChanged();
85 |
86 | }
87 |
88 | @Override
89 | public void onWeiboException(WeiboException e) {
90 | e.printStackTrace();
91 | }
92 | });
93 | }
94 | }
95 |
96 |
--------------------------------------------------------------------------------
/app/src/main/java/me/pkhope/jianwei/ui/fragment/MessageFragment.java:
--------------------------------------------------------------------------------
1 | package me.pkhope.jianwei.ui.fragment;
2 |
3 | import android.os.Bundle;
4 | import android.support.annotation.Nullable;
5 | import android.support.design.widget.TabLayout;
6 | import android.support.v4.app.Fragment;
7 | import android.support.v4.view.ViewPager;
8 | import android.view.LayoutInflater;
9 | import android.view.View;
10 | import android.view.ViewGroup;
11 |
12 | import java.util.ArrayList;
13 | import java.util.List;
14 |
15 | import me.pkhope.jianwei.ui.adapter.MyFragmentPagerAdapter;
16 | import me.pkhope.jianwei.R;
17 |
18 | /**
19 | * Created by pkhope on 2016/6/7.
20 | */
21 | public class MessageFragment extends Fragment {
22 |
23 | private List titleList = new ArrayList<>();
24 | private List fragmentList = new ArrayList<>();
25 |
26 | @Nullable
27 | @Override
28 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
29 |
30 | View view = inflater.inflate(R.layout.fragment_message, container, false);
31 |
32 | return view;
33 | }
34 |
35 | @Override
36 | public void onActivityCreated(@Nullable Bundle savedInstanceState) {
37 | super.onActivityCreated(savedInstanceState);
38 |
39 | titleList.add("收到的");
40 | titleList.add("@我的");
41 | titleList.add("发出的");
42 |
43 | ViewPager viewPager = (ViewPager)getView().findViewById(R.id.msg_viewpager);
44 | fragmentList.add(new CommentToMeFragment());
45 | fragmentList.add(new MentionsFragment());
46 | fragmentList.add(new CommentByMeFragment());
47 | MyFragmentPagerAdapter adapter = new MyFragmentPagerAdapter(getChildFragmentManager(),fragmentList);
48 | viewPager.setAdapter(adapter);
49 | adapter.setTitleList(titleList);
50 |
51 | TabLayout tab = (TabLayout) getView().findViewById(R.id.tab);
52 | tab.setupWithViewPager(viewPager);
53 | tab.setTabMode(TabLayout.MODE_FIXED);
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/app/src/main/java/me/pkhope/jianwei/ui/fragment/UserTimelineFragment.java:
--------------------------------------------------------------------------------
1 | package me.pkhope.jianwei.ui.fragment;
2 |
3 | import android.os.Bundle;
4 | import android.support.annotation.Nullable;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 |
9 | import com.sina.weibo.sdk.exception.WeiboException;
10 | import com.sina.weibo.sdk.net.RequestListener;
11 | import com.sina.weibo.sdk.openapi.models.Status;
12 | import com.sina.weibo.sdk.openapi.models.StatusList;
13 |
14 | import java.util.ArrayList;
15 | import java.util.List;
16 |
17 | import me.pkhope.jianwei.App;
18 | import me.pkhope.jianwei.Constants;
19 | import me.pkhope.jianwei.interfaces.Identifier;
20 | import me.pkhope.jianwei.ui.activity.MainActivity;
21 | import me.pkhope.jianwei.ui.adapter.FriendsTimelineAdapter;
22 | import me.pkhope.jianwei.ui.base.BaseFragment;
23 |
24 | /**
25 | * Created by pkhope on 2016/6/12.
26 | */
27 | public class UserTimelineFragment extends BaseFragment {
28 |
29 | private int currentPage = 2;
30 | private List statusList;
31 |
32 | public UserTimelineFragment(){
33 | statusList = new ArrayList<>();
34 | }
35 |
36 | @Nullable
37 | @Override
38 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
39 |
40 | adapter = new FriendsTimelineAdapter(getContext(),statusList);
41 | return super.onCreateView(inflater, container, savedInstanceState);
42 | }
43 |
44 | @Override
45 | protected void loadMore() {
46 |
47 | setRefreshing(true);
48 | App.getWeiboAPI().userTimeline(((Identifier)getActivity()).getIdentifier(),currentPage++, Constants.PAGE_COUNT, new RequestListener() {
49 | @Override
50 | public void onComplete(String s) {
51 | setRefreshing(false);
52 | StatusList data = StatusList.parse(s);
53 | if (data.statusList == null){
54 | return;
55 | }
56 | statusList.addAll(data.statusList);
57 | adapter.notifyDataSetChanged();
58 |
59 | }
60 |
61 | @Override
62 | public void onWeiboException(WeiboException e) {
63 | e.printStackTrace();
64 | }
65 | });
66 | }
67 |
68 | @Override
69 | protected void refreshData() {
70 |
71 | setRefreshing(true);
72 | App.getWeiboAPI().userTimeline(((Identifier)getActivity()).getIdentifier(),1, Constants.PAGE_COUNT, new RequestListener() {
73 | @Override
74 | public void onComplete(String s) {
75 | setRefreshing(false);
76 | statusList.clear();
77 | currentPage = 2;
78 | StatusList data = StatusList.parse(s);
79 | if (data.statusList == null){
80 | return;
81 | }
82 | statusList.addAll(data.statusList);
83 | adapter.notifyDataSetChanged();
84 |
85 | }
86 |
87 | @Override
88 | public void onWeiboException(WeiboException e) {
89 | e.printStackTrace();
90 | }
91 | });
92 | }
93 | }
94 |
--------------------------------------------------------------------------------
/app/src/main/java/me/pkhope/jianwei/utils/AccessTokenPreference.java:
--------------------------------------------------------------------------------
1 | package me.pkhope.jianwei.utils;
2 |
3 | import android.content.Context;
4 | import android.content.SharedPreferences;
5 |
6 | import com.sina.weibo.sdk.auth.Oauth2AccessToken;
7 |
8 | /**
9 | * Created by pkhope on 2016/6/3.
10 | */
11 | public class AccessTokenPreference {
12 |
13 | private static final String PREFERENCES_NAME = "access_token";
14 |
15 | private static final String KEY_UID = "uid";
16 | private static final String KEY_ACCESS_TOKEN = "access_token";
17 | private static final String KEY_EXPIRES_IN = "expires_in";
18 | private static final String KEY_REFRESH_TOKEN = "refresh_token";
19 |
20 | public static void saveAccessToken(Context context, Oauth2AccessToken token) {
21 | if (null == context || null == token) {
22 | return;
23 | }
24 |
25 | SharedPreferences pref = context.getSharedPreferences(PREFERENCES_NAME, Context.MODE_APPEND);
26 | SharedPreferences.Editor editor = pref.edit();
27 | editor.putString(KEY_UID, token.getUid());
28 | editor.putString(KEY_ACCESS_TOKEN, token.getToken());
29 | editor.putString(KEY_REFRESH_TOKEN, token.getRefreshToken());
30 | editor.putLong(KEY_EXPIRES_IN, token.getExpiresTime());
31 | editor.commit();
32 | }
33 |
34 | public static Oauth2AccessToken loadAccessToken(Context context) {
35 | if (null == context) {
36 | return null;
37 | }
38 |
39 | Oauth2AccessToken token = new Oauth2AccessToken();
40 | SharedPreferences pref = context.getSharedPreferences(PREFERENCES_NAME, Context.MODE_APPEND);
41 | token.setUid(pref.getString(KEY_UID, ""));
42 | token.setToken(pref.getString(KEY_ACCESS_TOKEN, ""));
43 | token.setRefreshToken(pref.getString(KEY_REFRESH_TOKEN, ""));
44 | token.setExpiresTime(pref.getLong(KEY_EXPIRES_IN, 0));
45 |
46 | return token;
47 | }
48 |
49 | public static void clear(Context context) {
50 | if (null == context) {
51 | return;
52 | }
53 |
54 | SharedPreferences pref = context.getSharedPreferences(PREFERENCES_NAME, Context.MODE_APPEND);
55 | SharedPreferences.Editor editor = pref.edit();
56 | editor.clear();
57 | editor.commit();
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/app/src/main/java/me/pkhope/jianwei/utils/AdditionText.java:
--------------------------------------------------------------------------------
1 | package me.pkhope.jianwei.utils;
2 |
3 | /**
4 | * Created by thinkpad on 2016/6/18.
5 | */
6 | public class AdditionText {
7 |
8 | public static String retweet(String name){
9 | return "@" + name + ":";
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/app/src/main/java/me/pkhope/jianwei/utils/StatusFilter.java:
--------------------------------------------------------------------------------
1 | package me.pkhope.jianwei.utils;
2 |
3 | import com.sina.weibo.sdk.openapi.models.Status;
4 |
5 | import java.util.ArrayList;
6 | import java.util.List;
7 |
8 | /**
9 | * Created by pkhope on 2016/6/11.
10 | */
11 | public class StatusFilter {
12 |
13 | public static List filter(List list){
14 |
15 | List result = new ArrayList<>();
16 | for (Status s : list ){
17 | if (s.retweeted_status == null){
18 | result.add(s);
19 | }
20 | }
21 |
22 | return result;
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/app/src/main/java/me/pkhope/jianwei/utils/TimeConverter.java:
--------------------------------------------------------------------------------
1 | package me.pkhope.jianwei.utils;
2 |
3 | import java.text.SimpleDateFormat;
4 | import java.util.Calendar;
5 | import java.util.Date;
6 | import java.util.Locale;
7 |
8 | /**
9 | * Created by pkhope on 2016/6/9.
10 | */
11 | public class TimeConverter {
12 |
13 | public static String convert(String time){
14 |
15 | Calendar calendar = Calendar.getInstance();
16 | int currentYear = calendar.get(Calendar.YEAR);
17 | int currentMonth = calendar.get(Calendar.MONTH)+1;
18 | int currentDay = calendar.get(Calendar.DAY_OF_MONTH);
19 | int currentHour = calendar.get(Calendar.HOUR);
20 | int currentMinute = calendar.get(Calendar.MINUTE);
21 |
22 | Date date = parse(time);
23 | calendar.setTime(date);
24 | int createdYear = calendar.get(Calendar.YEAR);
25 | int createdMonth = calendar.get(Calendar.MONTH)+1;
26 | int createdDay = calendar.get(Calendar.DAY_OF_MONTH);
27 | int createdHour = calendar.get(Calendar.HOUR);
28 | int createdMinute = calendar.get(Calendar.MINUTE);
29 |
30 | String result = "";
31 | if (currentYear > createdYear){
32 | result = String.format("%d-%d-%d",createdYear,createdMonth,createdDay);
33 | } else if (currentMonth > createdMonth){
34 | result = String.format("%d-%d",createdMonth,createdDay);
35 | } else if (currentDay > createdDay){
36 | result = String.format("%d-%d",createdMonth,createdDay);
37 | } else if (currentHour > createdHour){
38 | result = String.format("%dh",currentHour - createdHour);
39 | } else if (currentMinute > createdMinute){
40 | result = String.format("%dm",currentMinute - createdMinute);
41 | } else {
42 | result = "1m";
43 | }
44 | return result;
45 | }
46 |
47 | protected static Date parse(String time){
48 |
49 | SimpleDateFormat sdf = new SimpleDateFormat("E MMM dd HH:mm:ss Z yyyy",
50 | Locale.US);
51 | Date date = null;
52 | try {
53 | date = sdf.parse(time);
54 | }catch (Exception e){
55 | e.printStackTrace();
56 | }
57 |
58 | return date;
59 |
60 | }
61 |
62 | }
63 |
--------------------------------------------------------------------------------
/app/src/main/java/me/pkhope/jianwei/utils/ToastUtils.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 Drakeet
3 | *
4 | * This file is part of Meizhi
5 | *
6 | * Meizhi is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 3 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * Meizhi is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with Meizhi. If not, see .
18 | */
19 |
20 | package me.pkhope.jianwei.utils;
21 |
22 | import android.content.Context;
23 | import android.widget.Toast;
24 |
25 | /**
26 | * Created by drakeet on 9/27/14.
27 | */
28 | public class ToastUtils {
29 |
30 | public static Context sContext;
31 |
32 |
33 | private ToastUtils() {
34 | }
35 |
36 |
37 | public static void register(Context context) {
38 | sContext = context.getApplicationContext();
39 | }
40 |
41 |
42 | private static void check() {
43 | if (sContext == null) {
44 | throw new NullPointerException(
45 | "Must initial call ToastUtils.register(Context context) in your " +
46 | " " +
47 | "extends Application class>");
48 | }
49 | }
50 |
51 |
52 | public static void showShort(int resId) {
53 | check();
54 | Toast.makeText(sContext, resId, Toast.LENGTH_SHORT).show();
55 | }
56 |
57 |
58 | public static void showShort(String message) {
59 | check();
60 | Toast.makeText(sContext, message, Toast.LENGTH_SHORT).show();
61 | }
62 |
63 |
64 | public static void showLong(int resId) {
65 | check();
66 | Toast.makeText(sContext, resId, Toast.LENGTH_LONG).show();
67 | }
68 |
69 |
70 | public static void showLong(String message) {
71 | check();
72 | Toast.makeText(sContext, message, Toast.LENGTH_LONG).show();
73 | }
74 |
75 |
76 | public static void showLongX2(String message) {
77 | showLong(message);
78 | showLong(message);
79 | }
80 |
81 |
82 | public static void showLongX2(int resId) {
83 | showLong(resId);
84 | showLong(resId);
85 | }
86 |
87 |
88 | public static void showLongX3(int resId) {
89 | showLong(resId);
90 | showLong(resId);
91 | showLong(resId);
92 | }
93 |
94 |
95 | public static void showLongX3(String message) {
96 | showLong(message);
97 | showLong(message);
98 | showLong(message);
99 | }
100 | }
101 |
--------------------------------------------------------------------------------
/app/src/main/java/me/pkhope/jianwei/widget/HackyViewPager.java:
--------------------------------------------------------------------------------
1 | package me.pkhope.jianwei.widget;
2 |
3 | import android.content.Context;
4 | import android.support.v4.view.ViewPager;
5 | import android.util.AttributeSet;
6 | import android.view.MotionEvent;
7 |
8 | /**
9 | * Created by pkhope on 2016/6/17.
10 | */
11 | public class HackyViewPager extends ViewPager {
12 |
13 | public HackyViewPager(Context context) {
14 | super(context);
15 | }
16 |
17 | public HackyViewPager(Context context, AttributeSet attrs) {
18 | super(context, attrs);
19 | }
20 |
21 | @Override
22 | public boolean onInterceptTouchEvent(MotionEvent ev) {
23 | try {
24 | return super.onInterceptTouchEvent(ev);
25 | } catch (IllegalArgumentException e) {
26 | e.printStackTrace();
27 | return false;
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/app/src/main/java/me/pkhope/jianwei/widget/MyViewPager.java:
--------------------------------------------------------------------------------
1 | package me.pkhope.jianwei.widget;
2 |
3 | import android.content.Context;
4 | import android.support.v4.view.ViewPager;
5 | import android.util.AttributeSet;
6 | import android.view.MotionEvent;
7 |
8 | /**
9 | * Created by pkhope on 2016/6/11.
10 | */
11 | public class MyViewPager extends ViewPager {
12 |
13 | public MyViewPager(Context context) {
14 | super(context);
15 | }
16 |
17 | public MyViewPager(Context context, AttributeSet attrs) {
18 | super(context, attrs);
19 | }
20 |
21 | @Override
22 | public boolean onInterceptTouchEvent(MotionEvent ev) {
23 | // return super.onInterceptTouchEvent(ev);
24 | return false;
25 | }
26 |
27 | @Override
28 | public boolean onTouchEvent(MotionEvent ev) {
29 | // return super.onTouchEvent(ev);
30 |
31 | return false;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/app/src/main/java/me/pkhope/jianwei/widget/ProgressWebView.java:
--------------------------------------------------------------------------------
1 | package me.pkhope.jianwei.widget;
2 |
3 | import android.content.Context;
4 | import android.graphics.drawable.Drawable;
5 | import android.util.AttributeSet;
6 | import android.webkit.WebView;
7 | import android.widget.ProgressBar;
8 |
9 | import me.pkhope.jianwei.R;
10 |
11 | /**
12 | * Created by pkhope on 2016/6/20.
13 | */
14 | public class ProgressWebView extends WebView{
15 |
16 | private ProgressBar progressbar;
17 |
18 | public ProgressWebView(Context context, AttributeSet attrs) {
19 | super(context, attrs);
20 | progressbar = new ProgressBar(context, null,
21 | android.R.attr.progressBarStyleHorizontal);
22 | progressbar.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT,
23 | 10, 0, 0));
24 |
25 | Drawable drawable = context.getDrawable(R.drawable.progress_bar_states);
26 | progressbar.setProgressDrawable(drawable);
27 | addView(progressbar);
28 |
29 | setWebChromeClient(new WebChromeClient());
30 | //是否可以缩放
31 | getSettings().setSupportZoom(true);
32 | getSettings().setBuiltInZoomControls(true);
33 | }
34 |
35 | public class WebChromeClient extends android.webkit.WebChromeClient {
36 | @Override
37 | public void onProgressChanged(WebView view, int newProgress) {
38 | if (newProgress == 100) {
39 | progressbar.setVisibility(GONE);
40 | } else {
41 | if (progressbar.getVisibility() == GONE)
42 | progressbar.setVisibility(VISIBLE);
43 | progressbar.setProgress(newProgress);
44 | }
45 | super.onProgressChanged(view, newProgress);
46 | }
47 |
48 | }
49 |
50 | @Override
51 | protected void onScrollChanged(int l, int t, int oldl, int oldt) {
52 | LayoutParams lp = (LayoutParams) progressbar.getLayoutParams();
53 | lp.x = l;
54 | lp.y = t;
55 | progressbar.setLayoutParams(lp);
56 | super.onScrollChanged(l, t, oldl, oldt);
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/app/src/main/java/me/pkhope/jianwei/widget/emojitextview/EmojiTextView.java:
--------------------------------------------------------------------------------
1 | package me.pkhope.jianwei.widget.emojitextview;
2 |
3 | import android.content.Context;
4 | import android.text.SpannableStringBuilder;
5 | import android.util.AttributeSet;
6 | import android.widget.TextView;
7 |
8 | /**
9 | * Created by wenmingvs on 16/3/9.
10 | */
11 | public class EmojiTextView extends TextView {
12 |
13 |
14 | private final Context mContext;
15 |
16 | public EmojiTextView(Context context) {
17 | super(context, null);
18 | mContext = context;
19 | }
20 |
21 | public EmojiTextView(Context context, AttributeSet attrs) {
22 | super(context, attrs);
23 | mContext = context;
24 | }
25 |
26 | public void setText(String text) {
27 | SpannableStringBuilder result = WeiBoContentTextUtil.getWeiBoContent(text,getContext(),this);
28 | super.setText(result);
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/app/src/main/java/me/pkhope/jianwei/widget/emojitextview/WeiBoContentClickableSpan.java:
--------------------------------------------------------------------------------
1 | package me.pkhope.jianwei.widget.emojitextview;
2 |
3 | import android.content.Context;
4 | import android.graphics.Color;
5 | import android.text.Selection;
6 | import android.text.Spannable;
7 | import android.text.TextPaint;
8 | import android.text.style.ClickableSpan;
9 | import android.view.View;
10 | import android.widget.TextView;
11 |
12 | import me.pkhope.jianwei.R;
13 |
14 | /**
15 | * Created by wenmingvs on 16/4/15.
16 | */
17 | public class WeiBoContentClickableSpan extends ClickableSpan {
18 |
19 | private Context mContext;
20 |
21 | public WeiBoContentClickableSpan(Context context) {
22 | mContext = context;
23 | }
24 |
25 | @Override
26 | public void onClick(View widget) {
27 |
28 | }
29 |
30 | @Override
31 | public void updateDrawState(TextPaint ds) {
32 | super.updateDrawState(ds);
33 | ds.setColor(0xff507daf);
34 | ds.setUnderlineText(false);
35 | }
36 |
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi-v7a/libweibosdkcore.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/app/src/main/jniLibs/armeabi-v7a/libweibosdkcore.so
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi/libweibosdkcore.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/app/src/main/jniLibs/armeabi/libweibosdkcore.so
--------------------------------------------------------------------------------
/app/src/main/jniLibs/mips/libweibosdkcore.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/app/src/main/jniLibs/mips/libweibosdkcore.so
--------------------------------------------------------------------------------
/app/src/main/jniLibs/x86/libweibosdkcore.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/app/src/main/jniLibs/x86/libweibosdkcore.so
--------------------------------------------------------------------------------
/app/src/main/res/drawable/add_image.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/app/src/main/res/drawable/add_image.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/de.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/app/src/main/res/drawable/de.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/default_image.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/app/src/main/res/drawable/default_image.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/item_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/list_divider.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/progress_bar_states.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | -
6 |
7 |
8 |
9 |
14 |
15 |
16 | -
17 |
18 |
19 |
20 |
21 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_about.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
13 |
14 |
19 |
20 |
28 |
29 |
30 |
35 |
36 |
43 |
44 |
45 |
46 |
50 |
51 |
55 |
56 |
63 |
64 |
65 |
69 |
70 |
74 |
75 |
82 |
83 |
84 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_feedback.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
16 |
17 |
22 |
23 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_image_detail.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
10 |
11 |
12 |
13 |
23 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
16 |
17 |
18 |
19 |
22 |
23 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_reply.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_send_weibo.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
16 |
17 |
26 |
27 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_setting.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
16 |
17 |
25 |
26 |
33 |
34 |
35 |
41 |
42 |
49 |
50 |
51 |
55 |
56 |
61 |
62 |
69 |
70 |
71 |
78 |
79 |
86 |
87 |
88 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_web.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/bottom_navigation_bar.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_me.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
15 |
16 |
21 |
22 |
31 |
32 |
39 |
40 |
50 |
51 |
52 |
61 |
62 |
63 |
64 |
68 |
69 |
73 |
74 |
75 |
76 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_message.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
15 |
16 |
20 |
21 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/image_detail.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/list_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
10 |
11 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/user_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
12 |
13 |
21 |
22 |
30 |
31 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/view_toolbar.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
19 |
20 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/webview_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/weibo_image_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
21 |
22 |
29 |
30 |
33 |
34 |
43 |
44 |
52 |
53 |
54 |
59 |
60 |
66 |
67 |
75 |
76 |
77 |
78 |
79 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/weibo_text_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
19 |
20 |
27 |
28 |
31 |
32 |
41 |
42 |
50 |
51 |
52 |
59 |
60 |
61 |
62 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/weibo_with_retweet_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
11 |
21 |
22 |
27 |
28 |
39 |
40 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu_send.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_account_box_white_48dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/app/src/main/res/mipmap-xhdpi/ic_account_box_white_48dp.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_add_white_48dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/app/src/main/res/mipmap-xhdpi/ic_add_white_48dp.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_home_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/app/src/main/res/mipmap-xhdpi/ic_home_white_24dp.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_message_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/app/src/main/res/mipmap-xhdpi/ic_message_white_24dp.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_send.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/app/src/main/res/mipmap-xhdpi/ic_send.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #333333
4 | #2b2b2b
5 | #424242
6 |
7 | @color/white
8 | @color/blue
9 | #777777
10 |
11 | #e91e63
12 | #00b0ff
13 | #432e2a
14 |
15 | #FFFFFF
16 | #000000
17 | #FF5677fc
18 | #eeeeee
19 | #eeeeee
20 |
21 | #333333
22 |
23 |
--------------------------------------------------------------------------------
/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 |
6 | 48dip
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Jianwei
3 |
4 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
12 |
13 |
16 |
17 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/app/src/test/java/me/pkhope/jianwei/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package me.pkhope.jianwei;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * To work on unit tests, switch the Test Artifact in the Build Variants view.
9 | */
10 | public class ExampleUnitTest {
11 | @Test
12 | public void addition_isCorrect() throws Exception {
13 | assertEquals(4, 2 + 2);
14 | }
15 | }
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | jcenter()
6 | }
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:2.1.0'
9 |
10 | // NOTE: Do not place your application dependencies here; they belong
11 | // in the individual module build.gradle files
12 | }
13 | }
14 |
15 | allprojects {
16 | repositories {
17 | jcenter()
18 | maven { url "https://jitpack.io" }
19 | }
20 | }
21 |
22 | task clean(type: Delete) {
23 | delete rootProject.buildDir
24 | }
25 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | ## Project-wide Gradle settings.
2 | #
3 | # For more details on how to configure your build environment visit
4 | # http://www.gradle.org/docs/current/userguide/build_environment.html
5 | #
6 | # Specifies the JVM arguments used for the daemon process.
7 | # The setting is particularly useful for tweaking memory settings.
8 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
9 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
10 | #
11 | # When configured, Gradle will run in incubating parallel mode.
12 | # This option should only be used with decoupled projects. More details, visit
13 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
14 | # org.gradle.parallel=true
15 | #Fri Jun 03 12:00:43 CST 2016
16 | systemProp.http.proxyHost=127.0.0.1
17 | systemProp.http.proxyPort=1080
18 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Mon Dec 28 10:00:20 PST 2015
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
7 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/screenshot/pic1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/screenshot/pic1.jpg
--------------------------------------------------------------------------------
/screenshot/pic2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/screenshot/pic2.jpg
--------------------------------------------------------------------------------
/screenshot/pic3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CraneXHu/weibo/2167e55190c6db5be77e9bb204b6f3b445a93e87/screenshot/pic3.jpg
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app', ':WeiboSdk'
2 |
--------------------------------------------------------------------------------