aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlaco0416 <laco0416@gmail.com>2013-05-11 10:31:15 +0900
committerlaco0416 <laco0416@gmail.com>2013-05-11 10:31:15 +0900
commit14f92bb3ab554f3564c1f8fa7abf96718b67dfe9 (patch)
treefe4f1efbc07490bd39d8120afeb702cccd8f04d4
parent8669f9792961949b2331566015e503a42b7f83f0 (diff)
downloadSmileEssence-14f92bb3ab554f3564c1f8fa7abf96718b67dfe9.tar.gz
だらっしゃぁ
-rw-r--r--.classpath2
-rw-r--r--.settings/org.eclipse.core.resources.prefs2
-rw-r--r--AndroidManifest.xml8
-rw-r--r--gen/com/slidingmenu/lib/R.java72
-rw-r--r--gen/com/viewpagerindicator/R.java165
-rw-r--r--gen/net/miz_hi/smileessence/R.java1375
-rw-r--r--lint.xml3
-rw-r--r--project.properties5
-rw-r--r--res/drawable-hdpi/ic_action_overflow.pngbin0 -> 327 bytes
-rw-r--r--res/drawable-hdpi/icon_add_b.pngbin709 -> 427 bytes
-rw-r--r--res/drawable-hdpi/icon_camera.pngbin2120 -> 1922 bytes
-rw-r--r--res/drawable-hdpi/icon_clean.pngbin2936 -> 3012 bytes
-rw-r--r--res/drawable-hdpi/icon_edit.pngbin0 -> 815 bytes
-rw-r--r--res/drawable-hdpi/icon_favorite.pngbin979 -> 701 bytes
-rw-r--r--res/drawable-hdpi/icon_menu.pngbin1002 -> 610 bytes
-rw-r--r--res/drawable-hdpi/icon_pict.pngbin1693 -> 1501 bytes
-rw-r--r--res/drawable-hdpi/icon_property.pngbin0 -> 619 bytes
-rw-r--r--res/drawable-hdpi/icon_reply.pngbin1376 -> 1294 bytes
-rw-r--r--res/drawable-hdpi/icon_retweet.pngbin883 -> 619 bytes
-rw-r--r--res/drawable-hdpi/icon_right.pngbin0 -> 270 bytes
-rw-r--r--res/drawable-hdpi/icon_row.pngbin0 -> 233 bytes
-rw-r--r--res/drawable-hdpi/icon_twitter.pngbin0 -> 1873 bytes
-rw-r--r--res/layout/checkboxitem_layout.xml10
-rw-r--r--res/layout/dialog_auth_layout.xml23
-rw-r--r--res/layout/dialog_base_layout.xml37
-rw-r--r--res/layout/dialog_review.xml (renamed from res/layout/dialog_review_layout.xml)27
-rw-r--r--res/layout/dialog_seekbar_layout.xml43
-rw-r--r--res/layout/dialog_statuscommand_layout.xml44
-rw-r--r--res/layout/listedit_layout.xml (renamed from res/layout/extrawordactivity_layout.xml)103
-rw-r--r--res/layout/listpage_layout.xml34
-rw-r--r--res/layout/main_layout.xml87
-rw-r--r--res/layout/mainactivity_layout.xml11
-rw-r--r--res/layout/menuitem_gray.xml (renamed from res/layout/menuitem_layout.xml)10
-rw-r--r--res/layout/menuitem_white.xml19
-rw-r--r--res/layout/menuparent_white.xml21
-rw-r--r--res/layout/post_layout.xml182
-rw-r--r--res/layout/simplebutton.xml9
-rw-r--r--res/layout/statusmenu_header.xml85
-rw-r--r--res/layout/templateactivity_layout.xml48
-rw-r--r--res/layout/tweet_layout.xml146
-rw-r--r--res/layout/useractivity_layout.xml256
-rw-r--r--res/layout/userinfo_layout.xml287
-rw-r--r--res/menu/menu_main.xml9
-rw-r--r--res/values/colors.xml3
-rw-r--r--res/values/strings.xml4
-rw-r--r--res/values/styles.xml46
-rw-r--r--res/xml/graybtn_selector.xml11
-rw-r--r--res/xml/preference.xml16
-rw-r--r--res/xml/whitebtn_selector.xml11
-rw-r--r--src/net/miz_hi/smileessence/Client.java7
-rw-r--r--src/net/miz_hi/smileessence/async/AsyncFavoriteTask.java26
-rw-r--r--src/net/miz_hi/smileessence/async/AsyncIconGetter.java2
-rw-r--r--src/net/miz_hi/smileessence/async/AsyncMentionsGetter.java2
-rw-r--r--src/net/miz_hi/smileessence/async/AsyncRetweetTask.java3
-rw-r--r--src/net/miz_hi/smileessence/async/AsyncTimelineGetter.java2
-rw-r--r--src/net/miz_hi/smileessence/async/AsyncTweetTask.java10
-rw-r--r--src/net/miz_hi/smileessence/auth/AuthorizeHelper.java7
-rw-r--r--src/net/miz_hi/smileessence/command/CommandAddTemplate.java4
-rw-r--r--src/net/miz_hi/smileessence/command/CommandEditMenu.java22
-rw-r--r--src/net/miz_hi/smileessence/command/CommandMenuBack.java37
-rw-r--r--src/net/miz_hi/smileessence/command/CommandMenuParent.java39
-rw-r--r--src/net/miz_hi/smileessence/command/CommandOpenPostPage.java21
-rw-r--r--src/net/miz_hi/smileessence/command/CommandParseMorse.java25
-rw-r--r--src/net/miz_hi/smileessence/command/CommandReConnect.java3
-rw-r--r--src/net/miz_hi/smileessence/command/CommandReport.java26
-rw-r--r--src/net/miz_hi/smileessence/command/CommandTweet.java20
-rw-r--r--src/net/miz_hi/smileessence/command/MenuCommand.java4
-rw-r--r--src/net/miz_hi/smileessence/command/main/CommandOpenFavstar.java (renamed from src/net/miz_hi/smileessence/command/CommandOpenFavstar.java)3
-rw-r--r--src/net/miz_hi/smileessence/command/main/CommandOpenFollowers.java (renamed from src/net/miz_hi/smileessence/command/CommandOpenFollowers.java)3
-rw-r--r--src/net/miz_hi/smileessence/command/main/CommandOpenFriends.java (renamed from src/net/miz_hi/smileessence/command/CommandOpenFriends.java)3
-rw-r--r--src/net/miz_hi/smileessence/command/main/CommandOpenSetting.java (renamed from src/net/miz_hi/smileessence/command/CommandOpenSetting.java)3
-rw-r--r--src/net/miz_hi/smileessence/command/main/CommandReport.java25
-rw-r--r--src/net/miz_hi/smileessence/command/post/CommandAppendHashtag.java (renamed from src/net/miz_hi/smileessence/command/CommandAppendHashtag.java)9
-rw-r--r--src/net/miz_hi/smileessence/command/post/CommandInsertText.java (renamed from src/net/miz_hi/smileessence/command/CommandInsertText.java)8
-rw-r--r--src/net/miz_hi/smileessence/command/post/CommandParseMorse.java27
-rw-r--r--src/net/miz_hi/smileessence/command/status/StatusCommandAddReply.java27
-rw-r--r--src/net/miz_hi/smileessence/command/status/StatusCommandChaseRelation.java101
-rw-r--r--src/net/miz_hi/smileessence/command/status/StatusCommandClipboard.java8
-rw-r--r--src/net/miz_hi/smileessence/command/status/StatusCommandCongrats.java10
-rw-r--r--src/net/miz_hi/smileessence/command/status/StatusCommandCopy.java32
-rw-r--r--src/net/miz_hi/smileessence/command/status/StatusCommandDelete.java8
-rw-r--r--src/net/miz_hi/smileessence/command/status/StatusCommandFavAndRetweet.java9
-rw-r--r--src/net/miz_hi/smileessence/command/status/StatusCommandFavorite.java31
-rw-r--r--src/net/miz_hi/smileessence/command/status/StatusCommandNanigaja.java2
-rw-r--r--src/net/miz_hi/smileessence/command/status/StatusCommandReply.java26
-rw-r--r--src/net/miz_hi/smileessence/command/status/StatusCommandRetweet.java61
-rw-r--r--src/net/miz_hi/smileessence/command/status/StatusCommandReview.java88
-rw-r--r--src/net/miz_hi/smileessence/command/status/StatusCommandThankToFav.java10
-rw-r--r--src/net/miz_hi/smileessence/command/status/StatusCommandTofuBuster.java4
-rw-r--r--src/net/miz_hi/smileessence/command/status/StatusCommandUnOffFav.java32
-rw-r--r--src/net/miz_hi/smileessence/command/status/StatusCommandUnOffRetweet.java7
-rw-r--r--src/net/miz_hi/smileessence/command/status/StatusCommandUnfavorite.java8
-rw-r--r--src/net/miz_hi/smileessence/command/status/StatusCommandWarotaRT.java33
-rw-r--r--src/net/miz_hi/smileessence/command/user/UserCommandAddReply.java27
-rw-r--r--src/net/miz_hi/smileessence/command/user/UserCommandBlock.java6
-rw-r--r--src/net/miz_hi/smileessence/command/user/UserCommandFollow.java6
-rw-r--r--src/net/miz_hi/smileessence/command/user/UserCommandOpenInfo.java46
-rw-r--r--src/net/miz_hi/smileessence/command/user/UserCommandOpenProfiel.java31
-rw-r--r--src/net/miz_hi/smileessence/command/user/UserCommandOpenTimeline.java54
-rw-r--r--src/net/miz_hi/smileessence/command/user/UserCommandRemove.java6
-rw-r--r--src/net/miz_hi/smileessence/command/user/UserCommandReply.java7
-rw-r--r--src/net/miz_hi/smileessence/command/user/UserCommandSpam.java6
-rw-r--r--src/net/miz_hi/smileessence/core/DataBaseHelper.java22
-rw-r--r--src/net/miz_hi/smileessence/core/Notifier.java121
-rw-r--r--src/net/miz_hi/smileessence/data/UserModel.java73
-rw-r--r--src/net/miz_hi/smileessence/data/extra/ExtraWordListAdapter.java5
-rw-r--r--src/net/miz_hi/smileessence/data/extra/ExtraWords.java20
-rw-r--r--src/net/miz_hi/smileessence/data/page/Page.java59
-rw-r--r--src/net/miz_hi/smileessence/data/page/PageDB.java102
-rw-r--r--src/net/miz_hi/smileessence/data/page/Pages.java84
-rw-r--r--src/net/miz_hi/smileessence/data/template/TemplateListAdapter.java5
-rw-r--r--src/net/miz_hi/smileessence/dialog/AuthDialogHelper.java62
-rw-r--r--src/net/miz_hi/smileessence/dialog/CheckBoxListDialog.java104
-rw-r--r--src/net/miz_hi/smileessence/dialog/CheckBoxListDialogHelper.java116
-rw-r--r--src/net/miz_hi/smileessence/dialog/ConfirmDialog.java (renamed from src/net/miz_hi/smileessence/dialog/YesNoDialogHelper.java)40
-rw-r--r--src/net/miz_hi/smileessence/dialog/ContentDialog.java58
-rw-r--r--src/net/miz_hi/smileessence/dialog/DialogAdapter.java206
-rw-r--r--src/net/miz_hi/smileessence/dialog/ExpandMenuDialog.java119
-rw-r--r--src/net/miz_hi/smileessence/dialog/MenuDialog.java45
-rw-r--r--src/net/miz_hi/smileessence/dialog/OneButtonDialog.java78
-rw-r--r--src/net/miz_hi/smileessence/dialog/ProgressDialogHelper.java21
-rw-r--r--src/net/miz_hi/smileessence/dialog/ReviewDialog.java62
-rw-r--r--src/net/miz_hi/smileessence/dialog/ReviewDialogHelper.java103
-rw-r--r--src/net/miz_hi/smileessence/dialog/SeekBarDialog.java (renamed from src/net/miz_hi/smileessence/dialog/SeekBarDialogHelper.java)17
-rw-r--r--src/net/miz_hi/smileessence/dialog/SimpleDialogHelper.java37
-rw-r--r--src/net/miz_hi/smileessence/dialog/SimpleMenuDialog.java99
-rw-r--r--src/net/miz_hi/smileessence/event/Event.java58
-rw-r--r--src/net/miz_hi/smileessence/event/EventCommandDialog.java49
-rw-r--r--src/net/miz_hi/smileessence/event/EventViewFactory.java12
-rw-r--r--src/net/miz_hi/smileessence/event/FavoriteEvent.java2
-rw-r--r--src/net/miz_hi/smileessence/event/HistoryListAdapter.java11
-rw-r--r--src/net/miz_hi/smileessence/event/ReplyEvent.java2
-rw-r--r--src/net/miz_hi/smileessence/event/RetweetEvent.java2
-rw-r--r--src/net/miz_hi/smileessence/event/StatusEventModel.java (renamed from src/net/miz_hi/smileessence/event/StatusEvent.java)4
-rw-r--r--src/net/miz_hi/smileessence/event/ToastManager.java124
-rw-r--r--src/net/miz_hi/smileessence/event/UnfavoriteEvent.java2
-rw-r--r--src/net/miz_hi/smileessence/listener/EventOnClickListener.java5
-rw-r--r--src/net/miz_hi/smileessence/listener/ExtraWordOnClickListener.java116
-rw-r--r--src/net/miz_hi/smileessence/listener/MyUserStreamListener.java72
-rw-r--r--src/net/miz_hi/smileessence/listener/PageChangeListener.java59
-rw-r--r--src/net/miz_hi/smileessence/listener/PostEditTextListener.java57
-rw-r--r--src/net/miz_hi/smileessence/listener/StatusOnClickListener.java7
-rw-r--r--src/net/miz_hi/smileessence/listener/TemplateOnClickListener.java110
-rw-r--r--src/net/miz_hi/smileessence/listener/TweetViewTouchListener.java83
-rw-r--r--src/net/miz_hi/smileessence/menu/EventMenu.java44
-rw-r--r--src/net/miz_hi/smileessence/menu/ExpandMenuListAdapter.java135
-rw-r--r--src/net/miz_hi/smileessence/menu/MainMenu.java59
-rw-r--r--src/net/miz_hi/smileessence/menu/MenuListAdapter.java62
-rw-r--r--src/net/miz_hi/smileessence/menu/StatusMenu.java279
-rw-r--r--src/net/miz_hi/smileessence/menu/TweetMenu.java102
-rw-r--r--src/net/miz_hi/smileessence/menu/UserMenu.java37
-rw-r--r--src/net/miz_hi/smileessence/permission/PermissonChecker.java2
-rw-r--r--src/net/miz_hi/smileessence/preference/EnumPreferenceKey.java3
-rw-r--r--src/net/miz_hi/smileessence/status/StatusUtils.java39
-rw-r--r--src/net/miz_hi/smileessence/status/StatusViewFactory.java3
-rw-r--r--src/net/miz_hi/smileessence/system/MainSystem.java208
-rw-r--r--src/net/miz_hi/smileessence/system/PostSystem.java206
-rw-r--r--src/net/miz_hi/smileessence/system/RelationSystem.java113
-rw-r--r--src/net/miz_hi/smileessence/system/TweetSystem.java171
-rw-r--r--src/net/miz_hi/smileessence/twitter/TwitterManager.java (renamed from src/net/miz_hi/smileessence/util/TwitterManager.java)24
-rw-r--r--src/net/miz_hi/smileessence/util/ExtendedBoolean.java43
-rw-r--r--src/net/miz_hi/smileessence/util/LogHelper.java2
-rw-r--r--src/net/miz_hi/smileessence/util/NamedFragment.java24
-rw-r--r--src/net/miz_hi/smileessence/util/NamedFragmentPagerAdapter.java143
-rw-r--r--src/net/miz_hi/smileessence/util/NetworkUtils.java22
-rw-r--r--src/net/miz_hi/smileessence/view/DirectMessageFragment.java26
-rw-r--r--src/net/miz_hi/smileessence/view/ExtraWordActivity.java23
-rw-r--r--src/net/miz_hi/smileessence/view/ExtractFragment.java79
-rw-r--r--src/net/miz_hi/smileessence/view/HistoryFragment.java (renamed from src/net/miz_hi/smileessence/view/HistoryListPageFragment.java)28
-rw-r--r--src/net/miz_hi/smileessence/view/HomeFragment.java45
-rw-r--r--src/net/miz_hi/smileessence/view/HomeListPageFragment.java37
-rw-r--r--src/net/miz_hi/smileessence/view/IRemainable.java10
-rw-r--r--src/net/miz_hi/smileessence/view/IRemovable.java6
-rw-r--r--src/net/miz_hi/smileessence/view/ListFragment.java26
-rw-r--r--src/net/miz_hi/smileessence/view/ListPagerAdapter.java103
-rw-r--r--src/net/miz_hi/smileessence/view/MainActivity.java476
-rw-r--r--src/net/miz_hi/smileessence/view/MentionsFragment.java43
-rw-r--r--src/net/miz_hi/smileessence/view/MentionsListPageFragment.java37
-rw-r--r--src/net/miz_hi/smileessence/view/PostFragment.java383
-rw-r--r--src/net/miz_hi/smileessence/view/RelationFragment.java93
-rw-r--r--src/net/miz_hi/smileessence/view/RelationListPageFragment.java55
-rw-r--r--src/net/miz_hi/smileessence/view/SettingActivity.java53
-rw-r--r--src/net/miz_hi/smileessence/view/TemplateActivity.java23
-rw-r--r--src/net/miz_hi/smileessence/view/TweetView.java393
-rw-r--r--src/net/miz_hi/smileessence/view/UserActivity.java206
-rw-r--r--src/net/miz_hi/smileessence/view/UserInfoFragment.java154
-rw-r--r--src/net/miz_hi/smileessence/view/UserTimelineFragment.java83
187 files changed, 6384 insertions, 4393 deletions
diff --git a/.classpath b/.classpath
index 9db2e41e..ef1fee7a 100644
--- a/.classpath
+++ b/.classpath
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="src"/>
+ <classpathentry excluding="net/miz_hi/smileessence/view/TweetView.java|net/miz_hi/smileessence/listener/TweetViewTouchListener.java|net/miz_hi/smileessence/view/UserActivity.java" kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs
index 877361b9..277a3903 100644
--- a/.settings/org.eclipse.core.resources.prefs
+++ b/.settings/org.eclipse.core.resources.prefs
@@ -1,3 +1,3 @@
eclipse.preferences.version=1
encoding//src/net/miz_hi/smileessence/command/status/StatusCommandNanigaja.java=UTF-8
-encoding//src/net/miz_hi/smileessence/util/TwitterManager.java=UTF-8
+encoding//src/net/miz_hi/smileessence/twitter/TwitterManager.java=UTF-8
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index e23e85ac..d430798b 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -1,19 +1,19 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
-<manifest android:versionCode="19" android:versionName="beta1.3.4" package="net.miz_hi.smileessence" xmlns:android="http://schemas.android.com/apk/res/android">
+<manifest android:versionCode="21" android:versionName="beta1.4.0" package="net.miz_hi.smileessence" xmlns:android="http://schemas.android.com/apk/res/android">
- <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="10"/>
+ <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="14"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
+ <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<application android:allowBackup="true" android:debuggable="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:name="net.miz_hi.smileessence.ClientApplication" android:theme="@style/AppTheme">
- <activity android:label="@string/app_name" android:name=".view.MainActivity" android:launchMode="singleTask" android:windowSoftInputMode="adjustResize" android:configChanges="keyboardHidden|orientation|screenLayout">
+ <activity android:label="@string/app_name" android:name=".view.MainActivity" android:launchMode="singleTask" android:windowSoftInputMode="stateHidden|adjustNothing" android:configChanges="keyboardHidden|orientation|screenSize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity><activity android:launchMode="standard" android:name=".view.WebViewActivity" android:configChanges="keyboardHidden|orientation"/>
<activity android:name=".view.SettingActivity" android:launchMode="standard" android:configChanges="keyboardHidden|orientation"></activity>
- <activity android:name=".view.UserActivity" android:configChanges="keyboard|orientation"></activity>
<activity android:name=".view.TemplateActivity" android:configChanges="orientation"></activity>
<activity android:name=".view.ExtraWordActivity" android:configChanges="orientation"></activity>
</application>
diff --git a/gen/com/slidingmenu/lib/R.java b/gen/com/slidingmenu/lib/R.java
deleted file mode 100644
index d769f9e3..00000000
--- a/gen/com/slidingmenu/lib/R.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/* AUTO-GENERATED FILE. DO NOT MODIFY.
- *
- * This class was automatically generated by the
- * aapt tool from the resource data it found. It
- * should not be modified by hand.
- */
-package com.slidingmenu.lib;
-
-public final class R {
- public static final class id {
- public static final int fullscreen = 0x7f050003;
- public static final int slidingmenumain = 0x7f05001c;
- public static final int slidingmenulayout = 0x7f05001d;
- public static final int slidingmenurowicon = 0x7f05001e;
- public static final int selected_view = 0x7f050004;
- public static final int slidingmenurowtitle = 0x7f05001f;
- public static final int margin = 0x7f050002;
- public static final int left = 0x7f050000;
- public static final int right = 0x7f050001;
- }
- public static final class color {
- public static final int holo_blue_bright = 0x7f060000;
- }
- public static final class layout {
- public static final int slidingmenumain = 0x7f03000e;
- public static final int list = 0x7f030009;
- public static final int slidingmenurow = 0x7f030010;
- public static final int slidingmenumainlist = 0x7f03000f;
- public static final int shadow = 0x7f03000d;
- }
- public static final class styleable {
- public static final int SlidingMenu_mode = 0;
- public static final int SlidingMenu_behindFadeEnabled = 9;
- public static final int SlidingMenu_shadowWidth = 8;
- public static final int SlidingMenu_behindWidth = 4;
- public static final int SlidingMenu_touchModeAbove = 6;
- public static final int SlidingMenu_shadowDrawable = 7;
- public static final int SlidingMenu_behindOffset = 3;
- public static final int SlidingMenu_selectorDrawable = 12;
- public static final int SlidingMenu_viewAbove = 1;
- public static final int SlidingMenu_behindScrollScale = 5;
- public static final int SlidingMenu_selectorEnabled = 11;
- public static final int[] SlidingMenu = { 0x7f010000, 0x7f010001, 0x7f010002, 0x7f010003, 0x7f010004, 0x7f010005, 0x7f010006, 0x7f010007, 0x7f010008, 0x7f010009, 0x7f01000a, 0x7f01000b, 0x7f01000c };
- public static final int SlidingMenu_viewBehind = 2;
- public static final int SlidingMenu_behindFadeDegree = 10;
- }
- public static final class drawable {
- public static final int defaultshadowright = 0x7f020001;
- public static final int defaultshadow = 0x7f020000;
- }
- public static final class attr {
- public static final int shadowWidth = 0x7f010008;
- public static final int shadowDrawable = 0x7f010007;
- public static final int viewAbove = 0x7f010001;
- public static final int behindScrollScale = 0x7f010005;
- public static final int touchModeAbove = 0x7f010006;
- public static final int mode = 0x7f010000;
- public static final int selectorDrawable = 0x7f01000c;
- public static final int behindWidth = 0x7f010004;
- public static final int selectorEnabled = 0x7f01000b;
- public static final int behindOffset = 0x7f010003;
- public static final int behindFadeDegree = 0x7f01000a;
- public static final int viewBehind = 0x7f010002;
- public static final int behindFadeEnabled = 0x7f010009;
- }
- public static final class dimen {
- public static final int menu_item_padding = 0x7f070000;
- public static final int menu_header_line = 0x7f070002;
- public static final int menu_icon_side = 0x7f070003;
- public static final int menu_header_padding_top = 0x7f070001;
- }
-}
diff --git a/gen/com/viewpagerindicator/R.java b/gen/com/viewpagerindicator/R.java
new file mode 100644
index 00000000..68fb3dc9
--- /dev/null
+++ b/gen/com/viewpagerindicator/R.java
@@ -0,0 +1,165 @@
+/* AUTO-GENERATED FILE. DO NOT MODIFY.
+ *
+ * This class was automatically generated by the
+ * aapt tool from the resource data it found. It
+ * should not be modified by hand.
+ */
+package com.viewpagerindicator;
+
+public final class R {
+ public static final class id {
+ public static final int bottom = 0x7f060003;
+ public static final int none = 0x7f060000;
+ public static final int triangle = 0x7f060001;
+ public static final int underline = 0x7f060002;
+ public static final int top = 0x7f060004;
+ }
+ public static final class style {
+ public static final int Widget_TabPageIndicator = 0x7f0b0002;
+ public static final int Theme_PageIndicatorDefaults = 0x7f0b0000;
+ public static final int TextAppearance_TabPageIndicator = 0x7f0b0003;
+ public static final int Widget = 0x7f0b0001;
+ public static final int Widget_IconPageIndicator = 0x7f0b0004;
+ }
+ public static final class integer {
+ public static final int default_underline_indicator_fade_delay = 0x7f090003;
+ public static final int default_circle_indicator_orientation = 0x7f090000;
+ public static final int default_underline_indicator_fade_length = 0x7f090004;
+ public static final int default_title_indicator_footer_indicator_style = 0x7f090001;
+ public static final int default_title_indicator_line_position = 0x7f090002;
+ }
+ public static final class color {
+ public static final int vpi__bright_foreground_disabled_holo_dark = 0x7f070004;
+ public static final int vpi__light_theme = 0x7f070020;
+ public static final int vpi__background_holo_light = 0x7f070001;
+ public static final int default_title_indicator_text_color = 0x7f07000f;
+ public static final int vpi__background_holo_dark = 0x7f070000;
+ public static final int default_title_indicator_footer_color = 0x7f07000d;
+ public static final int default_title_indicator_selected_color = 0x7f07000e;
+ public static final int vpi__bright_foreground_inverse_holo_dark = 0x7f070006;
+ public static final int default_line_indicator_selected_color = 0x7f07000b;
+ public static final int default_circle_indicator_fill_color = 0x7f070008;
+ public static final int vpi__bright_foreground_disabled_holo_light = 0x7f070005;
+ public static final int vpi__bright_foreground_inverse_holo_light = 0x7f070007;
+ public static final int default_line_indicator_unselected_color = 0x7f07000c;
+ public static final int default_underline_indicator_selected_color = 0x7f070010;
+ public static final int vpi__bright_foreground_holo_dark = 0x7f070002;
+ public static final int vpi__dark_theme = 0x7f07001f;
+ public static final int default_circle_indicator_stroke_color = 0x7f07000a;
+ public static final int vpi__bright_foreground_holo_light = 0x7f070003;
+ public static final int default_circle_indicator_page_color = 0x7f070009;
+ }
+ public static final class styleable {
+ public static final int LinePageIndicator_android_background = 0;
+ public static final int[] UnderlinePageIndicator = { 0x010100d4, 0x7f010007, 0x7f01001c, 0x7f01001d, 0x7f01001e };
+ public static final int TitlePageIndicator_selectedBold = 12;
+ public static final int CirclePageIndicator_pageColor = 5;
+ public static final int UnderlinePageIndicator_fades = 2;
+ public static final int UnderlinePageIndicator_android_background = 0;
+ public static final int TitlePageIndicator_android_background = 2;
+ public static final int LinePageIndicator_lineWidth = 5;
+ public static final int TitlePageIndicator_clipPadding = 4;
+ public static final int TitlePageIndicator_topPadding = 14;
+ public static final int CirclePageIndicator_snap = 7;
+ public static final int ViewPagerIndicator_vpiTabPageIndicatorStyle = 4;
+ public static final int UnderlinePageIndicator_fadeLength = 4;
+ public static final int[] LinePageIndicator = { 0x010100d4, 0x7f010006, 0x7f010007, 0x7f010008, 0x7f010009, 0x7f01000f, 0x7f010010 };
+ public static final int ViewPagerIndicator_vpiTitlePageIndicatorStyle = 3;
+ public static final int CirclePageIndicator_radius = 6;
+ public static final int LinePageIndicator_strokeWidth = 3;
+ public static final int TitlePageIndicator_android_textSize = 0;
+ public static final int TitlePageIndicator_footerIndicatorHeight = 8;
+ public static final int CirclePageIndicator_strokeWidth = 3;
+ public static final int[] ViewPagerIndicator = { 0x7f010000, 0x7f010001, 0x7f010002, 0x7f010003, 0x7f010004, 0x7f010005 };
+ public static final int TitlePageIndicator_footerIndicatorStyle = 7;
+ public static final int CirclePageIndicator_android_background = 1;
+ public static final int ViewPagerIndicator_vpiCirclePageIndicatorStyle = 0;
+ public static final int CirclePageIndicator_strokeColor = 8;
+ public static final int TitlePageIndicator_linePosition = 11;
+ public static final int UnderlinePageIndicator_fadeDelay = 3;
+ public static final int LinePageIndicator_gapWidth = 6;
+ public static final int TitlePageIndicator_footerPadding = 10;
+ public static final int TitlePageIndicator_footerLineHeight = 6;
+ public static final int CirclePageIndicator_centered = 2;
+ public static final int TitlePageIndicator_titlePadding = 13;
+ public static final int ViewPagerIndicator_vpiIconPageIndicatorStyle = 1;
+ public static final int[] CirclePageIndicator = { 0x010100c4, 0x010100d4, 0x7f010006, 0x7f010008, 0x7f01000a, 0x7f01000b, 0x7f01000c, 0x7f01000d, 0x7f01000e };
+ public static final int TitlePageIndicator_footerIndicatorUnderlinePadding = 9;
+ public static final int TitlePageIndicator_android_textColor = 1;
+ public static final int CirclePageIndicator_android_orientation = 0;
+ public static final int CirclePageIndicator_fillColor = 4;
+ public static final int LinePageIndicator_unselectedColor = 4;
+ public static final int ViewPagerIndicator_vpiLinePageIndicatorStyle = 2;
+ public static final int[] TitlePageIndicator = { 0x01010095, 0x01010098, 0x010100d4, 0x7f010007, 0x7f010011, 0x7f010012, 0x7f010013, 0x7f010014, 0x7f010015, 0x7f010016, 0x7f010017, 0x7f010018, 0x7f010019, 0x7f01001a, 0x7f01001b };
+ public static final int LinePageIndicator_selectedColor = 2;
+ public static final int UnderlinePageIndicator_selectedColor = 1;
+ public static final int TitlePageIndicator_selectedColor = 3;
+ public static final int ViewPagerIndicator_vpiUnderlinePageIndicatorStyle = 5;
+ public static final int TitlePageIndicator_footerColor = 5;
+ public static final int LinePageIndicator_centered = 1;
+ }
+ public static final class drawable {
+ public static final int vpi__tab_selected_pressed_holo = 0x7f020020;
+ public static final int vpi__tab_selected_focused_holo = 0x7f02001e;
+ public static final int vpi__tab_selected_holo = 0x7f02001f;
+ public static final int vpi__tab_unselected_focused_holo = 0x7f020021;
+ public static final int vpi__tab_unselected_holo = 0x7f020022;
+ public static final int vpi__tab_indicator = 0x7f02001d;
+ public static final int vpi__tab_unselected_pressed_holo = 0x7f020023;
+ }
+ public static final class attr {
+ public static final int footerIndicatorStyle = 0x7f010014;
+ public static final int fillColor = 0x7f01000a;
+ public static final int vpiIconPageIndicatorStyle = 0x7f010001;
+ public static final int vpiCirclePageIndicatorStyle = 0x7f010000;
+ public static final int snap = 0x7f01000d;
+ public static final int clipPadding = 0x7f010011;
+ public static final int footerColor = 0x7f010012;
+ public static final int topPadding = 0x7f01001b;
+ public static final int vpiLinePageIndicatorStyle = 0x7f010002;
+ public static final int fadeDelay = 0x7f01001d;
+ public static final int unselectedColor = 0x7f010009;
+ public static final int footerLineHeight = 0x7f010013;
+ public static final int fades = 0x7f01001c;
+ public static final int selectedColor = 0x7f010007;
+ public static final int footerPadding = 0x7f010017;
+ public static final int footerIndicatorUnderlinePadding = 0x7f010016;
+ public static final int titlePadding = 0x7f01001a;
+ public static final int vpiUnderlinePageIndicatorStyle = 0x7f010005;
+ public static final int strokeWidth = 0x7f010008;
+ public static final int vpiTabPageIndicatorStyle = 0x7f010004;
+ public static final int footerIndicatorHeight = 0x7f010015;
+ public static final int centered = 0x7f010006;
+ public static final int linePosition = 0x7f010018;
+ public static final int lineWidth = 0x7f01000f;
+ public static final int pageColor = 0x7f01000b;
+ public static final int strokeColor = 0x7f01000e;
+ public static final int vpiTitlePageIndicatorStyle = 0x7f010003;
+ public static final int radius = 0x7f01000c;
+ public static final int gapWidth = 0x7f010010;
+ public static final int selectedBold = 0x7f010019;
+ public static final int fadeLength = 0x7f01001e;
+ }
+ public static final class bool {
+ public static final int default_title_indicator_selected_bold = 0x7f080003;
+ public static final int default_underline_indicator_fades = 0x7f080004;
+ public static final int default_line_indicator_centered = 0x7f080002;
+ public static final int default_circle_indicator_centered = 0x7f080000;
+ public static final int default_circle_indicator_snap = 0x7f080001;
+ }
+ public static final class dimen {
+ public static final int default_title_indicator_footer_line_height = 0x7f0a0006;
+ public static final int default_line_indicator_gap_width = 0x7f0a0003;
+ public static final int default_line_indicator_line_width = 0x7f0a0002;
+ public static final int default_title_indicator_title_padding = 0x7f0a000b;
+ public static final int default_title_indicator_text_size = 0x7f0a000a;
+ public static final int default_title_indicator_clip_padding = 0x7f0a0005;
+ public static final int default_title_indicator_footer_indicator_underline_padding = 0x7f0a0008;
+ public static final int default_line_indicator_stroke_width = 0x7f0a0004;
+ public static final int default_circle_indicator_radius = 0x7f0a0000;
+ public static final int default_title_indicator_footer_indicator_height = 0x7f0a0007;
+ public static final int default_title_indicator_footer_padding = 0x7f0a0009;
+ public static final int default_title_indicator_top_padding = 0x7f0a000c;
+ public static final int default_circle_indicator_stroke_width = 0x7f0a0001;
+ }
+}
diff --git a/gen/net/miz_hi/smileessence/R.java b/gen/net/miz_hi/smileessence/R.java
index 301e45fb..28b868f6 100644
--- a/gen/net/miz_hi/smileessence/R.java
+++ b/gen/net/miz_hi/smileessence/R.java
@@ -8,42 +8,90 @@
package net.miz_hi.smileessence;
public final class R {
+ public static final class anim {
+ public static final int gd_grow_from_bottom=0x7f040000;
+ public static final int gd_grow_from_bottomleft_to_topright=0x7f040001;
+ public static final int gd_grow_from_bottomright_to_topleft=0x7f040002;
+ public static final int gd_grow_from_top=0x7f040003;
+ public static final int gd_grow_from_topleft_to_bottomright=0x7f040004;
+ public static final int gd_grow_from_topright_to_bottomleft=0x7f040005;
+ public static final int gd_rack=0x7f040006;
+ public static final int gd_shrink_from_bottom=0x7f040007;
+ public static final int gd_shrink_from_bottomleft_to_topright=0x7f040008;
+ public static final int gd_shrink_from_bottomright_to_topleft=0x7f040009;
+ public static final int gd_shrink_from_top=0x7f04000a;
+ public static final int gd_shrink_from_topleft_to_bottomright=0x7f04000b;
+ public static final int gd_shrink_from_topright_to_bottomleft=0x7f04000c;
+ }
public static final class attr {
- /** <p>Must be a floating point value, such as "<code>1.2</code>".
+ /** <p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
- public static final int behindFadeDegree=0x7f01000a;
- /** <p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
+ public static final int centered=0x7f010006;
+ /** Screen edge padding.
+ <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
+Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
+in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
- public static final int behindFadeEnabled=0x7f010009;
- /** <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
-Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
-in (inches), mm (millimeters).
+ public static final int clipPadding=0x7f010011;
+ /** Length of the delay to fade the indicator.
+ <p>Must be an integer value, such as "<code>100</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
- public static final int behindOffset=0x7f010003;
- /** <p>Must be a floating point value, such as "<code>1.2</code>".
+ public static final int fadeDelay=0x7f01001d;
+ /** Length of the indicator fade to transparent.
+ <p>Must be an integer value, such as "<code>100</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
- public static final int behindScrollScale=0x7f010005;
- /** <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
+ public static final int fadeLength=0x7f01001e;
+ /** Whether or not the selected indicator fades.
+ <p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
+<p>This may also be a reference to a resource (in the form
+"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
+theme attribute (in the form
+"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
+containing a value of this type.
+ */
+ public static final int fades=0x7f01001c;
+ /** Color of the filled circle that represents the current page.
+ <p>Must be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>",
+"<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>".
+<p>This may also be a reference to a resource (in the form
+"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
+theme attribute (in the form
+"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
+containing a value of this type.
+ */
+ public static final int fillColor=0x7f01000a;
+ /** Color of the footer line and indicator.
+ <p>Must be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>",
+"<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>".
+<p>This may also be a reference to a resource (in the form
+"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
+theme attribute (in the form
+"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
+containing a value of this type.
+ */
+ public static final int footerColor=0x7f010012;
+ /** Height of the indicator above the footer line.
+ <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
@@ -52,35 +100,55 @@ theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
- public static final int behindWidth=0x7f010004;
- /** <p>Must be one of the following constant values.</p>
+ public static final int footerIndicatorHeight=0x7f010015;
+ /** Style of the indicator. Default is triangle.
+ <p>Must be one of the following constant values.</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Constant</th><th>Value</th><th>Description</th></tr>
-<tr><td><code>left</code></td><td>0</td><td></td></tr>
-<tr><td><code>right</code></td><td>1</td><td></td></tr>
+<tr><td><code>none</code></td><td>0</td><td></td></tr>
+<tr><td><code>triangle</code></td><td>1</td><td></td></tr>
+<tr><td><code>underline</code></td><td>2</td><td></td></tr>
</table>
*/
- public static final int mode=0x7f010000;
- /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
-or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
+ public static final int footerIndicatorStyle=0x7f010014;
+ /** Left and right padding of the underline indicator.
+ <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
+Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
+in (inches), mm (millimeters).
+<p>This may also be a reference to a resource (in the form
+"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
+theme attribute (in the form
+"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
+containing a value of this type.
*/
- public static final int selectorDrawable=0x7f01000c;
- /** <p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
+ public static final int footerIndicatorUnderlinePadding=0x7f010016;
+ /** Height of the footer line.
+ <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
+Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
+in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
- public static final int selectorEnabled=0x7f01000b;
- /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
-or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
+ public static final int footerLineHeight=0x7f010013;
+ /** Padding between the bottom of the title and the footer.
+ <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
+Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
+in (inches), mm (millimeters).
+<p>This may also be a reference to a resource (in the form
+"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
+theme attribute (in the form
+"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
+containing a value of this type.
*/
- public static final int shadowDrawable=0x7f010007;
- /** <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
+ public static final int footerPadding=0x7f010017;
+ /** Width of the gap between each indicator line.
+ <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
@@ -89,59 +157,227 @@ theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
- public static final int shadowWidth=0x7f010008;
- /** <p>Must be one of the following constant values.</p>
+ public static final int gapWidth=0x7f010010;
+ /** Position of the line.
+ <p>Must be one of the following constant values.</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Constant</th><th>Value</th><th>Description</th></tr>
-<tr><td><code>margin</code></td><td>0</td><td></td></tr>
-<tr><td><code>fullscreen</code></td><td>1</td><td></td></tr>
+<tr><td><code>bottom</code></td><td>0</td><td></td></tr>
+<tr><td><code>top</code></td><td>1</td><td></td></tr>
</table>
*/
- public static final int touchModeAbove=0x7f010006;
- /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
+ public static final int linePosition=0x7f010018;
+ /** Width of each indicator line.
+ <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
+Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
+in (inches), mm (millimeters).
+<p>This may also be a reference to a resource (in the form
+"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
+theme attribute (in the form
+"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
+containing a value of this type.
+ */
+ public static final int lineWidth=0x7f01000f;
+ /** Color of the filled circles that represents pages.
+ <p>Must be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>",
+"<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>".
+<p>This may also be a reference to a resource (in the form
+"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
+theme attribute (in the form
+"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
+containing a value of this type.
+ */
+ public static final int pageColor=0x7f01000b;
+ /** Radius of the circles. This is also the spacing between circles.
+ <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
+Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
+in (inches), mm (millimeters).
+<p>This may also be a reference to a resource (in the form
+"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
+theme attribute (in the form
+"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
+containing a value of this type.
+ */
+ public static final int radius=0x7f01000c;
+ /** Whether or not the selected item is displayed as bold.
+ <p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
+<p>This may also be a reference to a resource (in the form
+"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
+theme attribute (in the form
+"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
+containing a value of this type.
+ */
+ public static final int selectedBold=0x7f010019;
+ /** <p>Must be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>",
+"<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>".
+<p>This may also be a reference to a resource (in the form
+"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
+theme attribute (in the form
+"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
+containing a value of this type.
+ */
+ public static final int selectedColor=0x7f010007;
+ /** Whether or not the selected indicator snaps to the circles.
+ <p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
+<p>This may also be a reference to a resource (in the form
+"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
+theme attribute (in the form
+"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
+containing a value of this type.
+ */
+ public static final int snap=0x7f01000d;
+ /** Color of the open circles.
+ <p>Must be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>",
+"<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>".
+<p>This may also be a reference to a resource (in the form
+"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
+theme attribute (in the form
+"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
+containing a value of this type.
+ */
+ public static final int strokeColor=0x7f01000e;
+ /** <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
+Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
+in (inches), mm (millimeters).
+<p>This may also be a reference to a resource (in the form
+"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
+theme attribute (in the form
+"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
+containing a value of this type.
+ */
+ public static final int strokeWidth=0x7f010008;
+ /** Padding between titles when bumping into each other.
+ <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
+Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
+in (inches), mm (millimeters).
+<p>This may also be a reference to a resource (in the form
+"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
+theme attribute (in the form
+"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
+containing a value of this type.
+ */
+ public static final int titlePadding=0x7f01001a;
+ /** Padding between titles and the top of the View.
+ <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
+Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
+in (inches), mm (millimeters).
+<p>This may also be a reference to a resource (in the form
+"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
+theme attribute (in the form
+"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
+containing a value of this type.
+ */
+ public static final int topPadding=0x7f01001b;
+ /** <p>Must be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>",
+"<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>".
+<p>This may also be a reference to a resource (in the form
+"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
+theme attribute (in the form
+"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
+containing a value of this type.
+ */
+ public static final int unselectedColor=0x7f010009;
+ /** Style of the circle indicator.
+ <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
+or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
+ */
+ public static final int vpiCirclePageIndicatorStyle=0x7f010000;
+ /** Style of the icon indicator's views.
+ <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
+or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
+ */
+ public static final int vpiIconPageIndicatorStyle=0x7f010001;
+ /** Style of the line indicator.
+ <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
- public static final int viewAbove=0x7f010001;
- /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
+ public static final int vpiLinePageIndicatorStyle=0x7f010002;
+ /** Style of the tab indicator's tabs.
+ <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
- public static final int viewBehind=0x7f010002;
+ public static final int vpiTabPageIndicatorStyle=0x7f010004;
+ /** Style of the title indicator.
+ <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
+or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
+ */
+ public static final int vpiTitlePageIndicatorStyle=0x7f010003;
+ /** Style of the underline indicator.
+ <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
+or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
+ */
+ public static final int vpiUnderlinePageIndicatorStyle=0x7f010005;
+ }
+ public static final class bool {
+ public static final int default_circle_indicator_centered=0x7f080000;
+ public static final int default_circle_indicator_snap=0x7f080001;
+ public static final int default_line_indicator_centered=0x7f080002;
+ public static final int default_title_indicator_selected_bold=0x7f080003;
+ public static final int default_underline_indicator_fades=0x7f080004;
}
public static final class color {
- public static final int Black=0x7f060001;
- public static final int BrownYellow=0x7f060009;
- public static final int DarkBlue=0x7f06000a;
- public static final int Gray=0x7f060005;
- public static final int LightBlue=0x7f060002;
- public static final int LightGray=0x7f06000c;
- public static final int LightGreen=0x7f060006;
- public static final int LightRed=0x7f060007;
- public static final int MetroBlue=0x7f060003;
- public static final int Red=0x7f060008;
- public static final int ThickGreen=0x7f06000b;
- public static final int White=0x7f060004;
- public static final int holo_blue_bright=0x7f060000;
- public static final int list_footer_layout=0x7f06000d;
+ public static final int Black=0x7f070011;
+ public static final int BrownYellow=0x7f07001a;
+ public static final int DarkBlue=0x7f07001b;
+ public static final int Gray=0x7f070015;
+ public static final int Gray2=0x7f070016;
+ public static final int LightBlue=0x7f070012;
+ public static final int LightGray=0x7f07001d;
+ public static final int LightGreen=0x7f070017;
+ public static final int LightRed=0x7f070018;
+ public static final int MetroBlue=0x7f070013;
+ public static final int Red=0x7f070019;
+ public static final int ThickGreen=0x7f07001c;
+ public static final int White=0x7f070014;
+ public static final int default_circle_indicator_fill_color=0x7f070008;
+ public static final int default_circle_indicator_page_color=0x7f070009;
+ public static final int default_circle_indicator_stroke_color=0x7f07000a;
+ public static final int default_line_indicator_selected_color=0x7f07000b;
+ public static final int default_line_indicator_unselected_color=0x7f07000c;
+ public static final int default_title_indicator_footer_color=0x7f07000d;
+ public static final int default_title_indicator_selected_color=0x7f07000e;
+ public static final int default_title_indicator_text_color=0x7f07000f;
+ public static final int default_underline_indicator_selected_color=0x7f070010;
+ public static final int list_footer_layout=0x7f07001e;
+ public static final int vpi__background_holo_dark=0x7f070000;
+ public static final int vpi__background_holo_light=0x7f070001;
+ public static final int vpi__bright_foreground_disabled_holo_dark=0x7f070004;
+ public static final int vpi__bright_foreground_disabled_holo_light=0x7f070005;
+ public static final int vpi__bright_foreground_holo_dark=0x7f070002;
+ public static final int vpi__bright_foreground_holo_light=0x7f070003;
+ public static final int vpi__bright_foreground_inverse_holo_dark=0x7f070006;
+ public static final int vpi__bright_foreground_inverse_holo_light=0x7f070007;
+ public static final int vpi__dark_theme=0x7f07001f;
+ public static final int vpi__light_theme=0x7f070020;
}
public static final class dimen {
- public static final int list_padding=0x7f070005;
- public static final int menu_header_line=0x7f070002;
- public static final int menu_header_padding_top=0x7f070001;
- public static final int menu_icon_side=0x7f070003;
- public static final int menu_item_padding=0x7f070000;
- public static final int shadow_width=0x7f070006;
- public static final int slidingmenu_offset=0x7f070004;
+ public static final int default_circle_indicator_radius=0x7f0a0000;
+ public static final int default_circle_indicator_stroke_width=0x7f0a0001;
+ public static final int default_line_indicator_gap_width=0x7f0a0003;
+ public static final int default_line_indicator_line_width=0x7f0a0002;
+ public static final int default_line_indicator_stroke_width=0x7f0a0004;
+ public static final int default_title_indicator_clip_padding=0x7f0a0005;
+ public static final int default_title_indicator_footer_indicator_height=0x7f0a0007;
+ public static final int default_title_indicator_footer_indicator_underline_padding=0x7f0a0008;
+ public static final int default_title_indicator_footer_line_height=0x7f0a0006;
+ public static final int default_title_indicator_footer_padding=0x7f0a0009;
+ public static final int default_title_indicator_text_size=0x7f0a000a;
+ public static final int default_title_indicator_title_padding=0x7f0a000b;
+ public static final int default_title_indicator_top_padding=0x7f0a000c;
+ public static final int list_padding=0x7f0a000e;
+ public static final int shadow_width=0x7f0a000f;
+ public static final int slidingmenu_offset=0x7f0a000d;
}
public static final class drawable {
- public static final int defaultshadow=0x7f020000;
- public static final int defaultshadowright=0x7f020001;
- public static final int ic_launcher=0x7f020002;
- public static final int icon_add_b=0x7f020003;
- public static final int icon_camera=0x7f020004;
- public static final int icon_clean=0x7f020005;
+ public static final int ic_action_overflow=0x7f020000;
+ public static final int ic_launcher=0x7f020001;
+ public static final int icon_add_b=0x7f020002;
+ public static final int icon_camera=0x7f020003;
+ public static final int icon_clean=0x7f020004;
+ public static final int icon_edit=0x7f020005;
public static final int icon_favorite=0x7f020006;
public static final int icon_hash=0x7f020007;
public static final int icon_history=0x7f020008;
@@ -151,205 +387,296 @@ or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>na
public static final int icon_menu_w=0x7f02000c;
public static final int icon_morse=0x7f02000d;
public static final int icon_pict=0x7f02000e;
- public static final int icon_reflesh=0x7f02000f;
- public static final int icon_replace=0x7f020010;
- public static final int icon_reply=0x7f020011;
- public static final int icon_retweet=0x7f020012;
- public static final int icon_submit=0x7f020013;
- public static final int icon_templates=0x7f020014;
- public static final int icon_tweet_w=0x7f020015;
- public static final int icon_warota=0x7f020016;
- public static final int se_logo=0x7f020017;
- public static final int shadow=0x7f020018;
+ public static final int icon_property=0x7f02000f;
+ public static final int icon_reflesh=0x7f020010;
+ public static final int icon_replace=0x7f020011;
+ public static final int icon_reply=0x7f020012;
+ public static final int icon_retweet=0x7f020013;
+ public static final int icon_right=0x7f020014;
+ public static final int icon_row=0x7f020015;
+ public static final int icon_submit=0x7f020016;
+ public static final int icon_templates=0x7f020017;
+ public static final int icon_tweet_w=0x7f020018;
+ public static final int icon_twitter=0x7f020019;
+ public static final int icon_warota=0x7f02001a;
+ public static final int se_logo=0x7f02001b;
+ public static final int shadow=0x7f02001c;
+ public static final int vpi__tab_indicator=0x7f02001d;
+ public static final int vpi__tab_selected_focused_holo=0x7f02001e;
+ public static final int vpi__tab_selected_holo=0x7f02001f;
+ public static final int vpi__tab_selected_pressed_holo=0x7f020020;
+ public static final int vpi__tab_unselected_focused_holo=0x7f020021;
+ public static final int vpi__tab_unselected_holo=0x7f020022;
+ public static final int vpi__tab_unselected_pressed_holo=0x7f020023;
}
public static final class id {
- public static final int TextView01=0x7f05000d;
- public static final int TextView02=0x7f050015;
- public static final int button_Auth=0x7f050007;
- public static final int checkBox_checkboxItem=0x7f050005;
- public static final int editText_comment=0x7f05000e;
- public static final int editText_tweet=0x7f050029;
- public static final int frame1=0x7f050036;
- public static final int frame2=0x7f05003d;
- public static final int frame3=0x7f05003f;
- public static final int frame4=0x7f050045;
- public static final int fullscreen=0x7f050003;
- public static final int imageButton_camera=0x7f050030;
- public static final int imageButton_clean=0x7f05002b;
- public static final int imageButton_extraword_add=0x7f050016;
- public static final int imageButton_menu=0x7f05002c;
- public static final int imageButton_pict=0x7f05002f;
- public static final int imageButton_submit=0x7f05002d;
- public static final int imageButton_template_add=0x7f050025;
- public static final int imageView_favorited=0x7f050024;
- public static final int imageView_icon=0x7f050020;
- public static final int imageView_status_favorite=0x7f050011;
- public static final int imageView_status_reply=0x7f05000f;
- public static final int imageView_status_retweet=0x7f050010;
- public static final int left=0x7f050000;
- public static final int linearLayout_dialogItems=0x7f050009;
- public static final int linearLayout_dialogTitle=0x7f050008;
- public static final int linearLayout_toastBody=0x7f050014;
- public static final int linearLayout_tweet_pict=0x7f050031;
- public static final int linearLayout_tweet_reply=0x7f050028;
- public static final int linearlayout1=0x7f050032;
- public static final int linearlayout2=0x7f050037;
- public static final int linearlayout3=0x7f050040;
- public static final int listView_extraword=0x7f050017;
- public static final int listView_listpage=0x7f050018;
- public static final int listView_template=0x7f050026;
- public static final int margin=0x7f050002;
- public static final int relativeLayout_toastBase=0x7f050012;
- public static final int right=0x7f050001;
- public static final int seekBar_seekDialog=0x7f05000c;
- public static final int selected_view=0x7f050004;
- public static final int slidingmenulayout=0x7f05001d;
- public static final int slidingmenumain=0x7f05001c;
- public static final int slidingmenurowicon=0x7f05001e;
- public static final int slidingmenurowtitle=0x7f05001f;
- public static final int tableRow1=0x7f05002a;
- public static final int tableRow2=0x7f05002e;
- public static final int textView1=0x7f050047;
- public static final int textView_count=0x7f050027;
- public static final int textView_footer=0x7f050023;
- public static final int textView_header=0x7f050021;
- public static final int textView_listpage=0x7f050019;
- public static final int textView_menuItem=0x7f05001b;
- public static final int textView_seekDialog=0x7f05000a;
- public static final int textView_seekLevel=0x7f05000b;
- public static final int textView_text=0x7f050022;
- public static final int textView_toastText=0x7f050013;
- public static final int text_navigate=0x7f050006;
- public static final int user_bio=0x7f05003e;
- public static final int user_count_favorite=0x7f050044;
- public static final int user_count_followed=0x7f050043;
- public static final int user_count_following=0x7f050042;
- public static final int user_count_tweet=0x7f050041;
- public static final int user_homepage=0x7f050038;
- public static final int user_icon=0x7f050033;
- public static final int user_isfollowed=0x7f05003b;
- public static final int user_isfollowing=0x7f05003a;
- public static final int user_isprotected=0x7f05003c;
- public static final int user_locate=0x7f050039;
- public static final int user_name=0x7f050035;
- public static final int user_screenname=0x7f050034;
- public static final int user_status=0x7f050046;
- public static final int viewpager=0x7f05001a;
+ public static final int TextView01=0x7f060007;
+ public static final int TextView02=0x7f060010;
+ public static final int bottom=0x7f060003;
+ public static final int btn_submit=0x7f060024;
+ public static final int checkBox_checkboxItem=0x7f060005;
+ public static final int editText_tweet=0x7f06001e;
+ public static final int footer=0x7f060015;
+ public static final int frame1=0x7f06001a;
+ public static final int frame2=0x7f06001b;
+ public static final int frame3=0x7f06003a;
+ public static final int frame4=0x7f060040;
+ public static final int frame_inreplyto=0x7f060025;
+ public static final int imBtn_camera=0x7f060022;
+ public static final int imBtn_clean=0x7f060020;
+ public static final int imBtn_pickpict=0x7f060021;
+ public static final int imBtn_tweetmenu=0x7f060023;
+ public static final int imageBtn_edit=0x7f060017;
+ public static final int imageBtn_menu=0x7f060018;
+ public static final int imageBtn_twitter=0x7f060019;
+ public static final int imageView_favorited=0x7f06002b;
+ public static final int imageView_icon=0x7f060027;
+ public static final int image_pict=0x7f060026;
+ public static final int indicator=0x7f060014;
+ public static final int linearLayout1=0x7f06001f;
+ public static final int linearLayout_toastBody=0x7f06000e;
+ public static final int linearlayout1=0x7f06002f;
+ public static final int linearlayout2=0x7f060033;
+ public static final int linearlayout3=0x7f06003b;
+ public static final int listedit_addbutton=0x7f060011;
+ public static final int listedit_listview=0x7f060012;
+ public static final int listedit_title=0x7f06000f;
+ public static final int listpage_listview=0x7f060013;
+ public static final int menu_exit=0x7f060049;
+ public static final int menu_extract=0x7f060046;
+ public static final int menu_home=0x7f060045;
+ public static final int menu_option=0x7f060048;
+ public static final int menu_post=0x7f060044;
+ public static final int menu_remove=0x7f060047;
+ public static final int none=0x7f060000;
+ public static final int relativeLayout_toastBase=0x7f06000c;
+ public static final int review_comment=0x7f060008;
+ public static final int review_rating=0x7f060006;
+ public static final int seekBar_seekDialog=0x7f06000b;
+ public static final int statusmenu_favorite=0x7f06002e;
+ public static final int statusmenu_reply=0x7f06002c;
+ public static final int statusmenu_retweet=0x7f06002d;
+ public static final int textView1=0x7f060043;
+ public static final int textView_count=0x7f06001d;
+ public static final int textView_footer=0x7f06002a;
+ public static final int textView_header=0x7f060028;
+ public static final int textView_menuItem=0x7f06001c;
+ public static final int textView_seekDialog=0x7f060009;
+ public static final int textView_seekLevel=0x7f06000a;
+ public static final int textView_text=0x7f060029;
+ public static final int textView_toastText=0x7f06000d;
+ public static final int top=0x7f060004;
+ public static final int triangle=0x7f060001;
+ public static final int underline=0x7f060002;
+ public static final int user_bio=0x7f060039;
+ public static final int user_count_favorite=0x7f06003f;
+ public static final int user_count_followed=0x7f06003e;
+ public static final int user_count_following=0x7f06003d;
+ public static final int user_count_tweet=0x7f06003c;
+ public static final int user_homepage=0x7f060034;
+ public static final int user_icon=0x7f060030;
+ public static final int user_isfollowed=0x7f060037;
+ public static final int user_isfollowing=0x7f060036;
+ public static final int user_isprotected=0x7f060038;
+ public static final int user_locate=0x7f060035;
+ public static final int user_menu=0x7f060042;
+ public static final int user_name=0x7f060032;
+ public static final int user_reload=0x7f060041;
+ public static final int user_screenname=0x7f060031;
+ public static final int viewpager=0x7f060016;
}
public static final class integer {
- public static final int num_cols=0x7f080000;
+ public static final int default_circle_indicator_orientation=0x7f090000;
+ public static final int default_title_indicator_footer_indicator_style=0x7f090001;
+ public static final int default_title_indicator_line_position=0x7f090002;
+ public static final int default_underline_indicator_fade_delay=0x7f090003;
+ public static final int default_underline_indicator_fade_length=0x7f090004;
+ public static final int num_cols=0x7f090005;
}
public static final class layout {
public static final int checkboxitem_layout=0x7f030000;
- public static final int dialog_auth_layout=0x7f030001;
- public static final int dialog_base_layout=0x7f030002;
- public static final int dialog_review_layout=0x7f030003;
- public static final int dialog_seekbar_layout=0x7f030004;
- public static final int dialog_statuscommand_layout=0x7f030005;
- public static final int event_layout=0x7f030006;
- public static final int eventtoast_layout=0x7f030007;
- public static final int extrawordactivity_layout=0x7f030008;
- public static final int list=0x7f030009;
- public static final int listpage_layout=0x7f03000a;
- public static final int mainactivity_layout=0x7f03000b;
- public static final int menuitem_layout=0x7f03000c;
- public static final int shadow=0x7f03000d;
- public static final int slidingmenumain=0x7f03000e;
- public static final int slidingmenumainlist=0x7f03000f;
- public static final int slidingmenurow=0x7f030010;
- public static final int status_layout=0x7f030011;
- public static final int templateactivity_layout=0x7f030012;
- public static final int tweet_layout=0x7f030013;
- public static final int useractivity_layout=0x7f030014;
+ public static final int dialog_review=0x7f030001;
+ public static final int dialog_seekbar_layout=0x7f030002;
+ public static final int event_layout=0x7f030003;
+ public static final int eventtoast_layout=0x7f030004;
+ public static final int listedit_layout=0x7f030005;
+ public static final int listpage_layout=0x7f030006;
+ public static final int main_layout=0x7f030007;
+ public static final int menuitem_gray=0x7f030008;
+ public static final int menuitem_white=0x7f030009;
+ public static final int menuparent_white=0x7f03000a;
+ public static final int post_layout=0x7f03000b;
+ public static final int simplebutton=0x7f03000c;
+ public static final int status_layout=0x7f03000d;
+ public static final int statusmenu_header=0x7f03000e;
+ public static final int userinfo_layout=0x7f03000f;
+ }
+ public static final class menu {
+ public static final int menu_main=0x7f0d0000;
}
public static final class string {
- public static final int app_name=0x7f090000;
- public static final int key_setting_aftersubmit=0x7f090003;
- public static final int key_setting_confirm_dialog=0x7f090007;
- public static final int key_setting_delete_accounts=0x7f090004;
- public static final int key_setting_notice_unfav=0x7f090005;
- public static final int key_setting_open_ime=0x7f090006;
- public static final int key_setting_t4j=0x7f090002;
- public static final int key_setting_textSize=0x7f090001;
+ public static final int app_name=0x7f0c0000;
+ public static final int key_setting_aftersubmit=0x7f0c0003;
+ public static final int key_setting_confirm_dialog=0x7f0c0007;
+ public static final int key_setting_delete_accounts=0x7f0c0004;
+ public static final int key_setting_footer=0x7f0c0008;
+ public static final int key_setting_morse=0x7f0c0009;
+ public static final int key_setting_notice_unfav=0x7f0c0005;
+ public static final int key_setting_open_ime=0x7f0c0006;
+ public static final int key_setting_t4j=0x7f0c0002;
+ public static final int key_setting_textSize=0x7f0c0001;
}
public static final class style {
/**
Base application theme, dependent on API level. This theme is replaced
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
+
Theme customizations available in newer API levels can go in
res/values-vXX/styles.xml, while customizations related to
backward-compatibility can go here.
+
*/
- public static final int AppBaseTheme=0x7f0a0000;
+ public static final int AppBaseTheme=0x7f0b0005;
/** Application theme.
All customizations that are NOT specific to a particular API-level can go here.
*/
- public static final int AppTheme=0x7f0a0001;
+ public static final int AppTheme=0x7f0b0006;
+ public static final int TextAppearance_TabPageIndicator=0x7f0b0003;
+ public static final int Theme_PageIndicatorDefaults=0x7f0b0000;
+ public static final int Widget=0x7f0b0001;
+ public static final int Widget_IconPageIndicator=0x7f0b0004;
+ public static final int Widget_TabPageIndicator=0x7f0b0002;
+ public static final int grayBtn=0x7f0b0007;
+ public static final int whiteBtn=0x7f0b0008;
}
public static final class xml {
- public static final int preference=0x7f040000;
+ public static final int graybtn_selector=0x7f050000;
+ public static final int preference=0x7f050001;
+ public static final int whitebtn_selector=0x7f050002;
}
public static final class styleable {
- /** Attributes that can be used with a SlidingMenu.
+ /** Attributes that can be used with a CirclePageIndicator.
<p>Includes the following attributes:</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Attribute</th><th>Description</th></tr>
- <tr><td><code>{@link #SlidingMenu_behindFadeDegree net.miz_hi.smileessence:behindFadeDegree}</code></td><td></td></tr>
- <tr><td><code>{@link #SlidingMenu_behindFadeEnabled net.miz_hi.smileessence:behindFadeEnabled}</code></td><td></td></tr>
- <tr><td><code>{@link #SlidingMenu_behindOffset net.miz_hi.smileessence:behindOffset}</code></td><td></td></tr>
- <tr><td><code>{@link #SlidingMenu_behindScrollScale net.miz_hi.smileessence:behindScrollScale}</code></td><td></td></tr>
- <tr><td><code>{@link #SlidingMenu_behindWidth net.miz_hi.smileessence:behindWidth}</code></td><td></td></tr>
- <tr><td><code>{@link #SlidingMenu_mode net.miz_hi.smileessence:mode}</code></td><td></td></tr>
- <tr><td><code>{@link #SlidingMenu_selectorDrawable net.miz_hi.smileessence:selectorDrawable}</code></td><td></td></tr>
- <tr><td><code>{@link #SlidingMenu_selectorEnabled net.miz_hi.smileessence:selectorEnabled}</code></td><td></td></tr>
- <tr><td><code>{@link #SlidingMenu_shadowDrawable net.miz_hi.smileessence:shadowDrawable}</code></td><td></td></tr>
- <tr><td><code>{@link #SlidingMenu_shadowWidth net.miz_hi.smileessence:shadowWidth}</code></td><td></td></tr>
- <tr><td><code>{@link #SlidingMenu_touchModeAbove net.miz_hi.smileessence:touchModeAbove}</code></td><td></td></tr>
- <tr><td><code>{@link #SlidingMenu_viewAbove net.miz_hi.smileessence:viewAbove}</code></td><td></td></tr>
- <tr><td><code>{@link #SlidingMenu_viewBehind net.miz_hi.smileessence:viewBehind}</code></td><td></td></tr>
+ <tr><td><code>{@link #CirclePageIndicator_android_background net.miz_hi.smileessence:android_background}</code></td><td> View background </td></tr>
+ <tr><td><code>{@link #CirclePageIndicator_android_orientation net.miz_hi.smileessence:android_orientation}</code></td><td> Orientation of the indicator.</td></tr>
+ <tr><td><code>{@link #CirclePageIndicator_centered net.miz_hi.smileessence:centered}</code></td><td> Whether or not the indicators should be centered.</td></tr>
+ <tr><td><code>{@link #CirclePageIndicator_fillColor net.miz_hi.smileessence:fillColor}</code></td><td> Color of the filled circle that represents the current page.</td></tr>
+ <tr><td><code>{@link #CirclePageIndicator_pageColor net.miz_hi.smileessence:pageColor}</code></td><td> Color of the filled circles that represents pages.</td></tr>
+ <tr><td><code>{@link #CirclePageIndicator_radius net.miz_hi.smileessence:radius}</code></td><td> Radius of the circles.</td></tr>
+ <tr><td><code>{@link #CirclePageIndicator_snap net.miz_hi.smileessence:snap}</code></td><td> Whether or not the selected indicator snaps to the circles.</td></tr>
+ <tr><td><code>{@link #CirclePageIndicator_strokeColor net.miz_hi.smileessence:strokeColor}</code></td><td> Color of the open circles.</td></tr>
+ <tr><td><code>{@link #CirclePageIndicator_strokeWidth net.miz_hi.smileessence:strokeWidth}</code></td><td> Width of the stroke used to draw the circles.</td></tr>
</table>
- @see #SlidingMenu_behindFadeDegree
- @see #SlidingMenu_behindFadeEnabled
- @see #SlidingMenu_behindOffset
- @see #SlidingMenu_behindScrollScale
- @see #SlidingMenu_behindWidth
- @see #SlidingMenu_mode
- @see #SlidingMenu_selectorDrawable
- @see #SlidingMenu_selectorEnabled
- @see #SlidingMenu_shadowDrawable
- @see #SlidingMenu_shadowWidth
- @see #SlidingMenu_touchModeAbove
- @see #SlidingMenu_viewAbove
- @see #SlidingMenu_viewBehind
- */
- public static final int[] SlidingMenu = {
- 0x7f010000, 0x7f010001, 0x7f010002, 0x7f010003,
- 0x7f010004, 0x7f010005, 0x7f010006, 0x7f010007,
- 0x7f010008, 0x7f010009, 0x7f01000a, 0x7f01000b,
- 0x7f01000c
+ @see #CirclePageIndicator_android_background
+ @see #CirclePageIndicator_android_orientation
+ @see #CirclePageIndicator_centered
+ @see #CirclePageIndicator_fillColor
+ @see #CirclePageIndicator_pageColor
+ @see #CirclePageIndicator_radius
+ @see #CirclePageIndicator_snap
+ @see #CirclePageIndicator_strokeColor
+ @see #CirclePageIndicator_strokeWidth
+ */
+ public static final int[] CirclePageIndicator = {
+ 0x010100c4, 0x010100d4, 0x7f010006, 0x7f010008,
+ 0x7f01000a, 0x7f01000b, 0x7f01000c, 0x7f01000d,
+ 0x7f01000e
};
/**
- <p>This symbol is the offset where the {@link net.miz_hi.smileessence.R.attr#behindFadeDegree}
- attribute's value can be found in the {@link #SlidingMenu} array.
+ <p>
+ @attr description
+ View background
+ <p>This corresponds to the global attribute resource symbol {@link net.miz_hi.smileessence.R.attr#android_background}.
+ @attr name android:android_background
+ */
+ public static final int CirclePageIndicator_android_background = 1;
+ /**
+ <p>
+ @attr description
+ Orientation of the indicator.
+ <p>This corresponds to the global attribute resource symbol {@link net.miz_hi.smileessence.R.attr#android_orientation}.
+ @attr name android:android_orientation
+ */
+ public static final int CirclePageIndicator_android_orientation = 0;
+ /**
+ <p>
+ @attr description
+ Whether or not the indicators should be centered.
+
+
+ <p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
+<p>This may also be a reference to a resource (in the form
+"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
+theme attribute (in the form
+"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
+containing a value of this type.
+ <p>This is a private symbol.
+ @attr name android:centered
+ */
+ public static final int CirclePageIndicator_centered = 2;
+ /**
+ <p>
+ @attr description
+ Color of the filled circle that represents the current page.
+
+
+ <p>Must be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>",
+"<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>".
+<p>This may also be a reference to a resource (in the form
+"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
+theme attribute (in the form
+"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
+containing a value of this type.
+ <p>This is a private symbol.
+ @attr name android:fillColor
+ */
+ public static final int CirclePageIndicator_fillColor = 4;
+ /**
+ <p>
+ @attr description
+ Color of the filled circles that represents pages.
+
+
+ <p>Must be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>",
+"<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>".
+<p>This may also be a reference to a resource (in the form
+"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
+theme attribute (in the form
+"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
+containing a value of this type.
+ <p>This is a private symbol.
+ @attr name android:pageColor
+ */
+ public static final int CirclePageIndicator_pageColor = 5;
+ /**
+ <p>
+ @attr description
+ Radius of the circles. This is also the spacing between circles.
- <p>Must be a floating point value, such as "<code>1.2</code>".
+ <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
+Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
+in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
- @attr name android:behindFadeDegree
+ <p>This is a private symbol.
+ @attr name android:radius
*/
- public static final int SlidingMenu_behindFadeDegree = 10;
+ public static final int CirclePageIndicator_radius = 6;
/**
- <p>This symbol is the offset where the {@link net.miz_hi.smileessence.R.attr#behindFadeEnabled}
- attribute's value can be found in the {@link #SlidingMenu} array.
+ <p>
+ @attr description
+ Whether or not the selected indicator snaps to the circles.
<p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
@@ -358,12 +685,31 @@ containing a value of this type.
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
- @attr name android:behindFadeEnabled
+ <p>This is a private symbol.
+ @attr name android:snap
*/
- public static final int SlidingMenu_behindFadeEnabled = 9;
+ public static final int CirclePageIndicator_snap = 7;
/**
- <p>This symbol is the offset where the {@link net.miz_hi.smileessence.R.attr#behindOffset}
- attribute's value can be found in the {@link #SlidingMenu} array.
+ <p>
+ @attr description
+ Color of the open circles.
+
+
+ <p>Must be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>",
+"<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>".
+<p>This may also be a reference to a resource (in the form
+"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
+theme attribute (in the form
+"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
+containing a value of this type.
+ <p>This is a private symbol.
+ @attr name android:strokeColor
+ */
+ public static final int CirclePageIndicator_strokeColor = 8;
+ /**
+ <p>
+ @attr description
+ Width of the stroke used to draw the circles.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
@@ -374,26 +720,82 @@ in (inches), mm (millimeters).
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
- @attr name android:behindOffset
+ <p>This is a private symbol.
+ @attr name android:strokeWidth
*/
- public static final int SlidingMenu_behindOffset = 3;
+ public static final int CirclePageIndicator_strokeWidth = 3;
+ /** Attributes that can be used with a LinePageIndicator.
+ <p>Includes the following attributes:</p>
+ <table>
+ <colgroup align="left" />
+ <colgroup align="left" />
+ <tr><th>Attribute</th><th>Description</th></tr>
+ <tr><td><code>{@link #LinePageIndicator_android_background net.miz_hi.smileessence:android_background}</code></td><td> View background </td></tr>
+ <tr><td><code>{@link #LinePageIndicator_centered net.miz_hi.smileessence:centered}</code></td><td> Whether or not the indicators should be centered.</td></tr>
+ <tr><td><code>{@link #LinePageIndicator_gapWidth net.miz_hi.smileessence:gapWidth}</code></td><td> Width of the gap between each indicator line.</td></tr>
+ <tr><td><code>{@link #LinePageIndicator_lineWidth net.miz_hi.smileessence:lineWidth}</code></td><td> Width of each indicator line.</td></tr>
+ <tr><td><code>{@link #LinePageIndicator_selectedColor net.miz_hi.smileessence:selectedColor}</code></td><td> Color of the selected line that represents the current page.</td></tr>
+ <tr><td><code>{@link #LinePageIndicator_strokeWidth net.miz_hi.smileessence:strokeWidth}</code></td><td> Width of each indicator line's stroke.</td></tr>
+ <tr><td><code>{@link #LinePageIndicator_unselectedColor net.miz_hi.smileessence:unselectedColor}</code></td><td> Color of the unselected lines that represent the pages.</td></tr>
+ </table>
+ @see #LinePageIndicator_android_background
+ @see #LinePageIndicator_centered
+ @see #LinePageIndicator_gapWidth
+ @see #LinePageIndicator_lineWidth
+ @see #LinePageIndicator_selectedColor
+ @see #LinePageIndicator_strokeWidth
+ @see #LinePageIndicator_unselectedColor
+ */
+ public static final int[] LinePageIndicator = {
+ 0x010100d4, 0x7f010006, 0x7f010007, 0x7f010008,
+ 0x7f010009, 0x7f01000f, 0x7f010010
+ };
+ /**
+ <p>
+ @attr description
+ View background
+ <p>This corresponds to the global attribute resource symbol {@link net.miz_hi.smileessence.R.attr#android_background}.
+ @attr name android:android_background
+ */
+ public static final int LinePageIndicator_android_background = 0;
+ /**
+ <p>
+ @attr description
+ Whether or not the indicators should be centered.
+
+
+ <p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
+<p>This may also be a reference to a resource (in the form
+"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
+theme attribute (in the form
+"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
+containing a value of this type.
+ <p>This is a private symbol.
+ @attr name android:centered
+ */
+ public static final int LinePageIndicator_centered = 1;
/**
- <p>This symbol is the offset where the {@link net.miz_hi.smileessence.R.attr#behindScrollScale}
- attribute's value can be found in the {@link #SlidingMenu} array.
+ <p>
+ @attr description
+ Width of the gap between each indicator line.
- <p>Must be a floating point value, such as "<code>1.2</code>".
+ <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
+Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
+in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
- @attr name android:behindScrollScale
+ <p>This is a private symbol.
+ @attr name android:gapWidth
*/
- public static final int SlidingMenu_behindScrollScale = 5;
+ public static final int LinePageIndicator_gapWidth = 6;
/**
- <p>This symbol is the offset where the {@link net.miz_hi.smileessence.R.attr#behindWidth}
- attribute's value can be found in the {@link #SlidingMenu} array.
+ <p>
+ @attr description
+ Width of each indicator line.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
@@ -404,12 +806,187 @@ in (inches), mm (millimeters).
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
- @attr name android:behindWidth
+ <p>This is a private symbol.
+ @attr name android:lineWidth
*/
- public static final int SlidingMenu_behindWidth = 4;
+ public static final int LinePageIndicator_lineWidth = 5;
/**
- <p>This symbol is the offset where the {@link net.miz_hi.smileessence.R.attr#mode}
- attribute's value can be found in the {@link #SlidingMenu} array.
+ <p>
+ @attr description
+ Color of the selected line that represents the current page.
+
+
+ <p>Must be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>",
+"<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>".
+<p>This may also be a reference to a resource (in the form
+"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
+theme attribute (in the form
+"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
+containing a value of this type.
+ <p>This is a private symbol.
+ @attr name android:selectedColor
+ */
+ public static final int LinePageIndicator_selectedColor = 2;
+ /**
+ <p>
+ @attr description
+ Width of each indicator line's stroke.
+
+
+ <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
+Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
+in (inches), mm (millimeters).
+<p>This may also be a reference to a resource (in the form
+"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
+theme attribute (in the form
+"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
+containing a value of this type.
+ <p>This is a private symbol.
+ @attr name android:strokeWidth
+ */
+ public static final int LinePageIndicator_strokeWidth = 3;
+ /**
+ <p>
+ @attr description
+ Color of the unselected lines that represent the pages.
+
+
+ <p>Must be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>",
+"<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>".
+<p>This may also be a reference to a resource (in the form
+"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
+theme attribute (in the form
+"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
+containing a value of this type.
+ <p>This is a private symbol.
+ @attr name android:unselectedColor
+ */
+ public static final int LinePageIndicator_unselectedColor = 4;
+ /** Attributes that can be used with a TitlePageIndicator.
+ <p>Includes the following attributes:</p>
+ <table>
+ <colgroup align="left" />
+ <colgroup align="left" />
+ <tr><th>Attribute</th><th>Description</th></tr>
+ <tr><td><code>{@link #TitlePageIndicator_android_background net.miz_hi.smileessence:android_background}</code></td><td> View background </td></tr>
+ <tr><td><code>{@link #TitlePageIndicator_android_textColor net.miz_hi.smileessence:android_textColor}</code></td><td> Color of regular titles.</td></tr>
+ <tr><td><code>{@link #TitlePageIndicator_android_textSize net.miz_hi.smileessence:android_textSize}</code></td><td> Size of title text.</td></tr>
+ <tr><td><code>{@link #TitlePageIndicator_clipPadding net.miz_hi.smileessence:clipPadding}</code></td><td> Screen edge padding.</td></tr>
+ <tr><td><code>{@link #TitlePageIndicator_footerColor net.miz_hi.smileessence:footerColor}</code></td><td> Color of the footer line and indicator.</td></tr>
+ <tr><td><code>{@link #TitlePageIndicator_footerIndicatorHeight net.miz_hi.smileessence:footerIndicatorHeight}</code></td><td> Height of the indicator above the footer line.</td></tr>
+ <tr><td><code>{@link #TitlePageIndicator_footerIndicatorStyle net.miz_hi.smileessence:footerIndicatorStyle}</code></td><td> Style of the indicator.</td></tr>
+ <tr><td><code>{@link #TitlePageIndicator_footerIndicatorUnderlinePadding net.miz_hi.smileessence:footerIndicatorUnderlinePadding}</code></td><td> Left and right padding of the underline indicator.</td></tr>
+ <tr><td><code>{@link #TitlePageIndicator_footerLineHeight net.miz_hi.smileessence:footerLineHeight}</code></td><td> Height of the footer line.</td></tr>
+ <tr><td><code>{@link #TitlePageIndicator_footerPadding net.miz_hi.smileessence:footerPadding}</code></td><td> Padding between the bottom of the title and the footer.</td></tr>
+ <tr><td><code>{@link #TitlePageIndicator_linePosition net.miz_hi.smileessence:linePosition}</code></td><td> Position of the line.</td></tr>
+ <tr><td><code>{@link #TitlePageIndicator_selectedBold net.miz_hi.smileessence:selectedBold}</code></td><td> Whether or not the selected item is displayed as bold.</td></tr>
+ <tr><td><code>{@link #TitlePageIndicator_selectedColor net.miz_hi.smileessence:selectedColor}</code></td><td> Color of the selected title.</td></tr>
+ <tr><td><code>{@link #TitlePageIndicator_titlePadding net.miz_hi.smileessence:titlePadding}</code></td><td> Padding between titles when bumping into each other.</td></tr>
+ <tr><td><code>{@link #TitlePageIndicator_topPadding net.miz_hi.smileessence:topPadding}</code></td><td> Padding between titles and the top of the View.</td></tr>
+ </table>
+ @see #TitlePageIndicator_android_background
+ @see #TitlePageIndicator_android_textColor
+ @see #TitlePageIndicator_android_textSize
+ @see #TitlePageIndicator_clipPadding
+ @see #TitlePageIndicator_footerColor
+ @see #TitlePageIndicator_footerIndicatorHeight
+ @see #TitlePageIndicator_footerIndicatorStyle
+ @see #TitlePageIndicator_footerIndicatorUnderlinePadding
+ @see #TitlePageIndicator_footerLineHeight
+ @see #TitlePageIndicator_footerPadding
+ @see #TitlePageIndicator_linePosition
+ @see #TitlePageIndicator_selectedBold
+ @see #TitlePageIndicator_selectedColor
+ @see #TitlePageIndicator_titlePadding
+ @see #TitlePageIndicator_topPadding
+ */
+ public static final int[] TitlePageIndicator = {
+ 0x01010095, 0x01010098, 0x010100d4, 0x7f010007,
+ 0x7f010011, 0x7f010012, 0x7f010013, 0x7f010014,
+ 0x7f010015, 0x7f010016, 0x7f010017, 0x7f010018,
+ 0x7f010019, 0x7f01001a, 0x7f01001b
+ };
+ /**
+ <p>
+ @attr description
+ View background
+ <p>This corresponds to the global attribute resource symbol {@link net.miz_hi.smileessence.R.attr#android_background}.
+ @attr name android:android_background
+ */
+ public static final int TitlePageIndicator_android_background = 2;
+ /**
+ <p>
+ @attr description
+ Color of regular titles.
+ <p>This corresponds to the global attribute resource symbol {@link net.miz_hi.smileessence.R.attr#android_textColor}.
+ @attr name android:android_textColor
+ */
+ public static final int TitlePageIndicator_android_textColor = 1;
+ /**
+ <p>
+ @attr description
+ Size of title text.
+ <p>This corresponds to the global attribute resource symbol {@link net.miz_hi.smileessence.R.attr#android_textSize}.
+ @attr name android:android_textSize
+ */
+ public static final int TitlePageIndicator_android_textSize = 0;
+ /**
+ <p>
+ @attr description
+ Screen edge padding.
+
+
+ <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
+Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
+in (inches), mm (millimeters).
+<p>This may also be a reference to a resource (in the form
+"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
+theme attribute (in the form
+"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
+containing a value of this type.
+ <p>This is a private symbol.
+ @attr name android:clipPadding
+ */
+ public static final int TitlePageIndicator_clipPadding = 4;
+ /**
+ <p>
+ @attr description
+ Color of the footer line and indicator.
+
+
+ <p>Must be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>",
+"<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>".
+<p>This may also be a reference to a resource (in the form
+"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
+theme attribute (in the form
+"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
+containing a value of this type.
+ <p>This is a private symbol.
+ @attr name android:footerColor
+ */
+ public static final int TitlePageIndicator_footerColor = 5;
+ /**
+ <p>
+ @attr description
+ Height of the indicator above the footer line.
+
+
+ <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
+Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
+in (inches), mm (millimeters).
+<p>This may also be a reference to a resource (in the form
+"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
+theme attribute (in the form
+"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
+containing a value of this type.
+ <p>This is a private symbol.
+ @attr name android:footerIndicatorHeight
+ */
+ public static final int TitlePageIndicator_footerIndicatorHeight = 8;
+ /**
+ <p>
+ @attr description
+ Style of the indicator. Default is triangle.
<p>Must be one of the following constant values.</p>
@@ -418,49 +995,54 @@ containing a value of this type.
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Constant</th><th>Value</th><th>Description</th></tr>
-<tr><td><code>left</code></td><td>0</td><td></td></tr>
-<tr><td><code>right</code></td><td>1</td><td></td></tr>
+<tr><td><code>none</code></td><td>0</td><td></td></tr>
+<tr><td><code>triangle</code></td><td>1</td><td></td></tr>
+<tr><td><code>underline</code></td><td>2</td><td></td></tr>
</table>
- @attr name android:mode
+ <p>This is a private symbol.
+ @attr name android:footerIndicatorStyle
*/
- public static final int SlidingMenu_mode = 0;
+ public static final int TitlePageIndicator_footerIndicatorStyle = 7;
/**
- <p>This symbol is the offset where the {@link net.miz_hi.smileessence.R.attr#selectorDrawable}
- attribute's value can be found in the {@link #SlidingMenu} array.
+ <p>
+ @attr description
+ Left and right padding of the underline indicator.
- <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
-or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
- @attr name android:selectorDrawable
- */
- public static final int SlidingMenu_selectorDrawable = 12;
- /**
- <p>This symbol is the offset where the {@link net.miz_hi.smileessence.R.attr#selectorEnabled}
- attribute's value can be found in the {@link #SlidingMenu} array.
-
-
- <p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
+ <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
+Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
+in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
- @attr name android:selectorEnabled
+ <p>This is a private symbol.
+ @attr name android:footerIndicatorUnderlinePadding
*/
- public static final int SlidingMenu_selectorEnabled = 11;
+ public static final int TitlePageIndicator_footerIndicatorUnderlinePadding = 9;
/**
- <p>This symbol is the offset where the {@link net.miz_hi.smileessence.R.attr#shadowDrawable}
- attribute's value can be found in the {@link #SlidingMenu} array.
+ <p>
+ @attr description
+ Height of the footer line.
- <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
-or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
- @attr name android:shadowDrawable
+ <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
+Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
+in (inches), mm (millimeters).
+<p>This may also be a reference to a resource (in the form
+"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
+theme attribute (in the form
+"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
+containing a value of this type.
+ <p>This is a private symbol.
+ @attr name android:footerLineHeight
*/
- public static final int SlidingMenu_shadowDrawable = 7;
+ public static final int TitlePageIndicator_footerLineHeight = 6;
/**
- <p>This symbol is the offset where the {@link net.miz_hi.smileessence.R.attr#shadowWidth}
- attribute's value can be found in the {@link #SlidingMenu} array.
+ <p>
+ @attr description
+ Padding between the bottom of the title and the footer.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
@@ -471,12 +1053,14 @@ in (inches), mm (millimeters).
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
- @attr name android:shadowWidth
+ <p>This is a private symbol.
+ @attr name android:footerPadding
*/
- public static final int SlidingMenu_shadowWidth = 8;
+ public static final int TitlePageIndicator_footerPadding = 10;
/**
- <p>This symbol is the offset where the {@link net.miz_hi.smileessence.R.attr#touchModeAbove}
- attribute's value can be found in the {@link #SlidingMenu} array.
+ <p>
+ @attr description
+ Position of the line.
<p>Must be one of the following constant values.</p>
@@ -485,31 +1069,272 @@ containing a value of this type.
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Constant</th><th>Value</th><th>Description</th></tr>
-<tr><td><code>margin</code></td><td>0</td><td></td></tr>
-<tr><td><code>fullscreen</code></td><td>1</td><td></td></tr>
+<tr><td><code>bottom</code></td><td>0</td><td></td></tr>
+<tr><td><code>top</code></td><td>1</td><td></td></tr>
</table>
- @attr name android:touchModeAbove
+ <p>This is a private symbol.
+ @attr name android:linePosition
+ */
+ public static final int TitlePageIndicator_linePosition = 11;
+ /**
+ <p>
+ @attr description
+ Whether or not the selected item is displayed as bold.
+
+
+ <p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
+<p>This may also be a reference to a resource (in the form
+"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
+theme attribute (in the form
+"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
+containing a value of this type.
+ <p>This is a private symbol.
+ @attr name android:selectedBold
+ */
+ public static final int TitlePageIndicator_selectedBold = 12;
+ /**
+ <p>
+ @attr description
+ Color of the selected title.
+
+
+ <p>Must be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>",
+"<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>".
+<p>This may also be a reference to a resource (in the form
+"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
+theme attribute (in the form
+"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
+containing a value of this type.
+ <p>This is a private symbol.
+ @attr name android:selectedColor
+ */
+ public static final int TitlePageIndicator_selectedColor = 3;
+ /**
+ <p>
+ @attr description
+ Padding between titles when bumping into each other.
+
+
+ <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
+Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
+in (inches), mm (millimeters).
+<p>This may also be a reference to a resource (in the form
+"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
+theme attribute (in the form
+"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
+containing a value of this type.
+ <p>This is a private symbol.
+ @attr name android:titlePadding
+ */
+ public static final int TitlePageIndicator_titlePadding = 13;
+ /**
+ <p>
+ @attr description
+ Padding between titles and the top of the View.
+
+
+ <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
+Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
+in (inches), mm (millimeters).
+<p>This may also be a reference to a resource (in the form
+"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
+theme attribute (in the form
+"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
+containing a value of this type.
+ <p>This is a private symbol.
+ @attr name android:topPadding
+ */
+ public static final int TitlePageIndicator_topPadding = 14;
+ /** Attributes that can be used with a UnderlinePageIndicator.
+ <p>Includes the following attributes:</p>
+ <table>
+ <colgroup align="left" />
+ <colgroup align="left" />
+ <tr><th>Attribute</th><th>Description</th></tr>
+ <tr><td><code>{@link #UnderlinePageIndicator_android_background net.miz_hi.smileessence:android_background}</code></td><td> View background </td></tr>
+ <tr><td><code>{@link #UnderlinePageIndicator_fadeDelay net.miz_hi.smileessence:fadeDelay}</code></td><td> Length of the delay to fade the indicator.</td></tr>
+ <tr><td><code>{@link #UnderlinePageIndicator_fadeLength net.miz_hi.smileessence:fadeLength}</code></td><td> Length of the indicator fade to transparent.</td></tr>
+ <tr><td><code>{@link #UnderlinePageIndicator_fades net.miz_hi.smileessence:fades}</code></td><td> Whether or not the selected indicator fades.</td></tr>
+ <tr><td><code>{@link #UnderlinePageIndicator_selectedColor net.miz_hi.smileessence:selectedColor}</code></td><td> Color of the selected line that represents the current page.</td></tr>
+ </table>
+ @see #UnderlinePageIndicator_android_background
+ @see #UnderlinePageIndicator_fadeDelay
+ @see #UnderlinePageIndicator_fadeLength
+ @see #UnderlinePageIndicator_fades
+ @see #UnderlinePageIndicator_selectedColor
+ */
+ public static final int[] UnderlinePageIndicator = {
+ 0x010100d4, 0x7f010007, 0x7f01001c, 0x7f01001d,
+ 0x7f01001e
+ };
+ /**
+ <p>
+ @attr description
+ View background
+ <p>This corresponds to the global attribute resource symbol {@link net.miz_hi.smileessence.R.attr#android_background}.
+ @attr name android:android_background
+ */
+ public static final int UnderlinePageIndicator_android_background = 0;
+ /**
+ <p>
+ @attr description
+ Length of the delay to fade the indicator.
+
+
+ <p>Must be an integer value, such as "<code>100</code>".
+<p>This may also be a reference to a resource (in the form
+"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
+theme attribute (in the form
+"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
+containing a value of this type.
+ <p>This is a private symbol.
+ @attr name android:fadeDelay
+ */
+ public static final int UnderlinePageIndicator_fadeDelay = 3;
+ /**
+ <p>
+ @attr description
+ Length of the indicator fade to transparent.
+
+
+ <p>Must be an integer value, such as "<code>100</code>".
+<p>This may also be a reference to a resource (in the form
+"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
+theme attribute (in the form
+"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
+containing a value of this type.
+ <p>This is a private symbol.
+ @attr name android:fadeLength
+ */
+ public static final int UnderlinePageIndicator_fadeLength = 4;
+ /**
+ <p>
+ @attr description
+ Whether or not the selected indicator fades.
+
+
+ <p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
+<p>This may also be a reference to a resource (in the form
+"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
+theme attribute (in the form
+"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
+containing a value of this type.
+ <p>This is a private symbol.
+ @attr name android:fades
+ */
+ public static final int UnderlinePageIndicator_fades = 2;
+ /**
+ <p>
+ @attr description
+ Color of the selected line that represents the current page.
+
+
+ <p>Must be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>",
+"<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>".
+<p>This may also be a reference to a resource (in the form
+"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
+theme attribute (in the form
+"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
+containing a value of this type.
+ <p>This is a private symbol.
+ @attr name android:selectedColor
+ */
+ public static final int UnderlinePageIndicator_selectedColor = 1;
+ /** Attributes that can be used with a ViewPagerIndicator.
+ <p>Includes the following attributes:</p>
+ <table>
+ <colgroup align="left" />
+ <colgroup align="left" />
+ <tr><th>Attribute</th><th>Description</th></tr>
+ <tr><td><code>{@link #ViewPagerIndicator_vpiCirclePageIndicatorStyle net.miz_hi.smileessence:vpiCirclePageIndicatorStyle}</code></td><td> Style of the circle indicator.</td></tr>
+ <tr><td><code>{@link #ViewPagerIndicator_vpiIconPageIndicatorStyle net.miz_hi.smileessence:vpiIconPageIndicatorStyle}</code></td><td> Style of the icon indicator's views.</td></tr>
+ <tr><td><code>{@link #ViewPagerIndicator_vpiLinePageIndicatorStyle net.miz_hi.smileessence:vpiLinePageIndicatorStyle}</code></td><td> Style of the line indicator.</td></tr>
+ <tr><td><code>{@link #ViewPagerIndicator_vpiTabPageIndicatorStyle net.miz_hi.smileessence:vpiTabPageIndicatorStyle}</code></td><td> Style of the tab indicator's tabs.</td></tr>
+ <tr><td><code>{@link #ViewPagerIndicator_vpiTitlePageIndicatorStyle net.miz_hi.smileessence:vpiTitlePageIndicatorStyle}</code></td><td> Style of the title indicator.</td></tr>
+ <tr><td><code>{@link #ViewPagerIndicator_vpiUnderlinePageIndicatorStyle net.miz_hi.smileessence:vpiUnderlinePageIndicatorStyle}</code></td><td> Style of the underline indicator.</td></tr>
+ </table>
+ @see #ViewPagerIndicator_vpiCirclePageIndicatorStyle
+ @see #ViewPagerIndicator_vpiIconPageIndicatorStyle
+ @see #ViewPagerIndicator_vpiLinePageIndicatorStyle
+ @see #ViewPagerIndicator_vpiTabPageIndicatorStyle
+ @see #ViewPagerIndicator_vpiTitlePageIndicatorStyle
+ @see #ViewPagerIndicator_vpiUnderlinePageIndicatorStyle
+ */
+ public static final int[] ViewPagerIndicator = {
+ 0x7f010000, 0x7f010001, 0x7f010002, 0x7f010003,
+ 0x7f010004, 0x7f010005
+ };
+ /**
+ <p>
+ @attr description
+ Style of the circle indicator.
+
+
+ <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
+or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
+ <p>This is a private symbol.
+ @attr name android:vpiCirclePageIndicatorStyle
+ */
+ public static final int ViewPagerIndicator_vpiCirclePageIndicatorStyle = 0;
+ /**
+ <p>
+ @attr description
+ Style of the icon indicator's views.
+
+
+ <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
+or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
+ <p>This is a private symbol.
+ @attr name android:vpiIconPageIndicatorStyle
+ */
+ public static final int ViewPagerIndicator_vpiIconPageIndicatorStyle = 1;
+ /**
+ <p>
+ @attr description
+ Style of the line indicator.
+
+
+ <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
+or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
+ <p>This is a private symbol.
+ @attr name android:vpiLinePageIndicatorStyle
+ */
+ public static final int ViewPagerIndicator_vpiLinePageIndicatorStyle = 2;
+ /**
+ <p>
+ @attr description
+ Style of the tab indicator's tabs.
+
+
+ <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
+or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
+ <p>This is a private symbol.
+ @attr name android:vpiTabPageIndicatorStyle
*/
- public static final int SlidingMenu_touchModeAbove = 6;
+ public static final int ViewPagerIndicator_vpiTabPageIndicatorStyle = 4;
/**
- <p>This symbol is the offset where the {@link net.miz_hi.smileessence.R.attr#viewAbove}
- attribute's value can be found in the {@link #SlidingMenu} array.
+ <p>
+ @attr description
+ Style of the title indicator.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
- @attr name android:viewAbove
+ <p>This is a private symbol.
+ @attr name android:vpiTitlePageIndicatorStyle
*/
- public static final int SlidingMenu_viewAbove = 1;
+ public static final int ViewPagerIndicator_vpiTitlePageIndicatorStyle = 3;
/**
- <p>This symbol is the offset where the {@link net.miz_hi.smileessence.R.attr#viewBehind}
- attribute's value can be found in the {@link #SlidingMenu} array.
+ <p>
+ @attr description
+ Style of the underline indicator.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
- @attr name android:viewBehind
+ <p>This is a private symbol.
+ @attr name android:vpiUnderlinePageIndicatorStyle
*/
- public static final int SlidingMenu_viewBehind = 2;
+ public static final int ViewPagerIndicator_vpiUnderlinePageIndicatorStyle = 5;
};
}
diff --git a/lint.xml b/lint.xml
index 636cce1e..98f20d43 100644
--- a/lint.xml
+++ b/lint.xml
@@ -1,4 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<lint>
<issue id="HandlerLeak" severity="ignore" />
+ <issue id="ValidFragment">
+ <ignore path="src\net\miz_hi\smileessence\view\HistoryListPageFragment.java" />
+ </issue>
</lint> \ No newline at end of file
diff --git a/project.properties b/project.properties
index cafd9328..8e5012dd 100644
--- a/project.properties
+++ b/project.properties
@@ -11,5 +11,6 @@
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
# Project target.
-target=android-17
-android.library.reference.1=..\\SlidingMenuActivity
+target=android-14
+android.library.reference.1=..\\ViewPagerIndicator
+android.library.reference.2=..\\Crouton
diff --git a/res/drawable-hdpi/ic_action_overflow.png b/res/drawable-hdpi/ic_action_overflow.png
new file mode 100644
index 00000000..cc905e09
--- /dev/null
+++ b/res/drawable-hdpi/ic_action_overflow.png
Binary files differ
diff --git a/res/drawable-hdpi/icon_add_b.png b/res/drawable-hdpi/icon_add_b.png
index b1297a0f..638219c0 100644
--- a/res/drawable-hdpi/icon_add_b.png
+++ b/res/drawable-hdpi/icon_add_b.png
Binary files differ
diff --git a/res/drawable-hdpi/icon_camera.png b/res/drawable-hdpi/icon_camera.png
index 4910e914..be411fae 100644
--- a/res/drawable-hdpi/icon_camera.png
+++ b/res/drawable-hdpi/icon_camera.png
Binary files differ
diff --git a/res/drawable-hdpi/icon_clean.png b/res/drawable-hdpi/icon_clean.png
index c38da0b9..c7befb0c 100644
--- a/res/drawable-hdpi/icon_clean.png
+++ b/res/drawable-hdpi/icon_clean.png
Binary files differ
diff --git a/res/drawable-hdpi/icon_edit.png b/res/drawable-hdpi/icon_edit.png
new file mode 100644
index 00000000..436a3e53
--- /dev/null
+++ b/res/drawable-hdpi/icon_edit.png
Binary files differ
diff --git a/res/drawable-hdpi/icon_favorite.png b/res/drawable-hdpi/icon_favorite.png
index a294eec9..250da351 100644
--- a/res/drawable-hdpi/icon_favorite.png
+++ b/res/drawable-hdpi/icon_favorite.png
Binary files differ
diff --git a/res/drawable-hdpi/icon_menu.png b/res/drawable-hdpi/icon_menu.png
index 99f52346..8b3ba4ed 100644
--- a/res/drawable-hdpi/icon_menu.png
+++ b/res/drawable-hdpi/icon_menu.png
Binary files differ
diff --git a/res/drawable-hdpi/icon_pict.png b/res/drawable-hdpi/icon_pict.png
index baf41c73..cbd82341 100644
--- a/res/drawable-hdpi/icon_pict.png
+++ b/res/drawable-hdpi/icon_pict.png
Binary files differ
diff --git a/res/drawable-hdpi/icon_property.png b/res/drawable-hdpi/icon_property.png
new file mode 100644
index 00000000..1f0c4438
--- /dev/null
+++ b/res/drawable-hdpi/icon_property.png
Binary files differ
diff --git a/res/drawable-hdpi/icon_reply.png b/res/drawable-hdpi/icon_reply.png
index 7badaa14..67bbb22d 100644
--- a/res/drawable-hdpi/icon_reply.png
+++ b/res/drawable-hdpi/icon_reply.png
Binary files differ
diff --git a/res/drawable-hdpi/icon_retweet.png b/res/drawable-hdpi/icon_retweet.png
index ab2a06b0..5a0adabe 100644
--- a/res/drawable-hdpi/icon_retweet.png
+++ b/res/drawable-hdpi/icon_retweet.png
Binary files differ
diff --git a/res/drawable-hdpi/icon_right.png b/res/drawable-hdpi/icon_right.png
new file mode 100644
index 00000000..13837f96
--- /dev/null
+++ b/res/drawable-hdpi/icon_right.png
Binary files differ
diff --git a/res/drawable-hdpi/icon_row.png b/res/drawable-hdpi/icon_row.png
new file mode 100644
index 00000000..4097d0e0
--- /dev/null
+++ b/res/drawable-hdpi/icon_row.png
Binary files differ
diff --git a/res/drawable-hdpi/icon_twitter.png b/res/drawable-hdpi/icon_twitter.png
new file mode 100644
index 00000000..f7abc2b9
--- /dev/null
+++ b/res/drawable-hdpi/icon_twitter.png
Binary files differ
diff --git a/res/layout/checkboxitem_layout.xml b/res/layout/checkboxitem_layout.xml
index 63a2403a..149bb0d4 100644
--- a/res/layout/checkboxitem_layout.xml
+++ b/res/layout/checkboxitem_layout.xml
@@ -8,12 +8,8 @@
android:id="@+id/checkBox_checkboxItem"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:text="CheckBox"
- android:textColor="@color/White" />
-
- <FrameLayout
- android:layout_width="match_parent"
- android:layout_height="1dp"
- android:background="@color/Gray"/>
+ android:layout_marginBottom="5dp"
+ android:layout_marginTop="5dp"
+ android:text="CheckBox" />
</LinearLayout> \ No newline at end of file
diff --git a/res/layout/dialog_auth_layout.xml b/res/layout/dialog_auth_layout.xml
deleted file mode 100644
index b13b8c3e..00000000
--- a/res/layout/dialog_auth_layout.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
-
- <TextView
- android:id="@+id/text_navigate"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_centerHorizontal="true"
- android:gravity="center"
- android:textAppearance="?android:attr/textAppearanceMedium" />
-
- <Button
- android:id="@+id/button_Auth"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_below="@id/text_navigate"
- android:layout_centerHorizontal="true"
- android:layout_marginTop="20dp" />
-
-</RelativeLayout>
diff --git a/res/layout/dialog_base_layout.xml b/res/layout/dialog_base_layout.xml
deleted file mode 100644
index 7f05e545..00000000
--- a/res/layout/dialog_base_layout.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:background="@color/Black" >
-
- <ScrollView
- android:layout_width="fill_parent"
- android:layout_height="fill_parent" >
-
- <LinearLayout
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical">
-
- <LinearLayout
- android:id="@+id/linearLayout_dialogTitle"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:orientation="vertical" />
-
- <FrameLayout
- android:layout_width="fill_parent"
- android:layout_height="1dp"
- android:background="@color/holo_blue_bright" >
- </FrameLayout>
-
- <LinearLayout
- android:id="@+id/linearLayout_dialogItems"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical"
- android:padding="1dp" />
- </LinearLayout>
- </ScrollView>
-
-</FrameLayout> \ No newline at end of file
diff --git a/res/layout/dialog_review_layout.xml b/res/layout/dialog_review.xml
index 5a30395e..42adfe72 100644
--- a/res/layout/dialog_review_layout.xml
+++ b/res/layout/dialog_review.xml
@@ -14,30 +14,20 @@
android:orientation="vertical" >
<TextView
- android:id="@+id/textView_seekDialog"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginTop="5dp"
android:text="星いくつ?"
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:textColor="@color/White" />
+ android:textAppearance="?android:attr/textAppearanceMedium"/>
- <TextView
- android:id="@+id/textView_seekLevel"
+ <RatingBar
+ android:id="@+id/review_rating"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginLeft="5dp"
- android:layout_marginTop="5dp"
- android:text="1"
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:textColor="@color/White" />
-
- <SeekBar
- android:id="@+id/seekBar_seekDialog"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:padding="10dp" />
+ android:max="5"
+ android:rating="1"
+ android:stepSize="1" />
<TextView
android:id="@+id/TextView01"
@@ -46,11 +36,10 @@
android:layout_marginLeft="5dp"
android:layout_marginTop="5dp"
android:text="コメント"
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:textColor="@color/White" />
+ android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
- android:id="@+id/editText_comment"
+ android:id="@+id/review_comment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
diff --git a/res/layout/dialog_seekbar_layout.xml b/res/layout/dialog_seekbar_layout.xml
index bef852fe..3fc9a6fc 100644
--- a/res/layout/dialog_seekbar_layout.xml
+++ b/res/layout/dialog_seekbar_layout.xml
@@ -4,34 +4,23 @@
android:layout_height="match_parent"
android:orientation="vertical" >
- <ScrollView
- android:layout_width="fill_parent"
- android:layout_height="wrap_content" >
-
- <LinearLayout
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical" >
-
- <TextView
- android:id="@+id/textView_seekDialog"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginLeft="5dp"
- android:layout_marginTop="5dp"
- android:text="text"
- android:textAppearance="?android:attr/textAppearanceMedium" />
+ <TextView
+ android:id="@+id/textView_seekDialog"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="5dp"
+ android:layout_marginTop="5dp"
+ android:text="text"
+ android:textAppearance="?android:attr/textAppearanceMedium" />
- <TextView
- android:id="@+id/textView_seekLevel"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginLeft="5dp"
- android:layout_marginTop="5dp"
- android:text="1"
- android:textAppearance="?android:attr/textAppearanceMedium" />
- </LinearLayout>
- </ScrollView>
+ <TextView
+ android:id="@+id/textView_seekLevel"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="5dp"
+ android:layout_marginTop="5dp"
+ android:text="1"
+ android:textAppearance="?android:attr/textAppearanceMedium" />
<SeekBar
android:id="@+id/seekBar_seekDialog"
diff --git a/res/layout/dialog_statuscommand_layout.xml b/res/layout/dialog_statuscommand_layout.xml
deleted file mode 100644
index 3fc28fc7..00000000
--- a/res/layout/dialog_statuscommand_layout.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginLeft="5dp"
- android:layout_marginRight="5dp"
- android:gravity="center_horizontal" >
-
- <ImageView
- android:id="@+id/imageView_status_reply"
- android:layout_width="50dp"
- android:layout_height="50dp"
- android:layout_weight="1"
- android:cropToPadding="false"
- android:padding="5dp"
- android:src="@drawable/icon_reply" />
-
- <FrameLayout
- android:layout_width="1dp"
- android:layout_height="match_parent"
- android:background="@color/MetroBlue" />
-
- <ImageView
- android:id="@+id/imageView_status_retweet"
- android:layout_width="50dp"
- android:layout_height="50dp"
- android:layout_weight="1"
- android:padding="5dp"
- android:src="@drawable/icon_retweet" />
-
- <FrameLayout
- android:layout_width="1dp"
- android:layout_height="match_parent"
- android:background="@color/MetroBlue" />
-
- <ImageView
- android:id="@+id/imageView_status_favorite"
- android:layout_width="50dp"
- android:layout_height="50dp"
- android:layout_weight="1"
- android:padding="5dp"
- android:src="@drawable/icon_favorite" />
-
-</LinearLayout> \ No newline at end of file
diff --git a/res/layout/extrawordactivity_layout.xml b/res/layout/listedit_layout.xml
index 0c754c6a..b063ccbc 100644
--- a/res/layout/extrawordactivity_layout.xml
+++ b/res/layout/listedit_layout.xml
@@ -1,49 +1,56 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:background="@color/White"
- android:orientation="vertical" >
-
- <RelativeLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:background="@color/LightBlue" >
-
- <TextView
- android:id="@+id/TextView01"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="抽出ワードの管理"
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:textColor="@color/Gray" />
-
- <TextView
- android:id="@+id/TextView02"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_below="@id/TextView01"
- android:text="クリックで編集(長押しで削除)"
- android:textAppearance="?android:attr/textAppearanceSmall"
- android:textColor="@color/Gray" />
-
- <ImageButton
- android:id="@+id/imageButton_extraword_add"
- android:layout_width="40dp"
- android:layout_height="40dp"
- android:layout_alignParentRight="true"
- android:layout_centerVertical="true"
- android:scaleType="fitCenter"
- android:src="@drawable/icon_add_b" />
-
- </RelativeLayout>
-
- <ListView
- android:id="@+id/listView_extraword"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:fastScrollEnabled="true" >
-
- </ListView>
-
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:background="@color/White"
+ android:orientation="vertical" >
+
+ <RelativeLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:background="@color/Gray"
+ android:padding="5dp" >
+
+ <TextView
+ android:id="@+id/listedit_title"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="title"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:textColor="@color/LightGray" />
+
+ <TextView
+ android:id="@+id/TextView02"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_below="@+id/listedit_title"
+ android:text="クリックで編集(長押しで削除)"
+ android:textAppearance="?android:attr/textAppearanceSmall"
+ android:textColor="@color/LightGray" />
+
+ <ImageButton
+ android:id="@+id/listedit_addbutton"
+ style="@style/grayBtn"
+ android:layout_width="40dp"
+ android:layout_height="40dp"
+ android:layout_alignParentRight="true"
+ android:layout_centerVertical="true"
+ android:scaleType="fitCenter"
+ android:src="@drawable/icon_add_b" />
+
+ </RelativeLayout>
+
+ <FrameLayout
+ android:layout_width="fill_parent"
+ android:layout_height="1dp"
+ android:background="@color/Gray"/>
+
+ <ListView
+ android:id="@+id/listedit_listview"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:fastScrollEnabled="true" >
+
+ </ListView>
+
</LinearLayout> \ No newline at end of file
diff --git a/res/layout/listpage_layout.xml b/res/layout/listpage_layout.xml
index ec4bb5c9..1f30cccf 100644
--- a/res/layout/listpage_layout.xml
+++ b/res/layout/listpage_layout.xml
@@ -1,33 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
- android:layout_height="match_parent" >
+ android:layout_height="match_parent"
+ android:background="@color/White"
+ android:gravity="center_horizontal" >
<ListView
- android:id="@+id/listView_listpage"
+ android:id="@+id/listpage_listview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_alignParentLeft="true"
- android:layout_alignParentRight="true"
- android:layout_below="@+id/textView_listpage"
- android:layout_centerHorizontal="true" >
+ android:divider="@color/Gray2"
+ android:dividerHeight="1dp"
+ android:footerDividersEnabled="true" >
</ListView>
-
- <TextView
- android:id="@+id/textView_listpage"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentLeft="true"
- android:layout_alignParentRight="true"
- android:layout_alignParentTop="true"
- android:layout_centerHorizontal="true"
- android:background="@color/Gray"
- android:gravity="center_horizontal"
- android:paddingTop="5dp"
- android:text="TextView"
- android:textColor="@color/MetroBlue"
- android:textSize="13sp"
- android:textStyle="bold" />
-
-</RelativeLayout> \ No newline at end of file
+</LinearLayout>
diff --git a/res/layout/main_layout.xml b/res/layout/main_layout.xml
new file mode 100644
index 00000000..971cc2d0
--- /dev/null
+++ b/res/layout/main_layout.xml
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ android:scrollbarStyle="outsideInset" >
+
+ <com.viewpagerindicator.TitlePageIndicator
+ android:id="@+id/indicator"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_alignParentTop="true"
+ android:background="@color/Gray" />
+
+ <FrameLayout
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_below="@+id/indicator"
+ android:layout_above="@+id/footer" >
+
+ <android.support.v4.view.ViewPager
+ android:id="@+id/viewpager"
+ android:layout_width="fill_parent"
+ android:layout_height="match_parent"
+ android:layout_gravity="top"
+ android:fitsSystemWindows="false" />
+ </FrameLayout>
+
+ <RelativeLayout
+ android:id="@+id/footer"
+ android:layout_width="match_parent"
+ android:layout_height="43dp"
+ android:layout_alignParentBottom="true"
+ android:layout_below="@+id/viewpager"
+ android:background="@color/Gray"
+ android:orientation="horizontal"
+ android:paddingTop="1dp"
+ android:visibility="visible" >
+
+ <ImageView
+ android:id="@+id/imageBtn_edit"
+ style="@style/grayBtn"
+ android:layout_width="42dp"
+ android:layout_height="42dp"
+ android:layout_alignParentLeft="true"
+ android:onClick="onEditClick"
+ android:scaleType="fitCenter"
+ android:src="@drawable/icon_edit" />
+
+ <ImageButton
+ android:id="@+id/imageBtn_menu"
+ style="@style/grayBtn"
+ android:layout_width="42dp"
+ android:layout_height="42dp"
+ android:layout_alignParentRight="true"
+ android:clickable="true"
+ android:onClick="onMenuClick"
+ android:scaleType="fitCenter"
+ android:src="@drawable/icon_row" />
+
+ <ImageButton
+ android:id="@+id/imageBtn_twitter"
+ style="@style/grayBtn"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:layout_alignLeft="@+id/frame1"
+ android:layout_alignRight="@+id/frame2"
+ android:onClick="onTwitterClick"
+ android:scaleType="fitCenter"
+ android:src="@drawable/icon_twitter" />
+
+ <FrameLayout
+ android:id="@+id/frame1"
+ android:layout_width="1dp"
+ android:layout_height="match_parent"
+ android:layout_alignRight="@+id/imageBtn_edit"
+ android:background="@color/Gray2" />
+
+ <FrameLayout
+ android:id="@+id/frame2"
+ android:layout_width="1dp"
+ android:layout_height="match_parent"
+ android:layout_alignLeft="@+id/imageBtn_menu"
+ android:background="@color/Gray2" />
+ </RelativeLayout>
+
+</RelativeLayout> \ No newline at end of file
diff --git a/res/layout/mainactivity_layout.xml b/res/layout/mainactivity_layout.xml
deleted file mode 100644
index 5ed26492..00000000
--- a/res/layout/mainactivity_layout.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent" >
-
- <android.support.v4.view.ViewPager
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:id="@+id/viewpager"/>
-
-</RelativeLayout> \ No newline at end of file
diff --git a/res/layout/menuitem_layout.xml b/res/layout/menuitem_gray.xml
index d17c099e..c973b711 100644
--- a/res/layout/menuitem_layout.xml
+++ b/res/layout/menuitem_gray.xml
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ style="@style/grayBtn"
android:layout_width="match_parent"
- android:layout_height="wrap_content"
+ android:layout_height="wrap_content"
android:orientation="vertical" >
<TextView
@@ -13,11 +14,6 @@
android:paddingLeft="10dp"
android:text="Text"
android:textAppearance="?android:attr/textAppearanceSmall"
- android:textColor="@color/White" />
-
- <FrameLayout
- android:layout_width="match_parent"
- android:layout_height="1dp"
- android:background="@color/Gray"/>
+ android:textColor="@color/LightGray" />
</LinearLayout> \ No newline at end of file
diff --git a/res/layout/menuitem_white.xml b/res/layout/menuitem_white.xml
new file mode 100644
index 00000000..bdd363af
--- /dev/null
+++ b/res/layout/menuitem_white.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ style="@style/whiteBtn"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical" >
+
+ <TextView
+ android:id="@+id/textView_menuItem"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="16dp"
+ android:layout_marginTop="16dp"
+ android:paddingLeft="10dp"
+ android:text="Text"
+ android:textAppearance="?android:attr/textAppearanceSmall"
+ android:textColor="@color/Gray" />
+
+</LinearLayout> \ No newline at end of file
diff --git a/res/layout/menuparent_white.xml b/res/layout/menuparent_white.xml
new file mode 100644
index 00000000..546d8aea
--- /dev/null
+++ b/res/layout/menuparent_white.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ style="@style/whiteBtn"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:background="@color/LightGray"
+ android:orientation="vertical" >
+
+ <TextView
+ android:id="@+id/textView_menuItem"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="16dp"
+ android:layout_marginLeft="30dp"
+ android:layout_marginTop="16dp"
+ android:paddingLeft="10dp"
+ android:text="Text"
+ android:textAppearance="?android:attr/textAppearanceSmall"
+ android:textColor="@color/Gray" />
+
+</LinearLayout> \ No newline at end of file
diff --git a/res/layout/post_layout.xml b/res/layout/post_layout.xml
new file mode 100644
index 00000000..34863ee5
--- /dev/null
+++ b/res/layout/post_layout.xml
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="utf-8"?>
+<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="@color/White" >
+
+ <LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res/net.miz_hi.smileessence"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical"
+ android:paddingBottom="10dp"
+ android:scrollbars="vertical" >
+
+ <TextView
+ android:id="@+id/textView_count"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="10dp"
+ android:layout_marginRight="10dp"
+ android:layout_marginTop="10dp"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:textColor="@color/MetroBlue" />
+
+ <EditText
+ android:id="@+id/editText_tweet"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="5dp"
+ android:layout_marginLeft="15dp"
+ android:layout_marginRight="15dp"
+ android:layout_marginTop="5dp"
+ android:freezesText="true"
+ android:gravity="top"
+ android:inputType="text|textMultiLine"
+ android:maxHeight="160dp"
+ android:minLines="2" >
+
+ <requestFocus />
+ </EditText>
+
+ <LinearLayout
+ android:id="@+id/linearLayout1"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_gravity="fill_horizontal"
+ android:layout_marginLeft="15dp"
+ android:layout_marginRight="15dp" >
+
+ <FrameLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ android:layout_weight="1"
+ android:background="@color/Gray"
+ android:padding="1dp" >
+
+ <ImageButton
+ android:id="@+id/imBtn_clean"
+ style="@style/whiteBtn"
+ android:layout_width="match_parent"
+ android:layout_height="40dp"
+ android:padding="0dp"
+ android:scaleType="fitCenter"
+ android:src="@drawable/icon_clean" />
+ </FrameLayout>
+
+ <FrameLayout
+ android:layout_width="2dp"
+ android:layout_height="match_parent"
+ android:background="@android:color/transparent" />
+
+ <FrameLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ android:layout_weight="1"
+ android:background="@color/Gray"
+ android:padding="1dp" >
+
+ <ImageButton
+ android:id="@+id/imBtn_pickpict"
+ style="@style/whiteBtn"
+ android:layout_width="match_parent"
+ android:layout_height="40dp"
+ android:padding="0dp"
+ android:scaleType="fitCenter"
+ android:src="@drawable/icon_pict" />
+ </FrameLayout>
+
+ <FrameLayout
+ android:layout_width="2dp"
+ android:layout_height="match_parent"
+ android:background="@android:color/transparent" />
+
+ <FrameLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ android:layout_weight="1"
+ android:background="@color/Gray"
+ android:padding="1dp" >
+
+ <ImageButton
+ android:id="@+id/imBtn_camera"
+ style="@style/whiteBtn"
+ android:layout_width="match_parent"
+ android:layout_height="40dp"
+ android:layout_weight="1"
+ android:padding="0dp"
+ android:scaleType="fitCenter"
+ android:src="@drawable/icon_camera" />
+ </FrameLayout>
+
+ <FrameLayout
+ android:layout_width="2dp"
+ android:layout_height="match_parent"
+ android:background="@android:color/transparent" />
+
+ <FrameLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ android:layout_weight="1"
+ android:background="@color/Gray"
+ android:padding="1dp" >
+
+ <ImageButton
+ android:id="@+id/imBtn_tweetmenu"
+ style="@style/whiteBtn"
+ android:layout_width="match_parent"
+ android:layout_height="40dp"
+ android:layout_weight="1"
+ android:padding="0dp"
+ android:scaleType="fitCenter"
+ android:src="@drawable/icon_menu" />
+ </FrameLayout>
+ </LinearLayout>
+
+ <FrameLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="15dp"
+ android:layout_marginRight="15dp"
+ android:layout_marginTop="6dp"
+ android:background="@color/Gray"
+ android:padding="1dp" >
+
+ <Button
+ android:id="@+id/btn_submit"
+ style="@style/whiteBtn"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:gravity="center"
+ android:text="TWEET"
+ android:textStyle="bold" />
+ </FrameLayout>
+
+ <FrameLayout
+ android:id="@+id/frame_inreplyto"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="15dp"
+ android:layout_marginRight="15dp"
+ android:layout_marginTop="10dp"
+ android:visibility="gone" >
+ </FrameLayout>
+
+ <ImageView
+ android:id="@+id/image_pict"
+ android:layout_width="100dp"
+ android:layout_height="100dp"
+ android:layout_gravity="left"
+ android:layout_marginLeft="15dp"
+ android:layout_marginRight="15dp"
+ android:layout_marginTop="10dp"
+ android:clickable="true"
+ android:visibility="gone" />
+ </LinearLayout>
+
+</ScrollView> \ No newline at end of file
diff --git a/res/layout/simplebutton.xml b/res/layout/simplebutton.xml
new file mode 100644
index 00000000..2857b419
--- /dev/null
+++ b/res/layout/simplebutton.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Button xmlns:android="http://schemas.android.com/apk/res/android"
+ style="@style/whiteBtn"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_margin="5dp"
+ android:text="text" >
+
+</Button> \ No newline at end of file
diff --git a/res/layout/statusmenu_header.xml b/res/layout/statusmenu_header.xml
new file mode 100644
index 00000000..34abec56
--- /dev/null
+++ b/res/layout/statusmenu_header.xml
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/linearLayout1"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_alignParentTop="true"
+ android:gravity="center_horizontal"
+ android:paddingBottom="5dp"
+ android:paddingTop="5dp" >
+
+ <FrameLayout
+ android:layout_width="2dp"
+ android:layout_height="match_parent"
+ android:background="@android:color/transparent" />
+
+ <FrameLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ android:layout_weight="1"
+ android:background="@color/Gray"
+ android:padding="1dp" >
+
+ <ImageView
+ android:id="@+id/statusmenu_reply"
+ style="@style/whiteBtn"
+ android:layout_width="match_parent"
+ android:layout_height="50dp"
+ android:cropToPadding="false"
+ android:padding="5dp"
+ android:src="@drawable/icon_reply" />
+ </FrameLayout>
+
+ <FrameLayout
+ android:layout_width="2dp"
+ android:layout_height="match_parent"
+ android:background="@android:color/transparent" />
+
+ <FrameLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ android:layout_weight="1"
+ android:background="@color/Gray"
+ android:padding="1dp" >
+
+ <ImageView
+ android:id="@+id/statusmenu_retweet"
+ style="@style/whiteBtn"
+ android:layout_width="match_parent"
+ android:layout_height="50dp"
+ android:layout_weight="1"
+ android:padding="5dp"
+ android:src="@drawable/icon_retweet" />
+ </FrameLayout>
+
+ <FrameLayout
+ android:layout_width="2dp"
+ android:layout_height="match_parent"
+ android:background="@android:color/transparent" />
+
+ <FrameLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ android:layout_weight="1"
+ android:background="@color/Gray"
+ android:padding="1dp" >
+
+ <ImageView
+ android:id="@+id/statusmenu_favorite"
+ style="@style/whiteBtn"
+ android:layout_width="match_parent"
+ android:layout_height="50dp"
+ android:layout_weight="1"
+ android:padding="5dp"
+ android:src="@drawable/icon_favorite" />
+ </FrameLayout>
+
+ <FrameLayout
+ android:layout_width="2dp"
+ android:layout_height="match_parent"
+ android:background="@android:color/transparent" />
+
+</LinearLayout> \ No newline at end of file
diff --git a/res/layout/templateactivity_layout.xml b/res/layout/templateactivity_layout.xml
deleted file mode 100644
index 43feea6b..00000000
--- a/res/layout/templateactivity_layout.xml
+++ /dev/null
@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:background="@color/White"
- android:orientation="vertical" >
-
- <RelativeLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:background="@color/LightBlue" >
-
- <TextView
- android:id="@+id/TextView01"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="定型文の管理"
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:textColor="@color/Gray" />
-
- <TextView
- android:id="@+id/TextView02"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_below="@id/TextView01"
- android:text="クリックで編集(長押しで削除)"
- android:textAppearance="?android:attr/textAppearanceSmall"
- android:textColor="@color/Gray" />
-
- <ImageButton
- android:id="@+id/imageButton_template_add"
- android:layout_width="40dp"
- android:layout_height="40dp"
- android:layout_alignParentRight="true"
- android:layout_centerVertical="true"
- android:scaleType="fitCenter"
- android:src="@drawable/icon_add_b" />
-
- </RelativeLayout>
-
- <ListView
- android:id="@+id/listView_template"
- android:fastScrollEnabled="true"
- android:layout_width="match_parent"
- android:layout_height="wrap_content" >
- </ListView>
-
-</LinearLayout> \ No newline at end of file
diff --git a/res/layout/tweet_layout.xml b/res/layout/tweet_layout.xml
deleted file mode 100644
index e95fa21d..00000000
--- a/res/layout/tweet_layout.xml
+++ /dev/null
@@ -1,146 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical"
- android:scrollbars="vertical" >
-
- <LinearLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical"
- android:scrollbars="vertical" >
-
- <TextView
- android:id="@+id/textView_count"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginLeft="10dp"
- android:layout_marginRight="10dp"
- android:layout_marginTop="10dp"
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:textColor="@color/MetroBlue" />
-
- <LinearLayout
- android:id="@+id/linearLayout_tweet_reply"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginLeft="10dp"
- android:layout_marginRight="10dp"
- android:layout_marginTop="10dp"
- android:layout_weight="1">
- </LinearLayout>
-
- <EditText
- android:id="@+id/editText_tweet"
- android:layout_width="match_parent"
- android:layout_height="140dp"
- android:layout_marginBottom="5dp"
- android:layout_marginLeft="10dp"
- android:layout_marginRight="10dp"
- android:layout_marginTop="5dp"
- android:gravity="top"
- android:inputType="text|textMultiLine"
- android:textAppearance="?android:attr/textAppearanceMedium" >
-
- <requestFocus />
- </EditText>
-
- <TableLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="left"
- android:layout_marginLeft="10dp"
- android:layout_marginRight="10dp"
- android:clickable="true"
- android:orientation="horizontal"
- android:scrollbarStyle="outsideOverlay"
- android:scrollbars="horizontal"
- android:splitMotionEvents="true" >
-
- <TableRow
- android:id="@+id/tableRow1"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:clickable="false"
- android:splitMotionEvents="true" >
-
- <ImageButton
- android:id="@+id/imageButton_clean"
- android:layout_width="50dp"
- android:layout_height="50dp"
- android:layout_marginRight="15dp"
- android:background="@android:drawable/btn_default_small"
- android:padding="0dp"
- android:scaleType="fitXY"
- android:src="@drawable/icon_clean" />
-
- <ImageButton
- android:id="@+id/imageButton_menu"
- android:layout_width="50dp"
- android:layout_height="50dp"
- android:layout_marginRight="15dp"
- android:background="@android:drawable/btn_default_small"
- android:padding="0dp"
- android:scaleType="fitXY"
- android:src="@drawable/icon_menu" />
-
- <ImageButton
- android:id="@+id/imageButton_submit"
- android:layout_width="50dp"
- android:layout_height="50dp"
- android:layout_marginRight="10dp"
- android:background="@android:drawable/btn_default_small"
- android:padding="0dp"
- android:scaleType="fitXY"
- android:src="@drawable/icon_submit" />
-
- </TableRow>
-
- <TableRow
- android:id="@+id/tableRow2"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginTop="10dp"
- android:clickable="false"
- android:splitMotionEvents="true" >
-
- <ImageButton
- android:id="@+id/imageButton_pict"
- android:layout_width="50dp"
- android:layout_height="50dp"
- android:layout_marginRight="15dp"
- android:background="@android:drawable/btn_default_small"
- android:padding="0dp"
- android:scaleType="fitXY"
- android:src="@drawable/icon_pict" />
-
- <ImageButton
- android:id="@+id/imageButton_camera"
- android:layout_width="50dp"
- android:layout_height="50dp"
- android:layout_marginRight="15dp"
- android:background="@android:drawable/btn_default_small"
- android:padding="0dp"
- android:scaleType="fitXY"
- android:src="@drawable/icon_camera" />
-
- </TableRow>
-
- </TableLayout>
-
- <LinearLayout
- android:id="@+id/linearLayout_tweet_pict"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginLeft="10dp"
- android:layout_marginRight="10dp"
- android:layout_marginTop="15dp"
- android:layout_weight="1" >
-
- </LinearLayout>
-
- </LinearLayout>
-
-</ScrollView> \ No newline at end of file
diff --git a/res/layout/useractivity_layout.xml b/res/layout/useractivity_layout.xml
deleted file mode 100644
index 3c12f847..00000000
--- a/res/layout/useractivity_layout.xml
+++ /dev/null
@@ -1,256 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:background="@color/White"
- android:orientation="vertical" >
-
- <ScrollView
- android:layout_width="fill_parent"
- android:layout_height="fill_parent" >
-
- <RelativeLayout
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:orientation="vertical" >
-
- <LinearLayout
- android:id="@+id/linearlayout1"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_alignParentTop="true"
- android:orientation="horizontal" >
-
- <ImageView
- android:id="@+id/user_icon"
- android:layout_width="72dp"
- android:layout_height="72dp"
- android:layout_marginLeft="5dp"
- android:layout_marginTop="5dp"
- android:background="@color/White" />
-
- <LinearLayout
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical" >
-
- <TextView
- android:id="@+id/user_screenname"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_marginLeft="5dp"
- android:layout_marginTop="5dp"
- android:gravity="left"
- android:text="screenname"
- android:textAppearance="?android:attr/textAppearanceLarge" />
-
- <TextView
- android:id="@+id/user_name"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_marginLeft="10dp"
- android:layout_marginTop="2dp"
- android:gravity="left"
- android:text="name"
- android:textAppearance="?android:attr/textAppearanceMedium" />
- </LinearLayout>
- </LinearLayout>
-
- <FrameLayout
- android:id="@+id/frame1"
- android:layout_width="fill_parent"
- android:layout_height="1dp"
- android:layout_below="@+id/linearlayout1"
- android:layout_marginTop="5dp"
- android:background="@color/LightGray" />
-
- <LinearLayout
- android:id="@+id/linearlayout2"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_below="@+id/frame1"
- android:orientation="vertical" >
-
- <TextView
- android:id="@+id/user_homepage"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_marginLeft="10dp"
- android:layout_marginTop="5dp"
- android:autoLink="web"
- android:gravity="left"
- android:text="url" />
-
- <TextView
- android:id="@+id/user_locate"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_marginLeft="10dp"
- android:layout_marginTop="5dp"
- android:gravity="left"
- android:text="locate" />
-
- <TextView
- android:id="@+id/user_isfollowing"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginLeft="10dp"
- android:layout_marginTop="5dp"
- android:gravity="left"
- android:text="following" />
-
- <TextView
- android:id="@+id/user_isfollowed"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginLeft="10dp"
- android:layout_marginTop="5dp"
- android:gravity="right"
- android:text="followed" />
-
- <TextView
- android:id="@+id/user_isprotected"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginTop="5dp"
- android:layout_marginLeft="10dp"
- android:gravity="right"
- android:text="protected" />
- </LinearLayout>
-
- <FrameLayout
- android:id="@+id/frame2"
- android:layout_width="fill_parent"
- android:layout_height="1dp"
- android:layout_below="@+id/linearlayout2"
- android:layout_marginTop="5dp"
- android:background="@color/LightGray" />
-
- <TextView
- android:id="@+id/user_bio"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_below="@+id/frame2"
- android:layout_marginLeft="10dp"
- android:layout_marginRight="10dp"
- android:layout_marginTop="5dp"
- android:autoLink="web"
- android:text="bio" />
-
- <FrameLayout
- android:id="@+id/frame3"
- android:layout_width="fill_parent"
- android:layout_height="1dp"
- android:layout_below="@+id/user_bio"
- android:layout_marginTop="5dp"
- android:background="@color/LightGray" />
-
- <LinearLayout
- android:id="@+id/linearlayout3"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_below="@+id/frame3"
- android:orientation="horizontal" >
-
- <LinearLayout
- android:layout_width="wrap_content"
- android:layout_height="fill_parent"
- android:orientation="vertical" >
-
- <TextView
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_marginLeft="10dp"
- android:layout_marginTop="5dp"
- android:gravity="right"
- android:text="Tweet :" />
-
- <TextView
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_marginLeft="10dp"
- android:layout_marginTop="5dp"
- android:gravity="right"
- android:text="Following :" />
-
- <TextView
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_marginLeft="10dp"
- android:layout_marginTop="5dp"
- android:gravity="right"
- android:text="Followed :" />
-
- <TextView
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_marginLeft="10dp"
- android:layout_marginTop="5dp"
- android:gravity="right"
- android:text="Favorite :" />
- </LinearLayout>
-
- <LinearLayout
- android:layout_width="wrap_content"
- android:layout_height="fill_parent"
- android:orientation="vertical" >
-
- <TextView
- android:id="@+id/user_count_tweet"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_marginLeft="5dp"
- android:layout_marginTop="5dp"
- android:gravity="left"
- android:text="0" />
-
- <TextView
- android:id="@+id/user_count_following"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_marginLeft="5dp"
- android:layout_marginTop="5dp"
- android:gravity="left"
- android:text="0" />
-
- <TextView
- android:id="@+id/user_count_followed"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_marginLeft="5dp"
- android:layout_marginTop="5dp"
- android:gravity="left"
- android:text="0" />
-
- <TextView
- android:id="@+id/user_count_favorite"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_marginLeft="5dp"
- android:layout_marginTop="5dp"
- android:gravity="left"
- android:text="0" />
- </LinearLayout>
- </LinearLayout>
-
- <FrameLayout
- android:id="@+id/frame4"
- android:layout_width="fill_parent"
- android:layout_height="1dp"
- android:layout_below="@+id/linearlayout3"
- android:layout_marginTop="5dp"
- android:background="@color/LightGray" />
-
- <LinearLayout
- android:id="@+id/user_status"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_alignParentBottom="true"
- android:layout_below="@+id/frame4"
- android:orientation="vertical" >
- </LinearLayout>
- </RelativeLayout>
-
- </ScrollView>
-
-</LinearLayout> \ No newline at end of file
diff --git a/res/layout/userinfo_layout.xml b/res/layout/userinfo_layout.xml
new file mode 100644
index 00000000..4f36611d
--- /dev/null
+++ b/res/layout/userinfo_layout.xml
@@ -0,0 +1,287 @@
+<?xml version="1.0" encoding="utf-8"?>
+<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:background="@color/White" >
+
+ <LinearLayout
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ android:paddingBottom="10dp" >
+
+ <LinearLayout
+ android:id="@+id/linearlayout1"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal" >
+
+ <ImageView
+ android:id="@+id/user_icon"
+ android:layout_width="72dp"
+ android:layout_height="72dp"
+ android:layout_marginLeft="5dp"
+ android:layout_marginTop="5dp"
+ android:clickable="true" />
+
+ <LinearLayout
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical" >
+
+ <TextView
+ android:id="@+id/user_screenname"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="5dp"
+ android:layout_marginTop="5dp"
+ android:gravity="left"
+ android:text="screenname"
+ android:textAppearance="?android:attr/textAppearanceLarge"
+ android:textColor="@color/Gray" />
+
+ <TextView
+ android:id="@+id/user_name"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="10dp"
+ android:layout_marginTop="2dp"
+ android:gravity="left"
+ android:text="name"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:textColor="@color/Gray" />
+
+ </LinearLayout>
+ </LinearLayout>
+
+ <FrameLayout
+ android:id="@+id/frame1"
+ android:layout_width="fill_parent"
+ android:layout_height="1dp"
+ android:layout_marginTop="5dp"
+ android:background="@color/Gray" />
+
+ <LinearLayout
+ android:id="@+id/linearlayout2"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical" >
+
+ <TextView
+ android:id="@+id/user_homepage"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="10dp"
+ android:layout_marginTop="5dp"
+ android:autoLink="web"
+ android:gravity="left"
+ android:text="url"
+ android:textColor="@color/Gray" />
+
+ <TextView
+ android:id="@+id/user_locate"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="10dp"
+ android:layout_marginTop="5dp"
+ android:gravity="left"
+ android:text="locate"
+ android:textColor="@color/Gray" />
+
+ <TextView
+ android:id="@+id/user_isfollowing"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="10dp"
+ android:layout_marginTop="5dp"
+ android:gravity="left"
+ android:text="following"
+ android:textColor="@color/Gray" />
+
+ <TextView
+ android:id="@+id/user_isfollowed"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="10dp"
+ android:layout_marginTop="5dp"
+ android:gravity="right"
+ android:text="followed"
+ android:textColor="@color/Gray" />
+
+ <TextView
+ android:id="@+id/user_isprotected"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="10dp"
+ android:layout_marginTop="5dp"
+ android:gravity="right"
+ android:text="protected"
+ android:textColor="@color/Gray" />
+ </LinearLayout>
+
+ <FrameLayout
+ android:id="@+id/frame2"
+ android:layout_width="fill_parent"
+ android:layout_height="1dp"
+ android:layout_marginTop="5dp"
+ android:background="@color/Gray" />
+
+ <TextView
+ android:id="@+id/user_bio"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="10dp"
+ android:layout_marginRight="10dp"
+ android:layout_marginTop="5dp"
+ android:autoLink="web"
+ android:text="bio"
+ android:textColor="@color/Gray" />
+
+ <FrameLayout
+ android:id="@+id/frame3"
+ android:layout_width="fill_parent"
+ android:layout_height="1dp"
+ android:layout_marginTop="5dp"
+ android:background="@color/Gray" />
+
+ <LinearLayout
+ android:id="@+id/linearlayout3"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal" >
+
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="fill_parent"
+ android:orientation="vertical" >
+
+ <TextView
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="10dp"
+ android:layout_marginTop="5dp"
+ android:gravity="right"
+ android:text="Tweet :"
+ android:textColor="@color/Gray" />
+
+ <TextView
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="10dp"
+ android:layout_marginTop="5dp"
+ android:gravity="right"
+ android:text="Following :"
+ android:textColor="@color/Gray" />
+
+ <TextView
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="10dp"
+ android:layout_marginTop="5dp"
+ android:gravity="right"
+ android:text="Followed :"
+ android:textColor="@color/Gray" />
+
+ <TextView
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="10dp"
+ android:layout_marginTop="5dp"
+ android:gravity="right"
+ android:text="Favorite :"
+ android:textColor="@color/Gray" />
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="fill_parent"
+ android:orientation="vertical" >
+
+ <TextView
+ android:id="@+id/user_count_tweet"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="5dp"
+ android:layout_marginTop="5dp"
+ android:gravity="left"
+ android:text="0"
+ android:textColor="@color/Gray" />
+
+ <TextView
+ android:id="@+id/user_count_following"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="5dp"
+ android:layout_marginTop="5dp"
+ android:gravity="left"
+ android:text="0"
+ android:textColor="@color/Gray" />
+
+ <TextView
+ android:id="@+id/user_count_followed"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="5dp"
+ android:layout_marginTop="5dp"
+ android:gravity="left"
+ android:text="0"
+ android:textColor="@color/Gray" />
+
+ <TextView
+ android:id="@+id/user_count_favorite"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="5dp"
+ android:layout_marginTop="5dp"
+ android:gravity="left"
+ android:text="0"
+ android:textColor="@color/Gray" />
+ </LinearLayout>
+ </LinearLayout>
+
+ <FrameLayout
+ android:id="@+id/frame4"
+ android:layout_width="fill_parent"
+ android:layout_height="1dp"
+ android:layout_marginTop="5dp"
+ android:background="@color/Gray" />
+
+ <FrameLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ android:layout_marginLeft="15dp"
+ android:layout_marginRight="15dp"
+ android:layout_marginTop="10dp"
+ android:background="@color/Gray"
+ android:padding="1dp" >
+
+ <Button
+ android:id="@+id/user_reload"
+ style="@style/whiteBtn"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="Refresh" />
+ </FrameLayout>
+
+ <FrameLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ android:layout_marginBottom="10dp"
+ android:layout_marginLeft="15dp"
+ android:layout_marginRight="15dp"
+ android:layout_marginTop="10dp"
+ android:background="@color/Gray"
+ android:padding="1dp" >
+
+ <Button
+ android:id="@+id/user_menu"
+ style="@style/whiteBtn"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="Menu" />
+ </FrameLayout>
+ </LinearLayout>
+
+</ScrollView> \ No newline at end of file
diff --git a/res/menu/menu_main.xml b/res/menu/menu_main.xml
new file mode 100644
index 00000000..df49f5bd
--- /dev/null
+++ b/res/menu/menu_main.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<menu xmlns:android="http://schemas.android.com/apk/res/android" >
+ <item android:id="@+id/menu_post" android:title="つぶやく"></item><item android:id="@+id/menu_home" android:title="Homeに戻る"></item>
+
+ <item android:id="@+id/menu_extract" android:title="抽出タブを開く" android:visible="true"></item>
+ <item android:id="@+id/menu_remove" android:title="タブを閉じる" android:visible="false"></item><item android:id="@+id/menu_option" android:title="メインメニュー"></item>
+ <item android:id="@+id/menu_exit" android:title="アプリを終了する"></item>
+
+</menu> \ No newline at end of file
diff --git a/res/values/colors.xml b/res/values/colors.xml
index 29b7d1d4..bd493990 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -1,10 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
+
<color name="Black">#000</color>
<color name="LightBlue">#a0e5ff</color>
<color name="MetroBlue">#0bd1ff</color>
<color name="White">#FFF</color>
<color name="Gray">#202020</color>
+ <color name="Gray2">#808080</color>
<color name="LightGreen">#91FF91</color>
<color name="LightRed">#FFbfba</color>
<color name="Red">#FF1E00</color>
@@ -13,5 +15,4 @@
<color name="ThickGreen">#317C09</color>
<color name="LightGray">#f5f5f5</color>
-
</resources> \ No newline at end of file
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 2e3c7cf6..2dfaffc2 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -16,4 +16,8 @@
<string name="key_setting_open_ime">open_ime</string>
<string name="key_setting_confirm_dialog">confirm_dialog</string>
+
+ <string name="key_setting_footer">footer_visible</string>
+
+ <string name="key_setting_morse">morse_enabled</string>
</resources> \ No newline at end of file
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 90853e6a..e33164e7 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -1,20 +1,28 @@
-<resources>
-
- <!--
- Base application theme, dependent on API level. This theme is replaced
- by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
- -->
- <style name="AppBaseTheme" parent="android:Theme.Light.NoTitleBar">
- <!--
- Theme customizations available in newer API levels can go in
- res/values-vXX/styles.xml, while customizations related to
- backward-compatibility can go here.
- -->
- </style>
-
- <!-- Application theme. -->
- <style name="AppTheme" parent="AppBaseTheme">
- <!-- All customizations that are NOT specific to a particular API-level can go here. -->
- </style>
-
+<resources>
+
+ <!--
+ Base application theme, dependent on API level. This theme is replaced
+ by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
+ -->
+ <style name="AppBaseTheme" parent="android:Theme.Holo.Light.NoActionBar">
+ <!--
+ Theme customizations available in newer API levels can go in
+ res/values-vXX/styles.xml, while customizations related to
+ backward-compatibility can go here.
+ -->
+ </style>
+
+ <!-- Application theme. -->
+ <style name="AppTheme" parent="AppBaseTheme">
+ <!-- All customizations that are NOT specific to a particular API-level can go here. -->
+ </style>
+
+ <style name="grayBtn">
+ <item name="android:background">@xml/graybtn_selector</item>
+ </style>
+
+ <style name="whiteBtn">
+ <item name="android:background">@xml/whitebtn_selector</item>
+ </style>
+
</resources> \ No newline at end of file
diff --git a/res/xml/graybtn_selector.xml b/res/xml/graybtn_selector.xml
new file mode 100644
index 00000000..6f6679e1
--- /dev/null
+++ b/res/xml/graybtn_selector.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <item android:state_pressed="true">
+ <color android:color="@color/MetroBlue"/>
+ </item>
+ <item android:state_pressed="false">
+ <color android:color="@color/Gray"/>
+ </item>
+
+</selector> \ No newline at end of file
diff --git a/res/xml/preference.xml b/res/xml/preference.xml
index 225c2970..6ed510c1 100644
--- a/res/xml/preference.xml
+++ b/res/xml/preference.xml
@@ -2,14 +2,18 @@
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceCategory android:title="基本設定" android:shouldDisableView="false"><Preference android:title="文字サイズ" android:key="@string/key_setting_textSize" android:summary="文字のサイズだよ" android:defaultValue="10" />
- <CheckBoxPreference android:key="@string/key_setting_aftersubmit" android:defaultValue="true" android:title="投稿後にTLに戻る"/>
- <CheckBoxPreference android:title="あんふぁぼ通知" android:key="@string/key_setting_notice_unfav" android:summary="する?" android:defaultValue="false"/>
- <CheckBoxPreference android:title="自動でIMEを開く" android:key="@string/key_setting_open_ime" android:defaultValue="true"/>
- <CheckBoxPreference android:key="@string/key_setting_confirm_dialog" android:summary="安全装置" android:title="いちいち確認する" android:defaultValue="true"/>
-</PreferenceCategory>
+ <SwitchPreference android:title="フッターバー" android:key="@string/key_setting_footer" android:summaryOn="表示する" android:summaryOff="表示しない" android:defaultValue="true"/>
+ <SwitchPreference android:key="@string/key_setting_aftersubmit" android:defaultValue="true" android:title="投稿後" android:summaryOn="ホームに戻る" android:summaryOff="そのまま"/>
+ <SwitchPreference android:title="あんふぁぼ通知" android:key="@string/key_setting_notice_unfav" android:defaultValue="false" android:summaryOn="有効" android:summaryOff="無効"/>
+ <SwitchPreference android:title="投稿画面表示時" android:key="@string/key_setting_open_ime" android:defaultValue="true" android:summaryOn="IMEを開く" android:summaryOff="IMEを開かない"/>
+ <SwitchPreference android:key="@string/key_setting_confirm_dialog" android:title="確認ダイアログ" android:defaultValue="true" android:summaryOn="有効" android:summaryOff="無効"/><SwitchPreference android:title="モールス解読" android:summaryOn="有効" android:summaryOff="無効" android:key="@string/key_setting_morse" android:defaultValue="true"/></PreferenceCategory>
-<PreferenceCategory android:title="その他" android:shouldDisableView="false"><Preference android:key="@string/key_setting_delete_accounts" android:summary="再起動後に認証してね" android:title="認証情報を削除"/><Preference android:title="Powered by twitter4j" android:summary="Apache License 2.0" android:key="@string/key_setting_t4j" />
+<PreferenceCategory android:title="その他" android:shouldDisableView="false"><Preference android:key="@string/key_setting_delete_accounts" android:summary="再起動後に認証してね" android:title="認証情報を削除"/>
+ <Preference android:title="Powered by twitter4j" android:summary="Apache License 2.0" android:key="@string/key_setting_t4j" />
</PreferenceCategory>
+
+
+
</PreferenceScreen> \ No newline at end of file
diff --git a/res/xml/whitebtn_selector.xml b/res/xml/whitebtn_selector.xml
new file mode 100644
index 00000000..39ba21df
--- /dev/null
+++ b/res/xml/whitebtn_selector.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <item android:state_pressed="true">
+ <color android:color="@color/MetroBlue"/>
+ </item>
+ <item android:state_pressed="false">
+ <color android:color="@color/White"/>
+ </item>
+
+</selector> \ No newline at end of file
diff --git a/src/net/miz_hi/smileessence/Client.java b/src/net/miz_hi/smileessence/Client.java
index c2ed50ef..68b25500 100644
--- a/src/net/miz_hi/smileessence/Client.java
+++ b/src/net/miz_hi/smileessence/Client.java
@@ -13,6 +13,7 @@ import net.miz_hi.smileessence.preference.PreferenceHelper;
import android.app.Application;
import android.content.res.Resources;
import android.database.sqlite.SQLiteDatabase;
+import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.preference.PreferenceManager;
public class Client
@@ -44,12 +45,11 @@ public class Client
public static boolean hasAuthedAccount()
{
- Long lastUsedId = (Long) getPreferenceValue(EnumPreferenceKey.LAST_USED_USER_ID);
if (AuthentificationDB.instance().findAll() == null)
{
return false;
}
- return lastUsedId > 0 && !AuthentificationDB.instance().findAll().isEmpty();
+ return !AuthentificationDB.instance().findAll().isEmpty();
}
public static Application getApplication()
@@ -132,8 +132,7 @@ public class Client
MyExecutor.init();
}
- public static final String HOMEPAGE_URL = "http://warotter.web.fc2.com/";
- public static final String T4J_URL = "http://twitter4j.org/";
+ public static final String HOMEPAGE_URL = "http://smileessence.miz-hi.net/";
public static final String PREF_OAUTH_NAME = "oauth_pref";
public static final String CALLBACK_OAUTH = "oauth://smileessence";
diff --git a/src/net/miz_hi/smileessence/async/AsyncFavoriteTask.java b/src/net/miz_hi/smileessence/async/AsyncFavoriteTask.java
index edfa1717..9b32a8ed 100644
--- a/src/net/miz_hi/smileessence/async/AsyncFavoriteTask.java
+++ b/src/net/miz_hi/smileessence/async/AsyncFavoriteTask.java
@@ -2,11 +2,14 @@ package net.miz_hi.smileessence.async;
import java.util.concurrent.Callable;
+
import net.miz_hi.smileessence.Client;
import net.miz_hi.smileessence.auth.Account;
-import net.miz_hi.smileessence.util.TwitterManager;
+import net.miz_hi.smileessence.core.Notifier;
+import net.miz_hi.smileessence.twitter.TwitterManager;
+import net.miz_hi.smileessence.util.SimpleAsyncTask;
-public class AsyncFavoriteTask implements Callable<Boolean>
+public class AsyncFavoriteTask extends SimpleAsyncTask<Boolean> implements Callable<Boolean>
{
private Account account;
private long statusId;
@@ -28,4 +31,23 @@ public class AsyncFavoriteTask implements Callable<Boolean>
return TwitterManager.favorite(account, statusId);
}
+ @Override
+ protected Boolean doInBackground(Object... params)
+ {
+ return call();
+ }
+
+ @Override
+ protected void onPostExecute(Boolean result)
+ {
+ if (result)
+ {
+ Notifier.info(TwitterManager.MESSAGE_FAVORITE_SUCCESS);
+ }
+ else
+ {
+ Notifier.info(TwitterManager.MESSAGE_FAVORITE_DEPLICATE);
+ }
+ }
+
}
diff --git a/src/net/miz_hi/smileessence/async/AsyncIconGetter.java b/src/net/miz_hi/smileessence/async/AsyncIconGetter.java
index f7a462e4..f56468c5 100644
--- a/src/net/miz_hi/smileessence/async/AsyncIconGetter.java
+++ b/src/net/miz_hi/smileessence/async/AsyncIconGetter.java
@@ -45,7 +45,7 @@ public class AsyncIconGetter implements Callable<Bitmap>
fos.close();
Icon icon = new Icon(bm, IconCaches.genIconName(user));
IconCaches.putIconToMap(user.userId, icon);
- LogHelper.printD("icon get from web");
+ LogHelper.d("icon get from web");
return icon.use();
}
catch (Exception e)
diff --git a/src/net/miz_hi/smileessence/async/AsyncMentionsGetter.java b/src/net/miz_hi/smileessence/async/AsyncMentionsGetter.java
index d6c498a6..58ba8331 100644
--- a/src/net/miz_hi/smileessence/async/AsyncMentionsGetter.java
+++ b/src/net/miz_hi/smileessence/async/AsyncMentionsGetter.java
@@ -7,7 +7,7 @@ import java.util.concurrent.Callable;
import net.miz_hi.smileessence.auth.Account;
import net.miz_hi.smileessence.data.StatusModel;
import net.miz_hi.smileessence.data.StatusStore;
-import net.miz_hi.smileessence.util.TwitterManager;
+import net.miz_hi.smileessence.twitter.TwitterManager;
import twitter4j.Paging;
import twitter4j.Status;
diff --git a/src/net/miz_hi/smileessence/async/AsyncRetweetTask.java b/src/net/miz_hi/smileessence/async/AsyncRetweetTask.java
index 17eb0df9..a68c04af 100644
--- a/src/net/miz_hi/smileessence/async/AsyncRetweetTask.java
+++ b/src/net/miz_hi/smileessence/async/AsyncRetweetTask.java
@@ -2,9 +2,10 @@ package net.miz_hi.smileessence.async;
import java.util.concurrent.Callable;
+
import net.miz_hi.smileessence.Client;
import net.miz_hi.smileessence.auth.Account;
-import net.miz_hi.smileessence.util.TwitterManager;
+import net.miz_hi.smileessence.twitter.TwitterManager;
public class AsyncRetweetTask implements Callable<Boolean>
{
diff --git a/src/net/miz_hi/smileessence/async/AsyncTimelineGetter.java b/src/net/miz_hi/smileessence/async/AsyncTimelineGetter.java
index 1a5a37ea..10ae50e0 100644
--- a/src/net/miz_hi/smileessence/async/AsyncTimelineGetter.java
+++ b/src/net/miz_hi/smileessence/async/AsyncTimelineGetter.java
@@ -8,7 +8,7 @@ import java.util.concurrent.Callable;
import net.miz_hi.smileessence.auth.Account;
import net.miz_hi.smileessence.data.StatusModel;
import net.miz_hi.smileessence.data.StatusStore;
-import net.miz_hi.smileessence.util.TwitterManager;
+import net.miz_hi.smileessence.twitter.TwitterManager;
import twitter4j.Paging;
import twitter4j.Status;
diff --git a/src/net/miz_hi/smileessence/async/AsyncTweetTask.java b/src/net/miz_hi/smileessence/async/AsyncTweetTask.java
index 933a893c..b60d435e 100644
--- a/src/net/miz_hi/smileessence/async/AsyncTweetTask.java
+++ b/src/net/miz_hi/smileessence/async/AsyncTweetTask.java
@@ -4,9 +4,9 @@ import java.util.concurrent.Callable;
import net.miz_hi.smileessence.Client;
import net.miz_hi.smileessence.auth.Account;
-import net.miz_hi.smileessence.event.ToastManager;
+import net.miz_hi.smileessence.core.Notifier;
+import net.miz_hi.smileessence.twitter.TwitterManager;
import net.miz_hi.smileessence.util.SimpleAsyncTask;
-import net.miz_hi.smileessence.util.TwitterManager;
import twitter4j.StatusUpdate;
public class AsyncTweetTask extends SimpleAsyncTask<Boolean> implements Callable<Boolean>
@@ -28,7 +28,7 @@ public class AsyncTweetTask extends SimpleAsyncTask<Boolean> implements Callable
@Override
protected Boolean doInBackground(Object... arg0)
{
- return TwitterManager.tweet(account, status);
+ return call();
}
@Override
@@ -36,11 +36,11 @@ public class AsyncTweetTask extends SimpleAsyncTask<Boolean> implements Callable
{
if (result)
{
- ToastManager.toast(TwitterManager.MESSAGE_TWEET_SUCCESS);
+ Notifier.info(TwitterManager.MESSAGE_TWEET_SUCCESS);
}
else
{
- ToastManager.toast(TwitterManager.MESSAGE_TWEET_DEPLICATE);
+ Notifier.info(TwitterManager.MESSAGE_TWEET_DEPLICATE);
}
}
diff --git a/src/net/miz_hi/smileessence/auth/AuthorizeHelper.java b/src/net/miz_hi/smileessence/auth/AuthorizeHelper.java
index eb753766..c35f9f4c 100644
--- a/src/net/miz_hi/smileessence/auth/AuthorizeHelper.java
+++ b/src/net/miz_hi/smileessence/auth/AuthorizeHelper.java
@@ -5,6 +5,7 @@ import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
+import net.miz_hi.smileessence.async.MyExecutor;
import net.miz_hi.smileessence.auth.Consumers.Consumer;
import net.miz_hi.smileessence.core.EnumRequestCode;
import net.miz_hi.smileessence.view.WebViewActivity;
@@ -22,7 +23,6 @@ public class AuthorizeHelper
private Consumer consumer;
private Twitter twitter;
private RequestToken req;
- private ExecutorService executor;
public static final String CALLBACK_OAUTH = "oauth://smileessence";
public static final String OAUTH_VERIFIER = "oauth_verifier";
@@ -31,7 +31,6 @@ public class AuthorizeHelper
{
this.activity = activity;
this.consumer = consumer;
- executor = Executors.newSingleThreadExecutor();
}
public void oauthSend()
@@ -40,7 +39,7 @@ public class AuthorizeHelper
{
twitter = new TwitterFactory().getInstance();
twitter.setOAuthConsumer(consumer.key, consumer.secret);
- Future<RequestToken> f = executor.submit(new Callable<RequestToken>()
+ Future<RequestToken> f = MyExecutor.submit(new Callable<RequestToken>()
{
@Override
@@ -67,7 +66,7 @@ public class AuthorizeHelper
{
final String verifier = uri.getQueryParameter(OAUTH_VERIFIER);
AccessToken accessToken = null;
- Future<AccessToken> f = executor.submit(new Callable<AccessToken>()
+ Future<AccessToken> f = MyExecutor.submit(new Callable<AccessToken>()
{
@Override
diff --git a/src/net/miz_hi/smileessence/command/CommandAddTemplate.java b/src/net/miz_hi/smileessence/command/CommandAddTemplate.java
index 5c928f6d..f3baa70f 100644
--- a/src/net/miz_hi/smileessence/command/CommandAddTemplate.java
+++ b/src/net/miz_hi/smileessence/command/CommandAddTemplate.java
@@ -1,7 +1,7 @@
package net.miz_hi.smileessence.command;
+import net.miz_hi.smileessence.core.Notifier;
import net.miz_hi.smileessence.data.template.Templates;
-import net.miz_hi.smileessence.event.ToastManager;
public class CommandAddTemplate extends MenuCommand
{
@@ -23,6 +23,6 @@ public class CommandAddTemplate extends MenuCommand
public void workOnUiThread()
{
Templates.addTemplate(text);
- ToastManager.toast("lj܂");
+ Notifier.info("lj܂");
}
}
diff --git a/src/net/miz_hi/smileessence/command/CommandEditMenu.java b/src/net/miz_hi/smileessence/command/CommandEditMenu.java
index e87fdbf1..919317a1 100644
--- a/src/net/miz_hi/smileessence/command/CommandEditMenu.java
+++ b/src/net/miz_hi/smileessence/command/CommandEditMenu.java
@@ -5,8 +5,8 @@ import java.util.HashMap;
import net.miz_hi.smileessence.Client;
import net.miz_hi.smileessence.data.StatusModel;
-import net.miz_hi.smileessence.dialog.CheckBoxListDialogHelper;
-import net.miz_hi.smileessence.dialog.CheckBoxListDialogHelper.CheckBoxItem;
+import net.miz_hi.smileessence.dialog.CheckBoxListDialog;
+import net.miz_hi.smileessence.dialog.CheckBoxListDialog.CheckBoxItem;
import net.miz_hi.smileessence.menu.StatusMenu;
import net.miz_hi.smileessence.preference.EnumPreferenceKey.EnumValueType;
import android.app.Activity;
@@ -32,14 +32,14 @@ public class CommandEditMenu extends MenuCommand
@Override
public void workOnUiThread()
{
- final CheckBoxListDialogHelper helper = new CheckBoxListDialogHelper(activity);
- helper.setTitle("\鍀ڂݒ肵Ă");
+ final CheckBoxListDialog listDialog = new CheckBoxListDialog(activity);
+ listDialog.setTitle("\鍀ڂݒ肵Ă");
ArrayList<CheckBoxItem> list = new ArrayList<CheckBoxItem>();
- final HashMap<CheckBoxItem, MenuCommand> map = new HashMap<CheckBoxItem, MenuCommand>();
+ final HashMap<CheckBoxItem, ICommand> map = new HashMap<CheckBoxItem, ICommand>();
StatusModel nullModel = StatusModel.getNullStatusModel();
StatusMenu adapter = new StatusMenu(activity, nullModel);
- for(MenuCommand item : adapter.getStatusMenu())
+ for(ICommand item : adapter.getStatusMenu())
{
if(item instanceof IHideable && item.getDefaultVisibility())
{
@@ -50,9 +50,9 @@ public class CommandEditMenu extends MenuCommand
}
}
- helper.setItems((list.toArray(new CheckBoxItem[0])));
+ listDialog.setItems((list.toArray(new CheckBoxItem[0])));
- helper.setOnClicked(new OnClickListener()
+ listDialog.setOnClicked(new OnClickListener()
{
@Override
@@ -62,11 +62,11 @@ public class CommandEditMenu extends MenuCommand
{
case DialogInterface.BUTTON_POSITIVE:
{
- CheckBoxItem[] items = helper.getItems();
+ CheckBoxItem[] items = listDialog.getItems();
for(CheckBoxItem item : items)
{
boolean value = item.value;
- MenuCommand command = map.get(item);
+ ICommand command = map.get(item);
Client.getPreferenceHelper().putPreferenceValue(command.getClass().getSimpleName(), EnumValueType.BOOLEAN, item.value);
}
dialog.dismiss();
@@ -80,7 +80,7 @@ public class CommandEditMenu extends MenuCommand
}
});
- helper.createDialog().show();
+ listDialog.createDialog().show();
}
}
diff --git a/src/net/miz_hi/smileessence/command/CommandMenuBack.java b/src/net/miz_hi/smileessence/command/CommandMenuBack.java
deleted file mode 100644
index d8bcc03a..00000000
--- a/src/net/miz_hi/smileessence/command/CommandMenuBack.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package net.miz_hi.smileessence.command;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import net.miz_hi.smileessence.dialog.DialogAdapter;
-import android.view.View;
-
-public class CommandMenuBack extends MenuCommand
-{
-
- private DialogAdapter adapter;
- private List<ICommand> list = new ArrayList<ICommand>();
- private View[] titleView;
-
- public CommandMenuBack(DialogAdapter adapter)
- {
- this.adapter = adapter;
- this.list.addAll(adapter.getList());
- this.titleView = adapter.getTitleViews();
- }
-
- @Override
- public String getName()
- {
- return "< ߂";
- }
-
- @Override
- public void workOnUiThread()
- {
- adapter.setMenuItems(list);
- adapter.setTitle(titleView);
- adapter.createMenuDialog(false).show();
- }
-
-}
diff --git a/src/net/miz_hi/smileessence/command/CommandMenuParent.java b/src/net/miz_hi/smileessence/command/CommandMenuParent.java
deleted file mode 100644
index 22132037..00000000
--- a/src/net/miz_hi/smileessence/command/CommandMenuParent.java
+++ /dev/null
@@ -1,39 +0,0 @@
-package net.miz_hi.smileessence.command;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import net.miz_hi.smileessence.dialog.DialogAdapter;
-
-public class CommandMenuParent extends MenuCommand
-{
-
- private DialogAdapter adapter;
- private String text;
- private List<MenuCommand> list = new ArrayList<MenuCommand>();
-
- public CommandMenuParent(DialogAdapter adapter, String text, List<MenuCommand> list)
- {
- this.adapter = adapter;
- this.text = text;
- this.list.addAll(list);
- }
-
- @Override
- public String getName()
- {
- return text + " >";
- }
-
- @Override
- public void workOnUiThread()
- {
- if (!(list.get(0) instanceof CommandMenuBack))
- {
- list.add(0, new CommandMenuBack(adapter));
- }
- adapter.setMenuItems(list);
- adapter.setTitle(text);
- adapter.createMenuDialog(false).show();
- }
-}
diff --git a/src/net/miz_hi/smileessence/command/CommandOpenPostPage.java b/src/net/miz_hi/smileessence/command/CommandOpenPostPage.java
new file mode 100644
index 00000000..2710353d
--- /dev/null
+++ b/src/net/miz_hi/smileessence/command/CommandOpenPostPage.java
@@ -0,0 +1,21 @@
+package net.miz_hi.smileessence.command;
+
+import net.miz_hi.smileessence.system.PostSystem;
+import net.miz_hi.smileessence.view.MainActivity;
+
+public class CommandOpenPostPage extends MenuCommand
+{
+
+ @Override
+ public String getName()
+ {
+ return "eʂ";
+ }
+
+ @Override
+ public void workOnUiThread()
+ {
+ PostSystem.openPostPage();
+ }
+
+}
diff --git a/src/net/miz_hi/smileessence/command/CommandParseMorse.java b/src/net/miz_hi/smileessence/command/CommandParseMorse.java
deleted file mode 100644
index b5e35856..00000000
--- a/src/net/miz_hi/smileessence/command/CommandParseMorse.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package net.miz_hi.smileessence.command;
-
-import net.miz_hi.smileessence.system.TweetSystem;
-import net.miz_hi.smileessence.util.Morse;
-
-public class CommandParseMorse extends MenuCommand
-{
-
- public CommandParseMorse()
- {
- }
-
- @Override
- public String getName()
- {
- return "[Xɕϊ";
- }
-
- @Override
- public void workOnUiThread()
- {
- String newStr = Morse.jaToMc(TweetSystem.getText());
- TweetSystem.setText(newStr);
- }
-}
diff --git a/src/net/miz_hi/smileessence/command/CommandReConnect.java b/src/net/miz_hi/smileessence/command/CommandReConnect.java
index 9033abfb..a89e1a2a 100644
--- a/src/net/miz_hi/smileessence/command/CommandReConnect.java
+++ b/src/net/miz_hi/smileessence/command/CommandReConnect.java
@@ -1,6 +1,7 @@
package net.miz_hi.smileessence.command;
import net.miz_hi.smileessence.system.MainSystem;
+import net.miz_hi.smileessence.view.MainActivity;
public class CommandReConnect extends MenuCommand
{
@@ -18,7 +19,7 @@ public class CommandReConnect extends MenuCommand
@Override
public void workOnUiThread()
{
- MainSystem.getInstance().connectUserStream();
+ MainSystem.getInstance().connectUserStream(MainActivity.getInstance());
}
}
diff --git a/src/net/miz_hi/smileessence/command/CommandReport.java b/src/net/miz_hi/smileessence/command/CommandReport.java
deleted file mode 100644
index d4300adb..00000000
--- a/src/net/miz_hi/smileessence/command/CommandReport.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package net.miz_hi.smileessence.command;
-
-import net.miz_hi.smileessence.system.TweetSystem;
-import net.miz_hi.smileessence.view.TweetView;
-
-public class CommandReport extends MenuCommand
-{
-
- public CommandReport()
- {
- }
-
- @Override
- public String getName()
- {
- return "҂փ|[g𑗂";
- }
-
- @Override
- public void workOnUiThread()
- {
- TweetSystem.setText("#SmileEssence @laco0416 ");
- TweetView.open();
- }
-
-}
diff --git a/src/net/miz_hi/smileessence/command/CommandTweet.java b/src/net/miz_hi/smileessence/command/CommandTweet.java
deleted file mode 100644
index 10da477d..00000000
--- a/src/net/miz_hi/smileessence/command/CommandTweet.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package net.miz_hi.smileessence.command;
-
-import net.miz_hi.smileessence.view.TweetView;
-
-public class CommandTweet extends MenuCommand
-{
-
- @Override
- public String getName()
- {
- return "‚Ԃ₭";
- }
-
- @Override
- public void workOnUiThread()
- {
- TweetView.open();
- }
-
-}
diff --git a/src/net/miz_hi/smileessence/command/MenuCommand.java b/src/net/miz_hi/smileessence/command/MenuCommand.java
index b250bce6..91f9f672 100644
--- a/src/net/miz_hi/smileessence/command/MenuCommand.java
+++ b/src/net/miz_hi/smileessence/command/MenuCommand.java
@@ -1,6 +1,6 @@
package net.miz_hi.smileessence.command;
-import net.miz_hi.smileessence.dialog.DialogAdapter;
+import net.miz_hi.smileessence.dialog.MenuDialog;
import net.miz_hi.smileessence.util.UiHandler;
public abstract class MenuCommand implements ICommand
@@ -21,7 +21,7 @@ public abstract class MenuCommand implements ICommand
@Override
public void run()
{
- DialogAdapter.dispose();
+ MenuDialog.dispose();
workOnUiThread();
}
}.post();
diff --git a/src/net/miz_hi/smileessence/command/CommandOpenFavstar.java b/src/net/miz_hi/smileessence/command/main/CommandOpenFavstar.java
index 6cb7fee4..504f890b 100644
--- a/src/net/miz_hi/smileessence/command/CommandOpenFavstar.java
+++ b/src/net/miz_hi/smileessence/command/main/CommandOpenFavstar.java
@@ -1,6 +1,7 @@
-package net.miz_hi.smileessence.command;
+package net.miz_hi.smileessence.command.main;
import net.miz_hi.smileessence.Client;
+import net.miz_hi.smileessence.command.MenuCommand;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
diff --git a/src/net/miz_hi/smileessence/command/CommandOpenFollowers.java b/src/net/miz_hi/smileessence/command/main/CommandOpenFollowers.java
index 30f8125f..2b0cd602 100644
--- a/src/net/miz_hi/smileessence/command/CommandOpenFollowers.java
+++ b/src/net/miz_hi/smileessence/command/main/CommandOpenFollowers.java
@@ -1,6 +1,7 @@
-package net.miz_hi.smileessence.command;
+package net.miz_hi.smileessence.command.main;
import net.miz_hi.smileessence.Client;
+import net.miz_hi.smileessence.command.MenuCommand;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
diff --git a/src/net/miz_hi/smileessence/command/CommandOpenFriends.java b/src/net/miz_hi/smileessence/command/main/CommandOpenFriends.java
index 6456123b..7eb8dfcc 100644
--- a/src/net/miz_hi/smileessence/command/CommandOpenFriends.java
+++ b/src/net/miz_hi/smileessence/command/main/CommandOpenFriends.java
@@ -1,6 +1,7 @@
-package net.miz_hi.smileessence.command;
+package net.miz_hi.smileessence.command.main;
import net.miz_hi.smileessence.Client;
+import net.miz_hi.smileessence.command.MenuCommand;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
diff --git a/src/net/miz_hi/smileessence/command/CommandOpenSetting.java b/src/net/miz_hi/smileessence/command/main/CommandOpenSetting.java
index bb8f7387..8f3a37b6 100644
--- a/src/net/miz_hi/smileessence/command/CommandOpenSetting.java
+++ b/src/net/miz_hi/smileessence/command/main/CommandOpenSetting.java
@@ -1,5 +1,6 @@
-package net.miz_hi.smileessence.command;
+package net.miz_hi.smileessence.command.main;
+import net.miz_hi.smileessence.command.MenuCommand;
import net.miz_hi.smileessence.view.SettingActivity;
import android.app.Activity;
import android.content.Intent;
diff --git a/src/net/miz_hi/smileessence/command/main/CommandReport.java b/src/net/miz_hi/smileessence/command/main/CommandReport.java
new file mode 100644
index 00000000..0cf58b6b
--- /dev/null
+++ b/src/net/miz_hi/smileessence/command/main/CommandReport.java
@@ -0,0 +1,25 @@
+package net.miz_hi.smileessence.command.main;
+
+import net.miz_hi.smileessence.command.MenuCommand;
+import net.miz_hi.smileessence.system.PostSystem;
+
+public class CommandReport extends MenuCommand
+{
+
+ public CommandReport()
+ {
+ }
+
+ @Override
+ public String getName()
+ {
+ return "҂փ|[g𑗂";
+ }
+
+ @Override
+ public void workOnUiThread()
+ {
+ PostSystem.setText("#SmileEssence @laco0416 ").openPostPage();
+ }
+
+}
diff --git a/src/net/miz_hi/smileessence/command/CommandAppendHashtag.java b/src/net/miz_hi/smileessence/command/post/CommandAppendHashtag.java
index 36d9cae0..53927103 100644
--- a/src/net/miz_hi/smileessence/command/CommandAppendHashtag.java
+++ b/src/net/miz_hi/smileessence/command/post/CommandAppendHashtag.java
@@ -1,7 +1,7 @@
-package net.miz_hi.smileessence.command;
+package net.miz_hi.smileessence.command.post;
-import net.miz_hi.smileessence.system.TweetSystem;
-import net.miz_hi.smileessence.view.TweetView;
+import net.miz_hi.smileessence.command.MenuCommand;
+import net.miz_hi.smileessence.system.PostSystem;
public class CommandAppendHashtag extends MenuCommand
{
@@ -22,7 +22,6 @@ public class CommandAppendHashtag extends MenuCommand
@Override
public void workOnUiThread()
{
- TweetSystem.appendText(" #" + hashtag);
- TweetView.open();
+ PostSystem.appendText(" #" + hashtag).openPostPage();
}
}
diff --git a/src/net/miz_hi/smileessence/command/CommandInsertText.java b/src/net/miz_hi/smileessence/command/post/CommandInsertText.java
index 346886d9..df82a00e 100644
--- a/src/net/miz_hi/smileessence/command/CommandInsertText.java
+++ b/src/net/miz_hi/smileessence/command/post/CommandInsertText.java
@@ -1,6 +1,8 @@
-package net.miz_hi.smileessence.command;
+package net.miz_hi.smileessence.command.post;
-import net.miz_hi.smileessence.system.TweetSystem;
+import net.miz_hi.smileessence.command.MenuCommand;
+import net.miz_hi.smileessence.system.PostSystem;
+import net.miz_hi.smileessence.view.PostFragment;
public class CommandInsertText extends MenuCommand
{
@@ -21,7 +23,7 @@ public class CommandInsertText extends MenuCommand
@Override
public void workOnUiThread()
{
- TweetSystem.insertText(text);
+ PostSystem.insertText(text).openPostPage();
}
}
diff --git a/src/net/miz_hi/smileessence/command/post/CommandParseMorse.java b/src/net/miz_hi/smileessence/command/post/CommandParseMorse.java
new file mode 100644
index 00000000..4f8f9579
--- /dev/null
+++ b/src/net/miz_hi/smileessence/command/post/CommandParseMorse.java
@@ -0,0 +1,27 @@
+package net.miz_hi.smileessence.command.post;
+
+import net.miz_hi.smileessence.command.MenuCommand;
+import net.miz_hi.smileessence.system.PostSystem;
+import net.miz_hi.smileessence.util.Morse;
+import net.miz_hi.smileessence.view.PostFragment;
+
+public class CommandParseMorse extends MenuCommand
+{
+
+ public CommandParseMorse()
+ {
+ }
+
+ @Override
+ public String getName()
+ {
+ return "[Xɕϊ";
+ }
+
+ @Override
+ public void workOnUiThread()
+ {
+ String newStr = Morse.jaToMc(PostSystem.getText());
+ PostSystem.setText(newStr).openPostPage();
+ }
+}
diff --git a/src/net/miz_hi/smileessence/command/status/StatusCommandAddReply.java b/src/net/miz_hi/smileessence/command/status/StatusCommandAddReply.java
deleted file mode 100644
index a74b1474..00000000
--- a/src/net/miz_hi/smileessence/command/status/StatusCommandAddReply.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package net.miz_hi.smileessence.command.status;
-
-import net.miz_hi.smileessence.data.StatusModel;
-import net.miz_hi.smileessence.event.ToastManager;
-import net.miz_hi.smileessence.system.TweetSystem;
-
-public class StatusCommandAddReply extends StatusCommand
-{
-
- public StatusCommandAddReply(StatusModel model)
- {
- super(model);
- }
-
- @Override
- public String getName()
- {
- return "vCɒlj";
- }
-
- @Override
- public void workOnUiThread()
- {
- TweetSystem.addReply(status.screenName);
- ToastManager.toast(status.screenName + "vCɒlj܂");
- }
-}
diff --git a/src/net/miz_hi/smileessence/command/status/StatusCommandChaseRelation.java b/src/net/miz_hi/smileessence/command/status/StatusCommandChaseRelation.java
index 83c7b547..9c3a5fa6 100644
--- a/src/net/miz_hi/smileessence/command/status/StatusCommandChaseRelation.java
+++ b/src/net/miz_hi/smileessence/command/status/StatusCommandChaseRelation.java
@@ -3,21 +3,20 @@ package net.miz_hi.smileessence.command.status;
import java.util.ArrayList;
import java.util.List;
-import net.miz_hi.smileessence.Client;
import net.miz_hi.smileessence.async.MyExecutor;
-import net.miz_hi.smileessence.command.IHideable;
import net.miz_hi.smileessence.data.StatusModel;
import net.miz_hi.smileessence.data.StatusStore;
import net.miz_hi.smileessence.status.StatusListAdapter;
-import net.miz_hi.smileessence.system.MainSystem;
-import net.miz_hi.smileessence.util.TwitterManager;
+import net.miz_hi.smileessence.status.StatusUtils;
+import net.miz_hi.smileessence.system.RelationSystem;
+import net.miz_hi.smileessence.util.LogHelper;
import net.miz_hi.smileessence.view.MainActivity;
-import net.miz_hi.smileessence.view.RelationListPageFragment;
-import twitter4j.Status;
+import net.miz_hi.smileessence.view.RelationFragment;
+import android.support.v4.app.Fragment;
-public class StatusCommandChaseRelation extends StatusCommand implements IHideable
+public class StatusCommandChaseRelation extends StatusCommand
{
-
+
public StatusCommandChaseRelation(StatusModel status)
{
super(status);
@@ -31,85 +30,17 @@ public class StatusCommandChaseRelation extends StatusCommand implements IHideab
@Override
public void workOnUiThread()
- {
- RelationListPageFragment.setChasingId(status.statusId);
- final StatusListAdapter adapter = MainSystem.getInstance().relationListAdapter;
- adapter.clear();
- adapter.forceNotifyAdapter();
- adapter.addFirst(status);
- adapter.notifyAdapter();
-
- MyExecutor.execute(new Runnable()
- {
-
- @Override
- public void run()
- {
- long id = status.statusId;
-
- for(StatusModel statusModel0: StatusStore.getList())
- {
- List<StatusModel> list = new ArrayList<StatusModel>();
- for(StatusModel statusModel1: StatusStore.getList())
- {
- if(statusModel1.inReplyToStatusId == id)
- {
- list.add(statusModel1);
- }
- }
- StatusModel statusModel;
- if(!list.isEmpty())
- {
- statusModel = list.get(0);
- for(StatusModel statusModel2 : list)
- {
- if(statusModel.compareTo(statusModel2) > 0)
- {
- statusModel = statusModel2;
- }
- }
- adapter.addFirst(statusModel);
- id = statusModel.statusId;
- RelationListPageFragment.setChasingId(id);
- continue;
- }
- }
-
- id = status.inReplyToStatusId;
- while(id > -1)
- {
- StatusModel statusModel = chaseRelation(id);
- if(statusModel != null)
- {
- adapter.addLast(statusModel);
- adapter.forceNotifyAdapter();
- }
- else
- {
- break;
- }
- id = statusModel.inReplyToStatusId;
- }
- }
- });
-
- MainActivity.getInstance().getViewPager().setCurrentItem(3, true);
-
- }
-
- private StatusModel chaseRelation(long id)
- {
- StatusModel statusModel = StatusStore.get(id);
- if(statusModel == null)
+ {
+ if(RelationSystem.getRelationByChasingId(status.statusId) != null)
{
- Status status = TwitterManager.getStatus(Client.getMainAccount(), id);
- if(status == null)
- {
- return null;
- }
- statusModel = StatusStore.put(status);
+ Fragment fragment = RelationSystem.getRelationByChasingId(status.statusId);
+ MainActivity.moveViewPage(MainActivity.getInstance().getFragmentAdapter().getItemPosition(fragment));
+ return;
}
- return statusModel;
+ final RelationFragment relFragment = RelationFragment.newInstance(status.statusId);
+ RelationSystem.startRelation(relFragment);
+ MainActivity.addPage(relFragment);
+ MainActivity.moveViewPage(MainActivity.getPagerCount());
}
@Override
diff --git a/src/net/miz_hi/smileessence/command/status/StatusCommandClipboard.java b/src/net/miz_hi/smileessence/command/status/StatusCommandClipboard.java
index 3932d1af..4b7461ba 100644
--- a/src/net/miz_hi/smileessence/command/status/StatusCommandClipboard.java
+++ b/src/net/miz_hi/smileessence/command/status/StatusCommandClipboard.java
@@ -2,10 +2,10 @@ package net.miz_hi.smileessence.command.status;
import net.miz_hi.smileessence.Client;
import net.miz_hi.smileessence.command.IHideable;
+import net.miz_hi.smileessence.core.Notifier;
import net.miz_hi.smileessence.data.StatusModel;
-import net.miz_hi.smileessence.event.ToastManager;
+import android.content.ClipboardManager;
import android.content.Context;
-import android.text.ClipboardManager;
public class StatusCommandClipboard extends StatusCommand implements IHideable
{
@@ -28,11 +28,11 @@ public class StatusCommandClipboard extends StatusCommand implements IHideable
{
ClipboardManager manager = (ClipboardManager) Client.getApplication().getSystemService(Context.CLIPBOARD_SERVICE);
manager.setText(status.text);
- ToastManager.toast("Rs[܂");
+ Notifier.info("Rs[܂");
}
catch (Exception e)
{
- ToastManager.toast("Rs[s܂");
+ Notifier.alert("Rs[s܂");
}
}
diff --git a/src/net/miz_hi/smileessence/command/status/StatusCommandCongrats.java b/src/net/miz_hi/smileessence/command/status/StatusCommandCongrats.java
index 8941da0d..25bbc4e9 100644
--- a/src/net/miz_hi/smileessence/command/status/StatusCommandCongrats.java
+++ b/src/net/miz_hi/smileessence/command/status/StatusCommandCongrats.java
@@ -11,9 +11,9 @@ import net.miz_hi.smileessence.async.AsyncTweetTask;
import net.miz_hi.smileessence.async.MyExecutor;
import net.miz_hi.smileessence.command.IConfirmable;
import net.miz_hi.smileessence.command.IHideable;
+import net.miz_hi.smileessence.core.Notifier;
import net.miz_hi.smileessence.data.StatusModel;
-import net.miz_hi.smileessence.event.ToastManager;
-import net.miz_hi.smileessence.util.TwitterManager;
+import net.miz_hi.smileessence.twitter.TwitterManager;
public class StatusCommandCongrats extends StatusCommand implements IHideable, IConfirmable
{
@@ -59,7 +59,7 @@ public class StatusCommandCongrats extends StatusCommand implements IHideable, I
String str = "@" + status.user.screenName + " Congrats on your " + favCount + " tweet! http://favstar.fm/t/" + status.statusId;
StatusUpdate update = new StatusUpdate(str);
update.setInReplyToStatusId(status.statusId);
- MyExecutor.submit(new AsyncFavoriteTask(status.statusId));
+ new AsyncFavoriteTask(status.statusId).addToQueue();
final Future<Boolean> f = MyExecutor.submit(new AsyncTweetTask(update));
MyExecutor.execute(new Runnable()
{
@@ -71,11 +71,11 @@ public class StatusCommandCongrats extends StatusCommand implements IHideable, I
{
if(f.get())
{
- ToastManager.toast("j܂");
+ Notifier.info("j܂");
}
else
{
- ToastManager.toast(TwitterManager.MESSAGE_SOMETHING_ERROR);
+ Notifier.info(TwitterManager.MESSAGE_SOMETHING_ERROR);
}
}
catch(Exception e)
diff --git a/src/net/miz_hi/smileessence/command/status/StatusCommandCopy.java b/src/net/miz_hi/smileessence/command/status/StatusCommandCopy.java
index 9a9930c1..bda85017 100644
--- a/src/net/miz_hi/smileessence/command/status/StatusCommandCopy.java
+++ b/src/net/miz_hi/smileessence/command/status/StatusCommandCopy.java
@@ -8,9 +8,9 @@ import net.miz_hi.smileessence.async.AsyncTweetTask;
import net.miz_hi.smileessence.async.MyExecutor;
import net.miz_hi.smileessence.command.IConfirmable;
import net.miz_hi.smileessence.command.IHideable;
+import net.miz_hi.smileessence.core.Notifier;
import net.miz_hi.smileessence.data.StatusModel;
-import net.miz_hi.smileessence.event.ToastManager;
-import net.miz_hi.smileessence.util.TwitterManager;
+import net.miz_hi.smileessence.twitter.TwitterManager;
import twitter4j.StatusUpdate;
public class StatusCommandCopy extends StatusCommand implements IHideable, IConfirmable
@@ -38,32 +38,8 @@ public class StatusCommandCopy extends StatusCommand implements IHideable, IConf
{
StatusUpdate update = new StatusUpdate(status.text);
update.setInReplyToStatusId(status.inReplyToStatusId);
- final Future<Boolean> resp = MyExecutor.submit(new AsyncTweetTask(update));
- MyExecutor.submit(new AsyncFavoriteTask(status.statusId));
- MyExecutor.execute(new Runnable()
- {
-
- @Override
- public void run()
- {
- try
- {
- boolean result = resp.get();
- if (result)
- {
- ToastManager.toast(TwitterManager.MESSAGE_TWEET_SUCCESS);
- }
- else
- {
- ToastManager.toast(TwitterManager.MESSAGE_SOMETHING_ERROR);
- }
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
- });
+ new AsyncTweetTask(update).addToQueue();
+ new AsyncFavoriteTask(status.statusId).addToQueue();
}
}
diff --git a/src/net/miz_hi/smileessence/command/status/StatusCommandDelete.java b/src/net/miz_hi/smileessence/command/status/StatusCommandDelete.java
index 8a30d903..fdabb07d 100644
--- a/src/net/miz_hi/smileessence/command/status/StatusCommandDelete.java
+++ b/src/net/miz_hi/smileessence/command/status/StatusCommandDelete.java
@@ -8,9 +8,9 @@ import twitter4j.TwitterException;
import net.miz_hi.smileessence.Client;
import net.miz_hi.smileessence.async.MyExecutor;
import net.miz_hi.smileessence.command.IConfirmable;
+import net.miz_hi.smileessence.core.Notifier;
import net.miz_hi.smileessence.data.StatusModel;
-import net.miz_hi.smileessence.event.ToastManager;
-import net.miz_hi.smileessence.util.TwitterManager;
+import net.miz_hi.smileessence.twitter.TwitterManager;
public class StatusCommandDelete extends StatusCommand implements IConfirmable
{
@@ -57,11 +57,11 @@ public class StatusCommandDelete extends StatusCommand implements IConfirmable
{
if(f.get())
{
- ToastManager.toast("폜܂");
+ Notifier.info("폜܂");
}
else
{
- ToastManager.toast(TwitterManager.MESSAGE_SOMETHING_ERROR);
+ Notifier.alert(TwitterManager.MESSAGE_SOMETHING_ERROR);
}
}
catch (Exception e)
diff --git a/src/net/miz_hi/smileessence/command/status/StatusCommandFavAndRetweet.java b/src/net/miz_hi/smileessence/command/status/StatusCommandFavAndRetweet.java
index 903e1dd1..b0f8823c 100644
--- a/src/net/miz_hi/smileessence/command/status/StatusCommandFavAndRetweet.java
+++ b/src/net/miz_hi/smileessence/command/status/StatusCommandFavAndRetweet.java
@@ -2,14 +2,15 @@ package net.miz_hi.smileessence.command.status;
import java.util.concurrent.Future;
+
import net.miz_hi.smileessence.async.AsyncFavoriteTask;
import net.miz_hi.smileessence.async.AsyncRetweetTask;
import net.miz_hi.smileessence.async.MyExecutor;
import net.miz_hi.smileessence.command.IConfirmable;
import net.miz_hi.smileessence.command.IHideable;
+import net.miz_hi.smileessence.core.Notifier;
import net.miz_hi.smileessence.data.StatusModel;
-import net.miz_hi.smileessence.event.ToastManager;
-import net.miz_hi.smileessence.util.TwitterManager;
+import net.miz_hi.smileessence.twitter.TwitterManager;
public class StatusCommandFavAndRetweet extends StatusCommand implements IHideable, IConfirmable
{
@@ -40,11 +41,11 @@ public class StatusCommandFavAndRetweet extends StatusCommand implements IHideab
{
if (f1.get() && f2.get())
{
- ToastManager.toast(TwitterManager.MESSAGE_RETWEET_SUCCESS);
+ Notifier.info(TwitterManager.MESSAGE_RETWEET_SUCCESS);
}
else
{
- ToastManager.toast(TwitterManager.MESSAGE_SOMETHING_ERROR);
+ Notifier.alert(TwitterManager.MESSAGE_SOMETHING_ERROR);
}
}
catch (Exception e)
diff --git a/src/net/miz_hi/smileessence/command/status/StatusCommandFavorite.java b/src/net/miz_hi/smileessence/command/status/StatusCommandFavorite.java
new file mode 100644
index 00000000..f79be80d
--- /dev/null
+++ b/src/net/miz_hi/smileessence/command/status/StatusCommandFavorite.java
@@ -0,0 +1,31 @@
+package net.miz_hi.smileessence.command.status;
+
+import java.util.concurrent.Future;
+
+import net.miz_hi.smileessence.async.AsyncFavoriteTask;
+import net.miz_hi.smileessence.async.MyExecutor;
+import net.miz_hi.smileessence.core.Notifier;
+import net.miz_hi.smileessence.data.StatusModel;
+import net.miz_hi.smileessence.twitter.TwitterManager;
+
+public class StatusCommandFavorite extends StatusCommand
+{
+
+ public StatusCommandFavorite(StatusModel status)
+ {
+ super(status);
+ }
+
+ @Override
+ public String getName()
+ {
+ return "ӂڂ";
+ }
+
+ @Override
+ public void workOnUiThread()
+ {
+ new AsyncFavoriteTask(status.statusId).addToQueue();
+ }
+
+}
diff --git a/src/net/miz_hi/smileessence/command/status/StatusCommandNanigaja.java b/src/net/miz_hi/smileessence/command/status/StatusCommandNanigaja.java
index 09d29c51..a2cbcc4f 100644
--- a/src/net/miz_hi/smileessence/command/status/StatusCommandNanigaja.java
+++ b/src/net/miz_hi/smileessence/command/status/StatusCommandNanigaja.java
@@ -43,7 +43,7 @@ public class StatusCommandNanigaja extends StatusCommand implements IHideable, I
str = "@" + status.user.screenName + " " + str;
id = status.statusId;
}
- MyExecutor.submit(new AsyncFavoriteTask(status.statusId));
+ new AsyncFavoriteTask(status.statusId).addToQueue();
StatusUpdate update = new StatusUpdate(str);
update.setInReplyToStatusId(id);
new AsyncTweetTask(update).addToQueue();
diff --git a/src/net/miz_hi/smileessence/command/status/StatusCommandReply.java b/src/net/miz_hi/smileessence/command/status/StatusCommandReply.java
new file mode 100644
index 00000000..2f0826a3
--- /dev/null
+++ b/src/net/miz_hi/smileessence/command/status/StatusCommandReply.java
@@ -0,0 +1,26 @@
+package net.miz_hi.smileessence.command.status;
+
+import net.miz_hi.smileessence.data.StatusModel;
+import net.miz_hi.smileessence.system.PostSystem;
+
+public class StatusCommandReply extends StatusCommand
+{
+
+ public StatusCommandReply(StatusModel status)
+ {
+ super(status);
+ }
+
+ @Override
+ public String getName()
+ {
+ return "ԐM";
+ }
+
+ @Override
+ public void workOnUiThread()
+ {
+ PostSystem.setReply(status.screenName, status.statusId).openPostPage();
+ }
+
+}
diff --git a/src/net/miz_hi/smileessence/command/status/StatusCommandRetweet.java b/src/net/miz_hi/smileessence/command/status/StatusCommandRetweet.java
new file mode 100644
index 00000000..6b5237d1
--- /dev/null
+++ b/src/net/miz_hi/smileessence/command/status/StatusCommandRetweet.java
@@ -0,0 +1,61 @@
+package net.miz_hi.smileessence.command.status;
+
+import java.util.concurrent.Future;
+
+import net.miz_hi.smileessence.async.AsyncRetweetTask;
+import net.miz_hi.smileessence.async.MyExecutor;
+import net.miz_hi.smileessence.command.IConfirmable;
+import net.miz_hi.smileessence.core.Notifier;
+import net.miz_hi.smileessence.data.StatusModel;
+import net.miz_hi.smileessence.twitter.TwitterManager;
+
+public class StatusCommandRetweet extends StatusCommand implements IConfirmable
+{
+
+ public StatusCommandRetweet(StatusModel status)
+ {
+ super(status);
+ }
+
+ @Override
+ public String getName()
+ {
+ return "cC[g";
+ }
+
+ @Override
+ public void workOnUiThread()
+ {
+ final Future<Boolean> resp = MyExecutor.submit(new AsyncRetweetTask(status.statusId));
+ MyExecutor.execute(new Runnable()
+ {
+
+ @Override
+ public void run()
+ {
+ try
+ {
+ if(resp.get())
+ {
+ Notifier.info(TwitterManager.MESSAGE_RETWEET_SUCCESS);
+ }
+ else
+ {
+ Notifier.alert(TwitterManager.MESSAGE_RETWEET_DEPLICATE);
+ }
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+ });
+ }
+
+ @Override
+ public boolean getDefaultVisibility()
+ {
+ return !status.user.isProtected;
+ }
+
+}
diff --git a/src/net/miz_hi/smileessence/command/status/StatusCommandReview.java b/src/net/miz_hi/smileessence/command/status/StatusCommandReview.java
index 4b5f3b19..e7059d73 100644
--- a/src/net/miz_hi/smileessence/command/status/StatusCommandReview.java
+++ b/src/net/miz_hi/smileessence/command/status/StatusCommandReview.java
@@ -2,15 +2,18 @@ package net.miz_hi.smileessence.command.status;
import java.util.concurrent.Future;
+import de.keyboardsurfer.android.widget.crouton.Style;
+
import net.miz_hi.smileessence.Client;
import net.miz_hi.smileessence.async.AsyncFavoriteTask;
import net.miz_hi.smileessence.async.AsyncTweetTask;
import net.miz_hi.smileessence.async.MyExecutor;
import net.miz_hi.smileessence.command.IHideable;
+import net.miz_hi.smileessence.core.Notifier;
import net.miz_hi.smileessence.data.StatusModel;
-import net.miz_hi.smileessence.dialog.ReviewDialogHelper;
-import net.miz_hi.smileessence.event.ToastManager;
-import net.miz_hi.smileessence.util.TwitterManager;
+import net.miz_hi.smileessence.dialog.ReviewDialog;
+import net.miz_hi.smileessence.event.Event;
+import net.miz_hi.smileessence.twitter.TwitterManager;
import twitter4j.StatusUpdate;
import android.app.Activity;
import android.content.DialogInterface;
@@ -36,58 +39,63 @@ public class StatusCommandReview extends StatusCommand implements IHideable
@Override
public void workOnUiThread()
{
- final ReviewDialogHelper helper = new ReviewDialogHelper(activity, "cC[g]悤");
- helper.setSeekBarMax(4);
- helper.setSeekBarStart(0);
- helper.setLevelCorrect(1);
- helper.setOnClickListener(new OnClickListener()
+ final ReviewDialog reviewDialog = new ReviewDialog(activity, "cC[g]悤");
+
+ reviewDialog.setOnClickListener(new OnClickListener()
{
@Override
public void onClick(DialogInterface dialog, int which)
{
- int star = helper.getProgress() + 1;
- StringBuilder builder = new StringBuilder();
- for (int i = 0; i < 5; i++)
+ if(which == dialog.BUTTON_POSITIVE)
{
- if (i < star)
- {
- builder.append("");
- }
- else
+ int star = reviewDialog.getProgress() + 1;
+ StringBuilder builder = new StringBuilder();
+ for (int i = 0; i < 5; i++)
{
- builder.append("");
+ if (i < star)
+ {
+ builder.append("");
+ }
+ else
+ {
+ builder.append("");
+ }
}
- }
- builder.append("\r\n");
- builder.append("Rg: ");
- builder.append(helper.getText());
- builder.append("\r\n");
- builder.append("( http://twitter.com/");
- builder.append(status.screenName);
- builder.append("/status/");
- builder.append(status.statusId);
- builder.append(" )");
+ builder.append("\r\n");
+ builder.append("Rg: ");
+ builder.append(reviewDialog.getText());
+ builder.append("\r\n");
+ builder.append("@");
+ builder.append(status.screenName);
+ builder.append(" ( http://twitter.com/");
+ builder.append(status.screenName);
+ builder.append("/status/");
+ builder.append(status.statusId);
+ builder.append(" )");
- Future<Boolean> f1 = MyExecutor.submit(new AsyncFavoriteTask(status.statusId));
- Future<Boolean> f2 = MyExecutor.submit(new AsyncTweetTask(new StatusUpdate(builder.toString())));
- try
- {
- if (f1.get() && f2.get())
+ StatusUpdate update = new StatusUpdate(builder.toString());
+ update.setInReplyToStatusId(status.statusId);
+ Future<Boolean> f1 = MyExecutor.submit(new AsyncFavoriteTask(status.statusId));
+ Future<Boolean> f2 = MyExecutor.submit(new AsyncTweetTask(update));
+ try
{
- ToastManager.toast(TwitterManager.MESSAGE_TWEET_SUCCESS);
+ if (f1.get() && f2.get())
+ {
+ Notifier.info(TwitterManager.MESSAGE_TWEET_SUCCESS);
+ }
+ else
+ {
+ Notifier.alert(TwitterManager.MESSAGE_SOMETHING_ERROR);
+ }
}
- else
+ catch (Exception e)
{
- ToastManager.toast(TwitterManager.MESSAGE_SOMETHING_ERROR);
+ e.printStackTrace();
}
}
- catch (Exception e)
- {
- e.printStackTrace();
- }
}
});
- helper.createSeekBarDialog().show();
+ reviewDialog.create().show();
}
@Override
diff --git a/src/net/miz_hi/smileessence/command/status/StatusCommandThankToFav.java b/src/net/miz_hi/smileessence/command/status/StatusCommandThankToFav.java
index af3281f0..caf0488a 100644
--- a/src/net/miz_hi/smileessence/command/status/StatusCommandThankToFav.java
+++ b/src/net/miz_hi/smileessence/command/status/StatusCommandThankToFav.java
@@ -9,9 +9,9 @@ import net.miz_hi.smileessence.async.AsyncTweetTask;
import net.miz_hi.smileessence.async.MyExecutor;
import net.miz_hi.smileessence.command.IConfirmable;
import net.miz_hi.smileessence.command.IHideable;
+import net.miz_hi.smileessence.core.Notifier;
import net.miz_hi.smileessence.data.StatusModel;
-import net.miz_hi.smileessence.event.ToastManager;
-import net.miz_hi.smileessence.util.TwitterManager;
+import net.miz_hi.smileessence.twitter.TwitterManager;
public class StatusCommandThankToFav extends StatusCommand implements IHideable, IConfirmable
{
@@ -33,7 +33,7 @@ public class StatusCommandThankToFav extends StatusCommand implements IHideable,
String str = "@" + status.user.screenName + " ӂڂ(o^-')b" ;
StatusUpdate update = new StatusUpdate(str);
update.setInReplyToStatusId(status.statusId);
- MyExecutor.submit(new AsyncFavoriteTask(status.statusId));
+ new AsyncFavoriteTask(status.statusId).addToQueue();
final Future<Boolean> f = MyExecutor.submit(new AsyncTweetTask(update));
MyExecutor.execute(new Runnable()
{
@@ -46,11 +46,11 @@ public class StatusCommandThankToFav extends StatusCommand implements IHideable,
{
if(f.get())
{
- ToastManager.toast("ӂڂ肵܂");
+ Notifier.info("ӂڂ肵܂");
}
else
{
- ToastManager.toast(TwitterManager.MESSAGE_FAVORITE_DEPLICATE);
+ Notifier.alert(TwitterManager.MESSAGE_FAVORITE_DEPLICATE);
}
}
catch (Exception e)
diff --git a/src/net/miz_hi/smileessence/command/status/StatusCommandTofuBuster.java b/src/net/miz_hi/smileessence/command/status/StatusCommandTofuBuster.java
index 4ff246d1..a4694a10 100644
--- a/src/net/miz_hi/smileessence/command/status/StatusCommandTofuBuster.java
+++ b/src/net/miz_hi/smileessence/command/status/StatusCommandTofuBuster.java
@@ -4,8 +4,8 @@ import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.content.Intent;
import net.miz_hi.smileessence.command.IHideable;
+import net.miz_hi.smileessence.core.Notifier;
import net.miz_hi.smileessence.data.StatusModel;
-import net.miz_hi.smileessence.event.ToastManager;
import net.miz_hi.smileessence.util.Morse;
public class StatusCommandTofuBuster extends StatusCommand implements IHideable
@@ -44,7 +44,7 @@ public class StatusCommandTofuBuster extends StatusCommand implements IHideable
}
catch(ActivityNotFoundException e)
{
- ToastManager.toast("TofuBusterCXg[Ă܂");
+ Notifier.alert("TofuBusterCXg[Ă܂");
}
}
}
diff --git a/src/net/miz_hi/smileessence/command/status/StatusCommandUnOffFav.java b/src/net/miz_hi/smileessence/command/status/StatusCommandUnOffFav.java
index 94e68d70..f9e6f621 100644
--- a/src/net/miz_hi/smileessence/command/status/StatusCommandUnOffFav.java
+++ b/src/net/miz_hi/smileessence/command/status/StatusCommandUnOffFav.java
@@ -10,9 +10,9 @@ import net.miz_hi.smileessence.async.AsyncTweetTask;
import net.miz_hi.smileessence.async.MyExecutor;
import net.miz_hi.smileessence.command.IConfirmable;
import net.miz_hi.smileessence.command.IHideable;
+import net.miz_hi.smileessence.core.Notifier;
import net.miz_hi.smileessence.data.StatusModel;
-import net.miz_hi.smileessence.event.ToastManager;
-import net.miz_hi.smileessence.util.TwitterManager;
+import net.miz_hi.smileessence.twitter.TwitterManager;
public class StatusCommandUnOffFav extends StatusCommand implements IHideable, IConfirmable
{
@@ -34,32 +34,8 @@ public class StatusCommandUnOffFav extends StatusCommand implements IHideable, I
String str = "@" + status.user.screenName + " ";
StatusUpdate update = new StatusUpdate(str);
update.setInReplyToStatusId(status.statusId);
- MyExecutor.submit(new AsyncFavoriteTask(status.statusId));
- final Future<Boolean> f = MyExecutor.submit(new AsyncTweetTask(update));
- MyExecutor.execute(new Runnable()
- {
-
- @Override
- public void run()
- {
-
- try
- {
- if(f.get())
- {
- ToastManager.toast(TwitterManager.MESSAGE_FAVORITE_SUCCESS);
- }
- else
- {
- ToastManager.toast(TwitterManager.MESSAGE_FAVORITE_DEPLICATE);
- }
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
- });
+ new AsyncFavoriteTask(status.statusId).addToQueue();
+ new AsyncTweetTask(update).addToQueue();
}
diff --git a/src/net/miz_hi/smileessence/command/status/StatusCommandUnOffRetweet.java b/src/net/miz_hi/smileessence/command/status/StatusCommandUnOffRetweet.java
index d546e5a5..e3d03241 100644
--- a/src/net/miz_hi/smileessence/command/status/StatusCommandUnOffRetweet.java
+++ b/src/net/miz_hi/smileessence/command/status/StatusCommandUnOffRetweet.java
@@ -4,8 +4,7 @@ import net.miz_hi.smileessence.Client;
import net.miz_hi.smileessence.command.IConfirmable;
import net.miz_hi.smileessence.command.IHideable;
import net.miz_hi.smileessence.data.StatusModel;
-import net.miz_hi.smileessence.system.TweetSystem;
-import net.miz_hi.smileessence.view.TweetView;
+import net.miz_hi.smileessence.system.PostSystem;
public class StatusCommandUnOffRetweet extends StatusCommand implements IHideable, IConfirmable
{
@@ -25,9 +24,7 @@ public class StatusCommandUnOffRetweet extends StatusCommand implements IHideabl
public void workOnUiThread()
{
String text = " RT @" + status.screenName + ": " + status.text;
- TweetSystem.setText(text);
- TweetSystem.setCursor(0);
- TweetView.open();
+ PostSystem.clear().setText(text).setCursor(0).openPostPage();
}
@Override
diff --git a/src/net/miz_hi/smileessence/command/status/StatusCommandUnfavorite.java b/src/net/miz_hi/smileessence/command/status/StatusCommandUnfavorite.java
index 6e65af91..a31a196e 100644
--- a/src/net/miz_hi/smileessence/command/status/StatusCommandUnfavorite.java
+++ b/src/net/miz_hi/smileessence/command/status/StatusCommandUnfavorite.java
@@ -3,9 +3,9 @@ package net.miz_hi.smileessence.command.status;
import twitter4j.TwitterException;
import net.miz_hi.smileessence.async.MyExecutor;
import net.miz_hi.smileessence.command.IHideable;
+import net.miz_hi.smileessence.core.Notifier;
import net.miz_hi.smileessence.data.StatusModel;
-import net.miz_hi.smileessence.event.ToastManager;
-import net.miz_hi.smileessence.util.TwitterManager;
+import net.miz_hi.smileessence.twitter.TwitterManager;
public class StatusCommandUnfavorite extends StatusCommand implements IHideable
{
@@ -33,12 +33,12 @@ public class StatusCommandUnfavorite extends StatusCommand implements IHideable
try
{
TwitterManager.getTwitter().destroyFavorite(status.statusId);
- ToastManager.toast("Cɓ폜܂");
+ Notifier.info("Cɓ폜܂");
}
catch (TwitterException e)
{
e.printStackTrace();
- ToastManager.toast("Cɓ̍폜Ɏs܂");
+ Notifier.alert("Cɓ̍폜Ɏs܂");
}
}
});
diff --git a/src/net/miz_hi/smileessence/command/status/StatusCommandWarotaRT.java b/src/net/miz_hi/smileessence/command/status/StatusCommandWarotaRT.java
index fd74badb..9f0a991e 100644
--- a/src/net/miz_hi/smileessence/command/status/StatusCommandWarotaRT.java
+++ b/src/net/miz_hi/smileessence/command/status/StatusCommandWarotaRT.java
@@ -8,9 +8,9 @@ import net.miz_hi.smileessence.async.AsyncTweetTask;
import net.miz_hi.smileessence.async.MyExecutor;
import net.miz_hi.smileessence.command.IConfirmable;
import net.miz_hi.smileessence.command.IHideable;
+import net.miz_hi.smileessence.core.Notifier;
import net.miz_hi.smileessence.data.StatusModel;
-import net.miz_hi.smileessence.event.ToastManager;
-import net.miz_hi.smileessence.util.TwitterManager;
+import net.miz_hi.smileessence.twitter.TwitterManager;
import twitter4j.StatusUpdate;
public class StatusCommandWarotaRT extends StatusCommand implements IHideable, IConfirmable
@@ -37,33 +37,8 @@ public class StatusCommandWarotaRT extends StatusCommand implements IHideable, I
builder.append(status.text);
StatusUpdate update = new StatusUpdate(builder.toString());
update.setInReplyToStatusId(status.statusId);
-
- final Future<Boolean> resp = MyExecutor.submit(new AsyncTweetTask(update));
- MyExecutor.submit(new AsyncFavoriteTask(status.statusId));
- MyExecutor.execute(new Runnable()
- {
-
- @Override
- public void run()
- {
- try
- {
- boolean result = resp.get();
- if (result)
- {
- ToastManager.toast(TwitterManager.MESSAGE_TWEET_SUCCESS);
- }
- else
- {
- ToastManager.toast(TwitterManager.MESSAGE_SOMETHING_ERROR);
- }
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
- });
+ new AsyncTweetTask(update).addToQueue();
+ new AsyncFavoriteTask(status.statusId).addToQueue();
}
@Override
diff --git a/src/net/miz_hi/smileessence/command/user/UserCommandAddReply.java b/src/net/miz_hi/smileessence/command/user/UserCommandAddReply.java
new file mode 100644
index 00000000..ba6fd54a
--- /dev/null
+++ b/src/net/miz_hi/smileessence/command/user/UserCommandAddReply.java
@@ -0,0 +1,27 @@
+package net.miz_hi.smileessence.command.user;
+
+import net.miz_hi.smileessence.core.Notifier;
+import net.miz_hi.smileessence.data.StatusModel;
+import net.miz_hi.smileessence.system.PostSystem;
+
+public class UserCommandAddReply extends UserCommand
+{
+
+ public UserCommandAddReply(String userName)
+ {
+ super(userName);
+ }
+
+ @Override
+ public String getName()
+ {
+ return "vCɒlj";
+ }
+
+ @Override
+ public void workOnUiThread()
+ {
+ PostSystem.addReply(userName);
+ Notifier.info(userName + "vCɒlj܂");
+ }
+}
diff --git a/src/net/miz_hi/smileessence/command/user/UserCommandBlock.java b/src/net/miz_hi/smileessence/command/user/UserCommandBlock.java
index eb29900f..678f1efc 100644
--- a/src/net/miz_hi/smileessence/command/user/UserCommandBlock.java
+++ b/src/net/miz_hi/smileessence/command/user/UserCommandBlock.java
@@ -3,8 +3,8 @@ package net.miz_hi.smileessence.command.user;
import net.miz_hi.smileessence.Client;
import net.miz_hi.smileessence.async.MyExecutor;
import net.miz_hi.smileessence.command.IConfirmable;
-import net.miz_hi.smileessence.event.ToastManager;
-import net.miz_hi.smileessence.util.TwitterManager;
+import net.miz_hi.smileessence.core.Notifier;
+import net.miz_hi.smileessence.twitter.TwitterManager;
public class UserCommandBlock extends UserCommand implements IConfirmable
{
@@ -30,7 +30,7 @@ public class UserCommandBlock extends UserCommand implements IConfirmable
{
if (TwitterManager.block(Client.getMainAccount(), userName))
{
- ToastManager.toast(userName + "ubN܂");
+ Notifier.info(userName + "ubN܂");
}
}
});
diff --git a/src/net/miz_hi/smileessence/command/user/UserCommandFollow.java b/src/net/miz_hi/smileessence/command/user/UserCommandFollow.java
index 5b42d887..5986f33b 100644
--- a/src/net/miz_hi/smileessence/command/user/UserCommandFollow.java
+++ b/src/net/miz_hi/smileessence/command/user/UserCommandFollow.java
@@ -3,8 +3,8 @@ package net.miz_hi.smileessence.command.user;
import net.miz_hi.smileessence.Client;
import net.miz_hi.smileessence.async.MyExecutor;
import net.miz_hi.smileessence.command.IConfirmable;
-import net.miz_hi.smileessence.event.ToastManager;
-import net.miz_hi.smileessence.util.TwitterManager;
+import net.miz_hi.smileessence.core.Notifier;
+import net.miz_hi.smileessence.twitter.TwitterManager;
public class UserCommandFollow extends UserCommand implements IConfirmable
{
@@ -31,7 +31,7 @@ public class UserCommandFollow extends UserCommand implements IConfirmable
{
if (TwitterManager.follow(Client.getMainAccount(), userName))
{
- ToastManager.toast("tH[܂");
+ Notifier.info("tH[܂");
}
}
});
diff --git a/src/net/miz_hi/smileessence/command/user/UserCommandOpenInfo.java b/src/net/miz_hi/smileessence/command/user/UserCommandOpenInfo.java
new file mode 100644
index 00000000..a7cae00e
--- /dev/null
+++ b/src/net/miz_hi/smileessence/command/user/UserCommandOpenInfo.java
@@ -0,0 +1,46 @@
+package net.miz_hi.smileessence.command.user;
+
+import net.miz_hi.smileessence.Client;
+import net.miz_hi.smileessence.async.MyExecutor;
+import net.miz_hi.smileessence.data.UserModel;
+import net.miz_hi.smileessence.data.UserStore;
+import net.miz_hi.smileessence.twitter.TwitterManager;
+import net.miz_hi.smileessence.util.UiHandler;
+import net.miz_hi.smileessence.view.MainActivity;
+import net.miz_hi.smileessence.view.UserInfoFragment;
+import twitter4j.User;
+import android.app.Activity;
+
+public class UserCommandOpenInfo extends UserCommand
+{
+
+ public UserCommandOpenInfo(String userName)
+ {
+ super(userName);
+ }
+
+ @Override
+ public String getName()
+ {
+ return "[U[";
+ }
+
+ @Override
+ public void workOnUiThread()
+ {
+ MyExecutor.execute(new Runnable()
+ {
+
+ @Override
+ public void run()
+ {
+ User user = TwitterManager.getUser(Client.getMainAccount(), userName);
+ UserModel model = UserStore.put(user);
+ UserInfoFragment fragment = UserInfoFragment.newInstance(model);
+ MainActivity.addPage(fragment);
+ MainActivity.moveViewPage(MainActivity.getPagerCount());
+ }
+ });
+
+ }
+}
diff --git a/src/net/miz_hi/smileessence/command/user/UserCommandOpenProfiel.java b/src/net/miz_hi/smileessence/command/user/UserCommandOpenProfiel.java
deleted file mode 100644
index 5e28354a..00000000
--- a/src/net/miz_hi/smileessence/command/user/UserCommandOpenProfiel.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package net.miz_hi.smileessence.command.user;
-
-import net.miz_hi.smileessence.view.UserActivity;
-import android.app.Activity;
-import android.content.Intent;
-
-public class UserCommandOpenProfiel extends UserCommand
-{
-
- private Activity activity;
-
- public UserCommandOpenProfiel(Activity activity, String userName)
- {
- super(userName);
- this.activity = activity;
- }
-
- @Override
- public String getName()
- {
- return "[U[";
- }
-
- @Override
- public void workOnUiThread()
- {
- Intent intent = new Intent(activity, UserActivity.class);
- intent.putExtra("screen_name", userName);
- activity.startActivity(intent);
- }
-}
diff --git a/src/net/miz_hi/smileessence/command/user/UserCommandOpenTimeline.java b/src/net/miz_hi/smileessence/command/user/UserCommandOpenTimeline.java
new file mode 100644
index 00000000..d5381523
--- /dev/null
+++ b/src/net/miz_hi/smileessence/command/user/UserCommandOpenTimeline.java
@@ -0,0 +1,54 @@
+package net.miz_hi.smileessence.command.user;
+
+import twitter4j.User;
+import net.miz_hi.smileessence.Client;
+import net.miz_hi.smileessence.async.MyExecutor;
+import net.miz_hi.smileessence.data.UserModel;
+import net.miz_hi.smileessence.data.UserStore;
+import net.miz_hi.smileessence.twitter.TwitterManager;
+import net.miz_hi.smileessence.util.UiHandler;
+import net.miz_hi.smileessence.view.MainActivity;
+import net.miz_hi.smileessence.view.UserTimelineFragment;
+
+public class UserCommandOpenTimeline extends UserCommand
+{
+
+ public UserCommandOpenTimeline(String userName)
+ {
+ super(userName);
+ }
+
+ @Override
+ public String getName()
+ {
+ return "^CCJ";
+ }
+
+ @Override
+ public void workOnUiThread()
+ {
+ MyExecutor.execute(new Runnable()
+ {
+
+ @Override
+ public void run()
+ {
+ User user = TwitterManager.getUser(Client.getMainAccount(), userName);
+ final UserModel model = UserStore.put(user);
+ new UiHandler()
+ {
+
+ @Override
+ public void run()
+ {
+ UserTimelineFragment fragment = UserTimelineFragment.newInstance(model);
+ MainActivity.addPage(fragment);
+ MainActivity.moveViewPage(MainActivity.getPagerCount());
+ }
+ }.post();
+
+ }
+ });
+ }
+
+}
diff --git a/src/net/miz_hi/smileessence/command/user/UserCommandRemove.java b/src/net/miz_hi/smileessence/command/user/UserCommandRemove.java
index 07060458..6cc1f914 100644
--- a/src/net/miz_hi/smileessence/command/user/UserCommandRemove.java
+++ b/src/net/miz_hi/smileessence/command/user/UserCommandRemove.java
@@ -3,8 +3,8 @@ package net.miz_hi.smileessence.command.user;
import net.miz_hi.smileessence.Client;
import net.miz_hi.smileessence.async.MyExecutor;
import net.miz_hi.smileessence.command.IConfirmable;
-import net.miz_hi.smileessence.event.ToastManager;
-import net.miz_hi.smileessence.util.TwitterManager;
+import net.miz_hi.smileessence.core.Notifier;
+import net.miz_hi.smileessence.twitter.TwitterManager;
public class UserCommandRemove extends UserCommand implements IConfirmable
{
@@ -31,7 +31,7 @@ public class UserCommandRemove extends UserCommand implements IConfirmable
{
if (TwitterManager.remove(Client.getMainAccount(), userName))
{
- ToastManager.toast("[܂");
+ Notifier.info("[܂");
}
}
});
diff --git a/src/net/miz_hi/smileessence/command/user/UserCommandReply.java b/src/net/miz_hi/smileessence/command/user/UserCommandReply.java
index dd9d6531..2ec47e2d 100644
--- a/src/net/miz_hi/smileessence/command/user/UserCommandReply.java
+++ b/src/net/miz_hi/smileessence/command/user/UserCommandReply.java
@@ -1,7 +1,6 @@
package net.miz_hi.smileessence.command.user;
-import net.miz_hi.smileessence.system.TweetSystem;
-import net.miz_hi.smileessence.view.TweetView;
+import net.miz_hi.smileessence.system.PostSystem;
public class UserCommandReply extends UserCommand
{
@@ -20,8 +19,8 @@ public class UserCommandReply extends UserCommand
@Override
public void workOnUiThread()
{
- TweetSystem.setReply(userName, -1);
- TweetView.open();
+ PostSystem.setReply(userName, -1);
+ PostSystem.openPostPage();
}
}
diff --git a/src/net/miz_hi/smileessence/command/user/UserCommandSpam.java b/src/net/miz_hi/smileessence/command/user/UserCommandSpam.java
index 36ac5b2b..7c4ded7c 100644
--- a/src/net/miz_hi/smileessence/command/user/UserCommandSpam.java
+++ b/src/net/miz_hi/smileessence/command/user/UserCommandSpam.java
@@ -3,8 +3,8 @@ package net.miz_hi.smileessence.command.user;
import net.miz_hi.smileessence.Client;
import net.miz_hi.smileessence.async.MyExecutor;
import net.miz_hi.smileessence.command.IConfirmable;
-import net.miz_hi.smileessence.event.ToastManager;
-import net.miz_hi.smileessence.util.TwitterManager;
+import net.miz_hi.smileessence.core.Notifier;
+import net.miz_hi.smileessence.twitter.TwitterManager;
public class UserCommandSpam extends UserCommand implements IConfirmable
{
@@ -30,7 +30,7 @@ public class UserCommandSpam extends UserCommand implements IConfirmable
{
if (TwitterManager.spam(Client.getMainAccount(), userName))
{
- ToastManager.toast("Xp񍐂܂");
+ Notifier.info("Xp񍐂܂");
}
}
});
diff --git a/src/net/miz_hi/smileessence/core/DataBaseHelper.java b/src/net/miz_hi/smileessence/core/DataBaseHelper.java
index a3e7592d..749dfc00 100644
--- a/src/net/miz_hi/smileessence/core/DataBaseHelper.java
+++ b/src/net/miz_hi/smileessence/core/DataBaseHelper.java
@@ -3,10 +3,12 @@ package net.miz_hi.smileessence.core;
import net.miz_hi.smileessence.Client;
import net.miz_hi.smileessence.auth.Account;
import net.miz_hi.smileessence.data.extra.ExtraWord;
+import net.miz_hi.smileessence.data.page.Page;
import net.miz_hi.smileessence.data.template.Template;
import net.miz_hi.smileessence.util.LogHelper;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
+
import com.j256.ormlite.android.apptools.OrmLiteSqliteOpenHelper;
import com.j256.ormlite.support.ConnectionSource;
import com.j256.ormlite.table.TableUtils;
@@ -27,16 +29,18 @@ public class DataBaseHelper extends OrmLiteSqliteOpenHelper
try
{
TableUtils.createTableIfNotExists(arg1, Account.class);
- LogHelper.printD("account table created");
+ LogHelper.d("account table created");
TableUtils.createTableIfNotExists(arg1, Template.class);
- LogHelper.printD("template table created");
+ LogHelper.d("template table created");
TableUtils.createTableIfNotExists(arg1, ExtraWord.class);
- LogHelper.printD("extra table created");
+ LogHelper.d("extra table created");
+ TableUtils.createTableIfNotExists(arg1, Page.class);
+ LogHelper.d("page table created");
}
catch (Exception e)
{
e.printStackTrace();
- LogHelper.printD("error ontable created");
+ LogHelper.d("error ontable created");
}
}
@@ -46,16 +50,18 @@ public class DataBaseHelper extends OrmLiteSqliteOpenHelper
try
{
TableUtils.createTableIfNotExists(arg1, Account.class);
- LogHelper.printD("account table created");
+ LogHelper.d("account table created");
TableUtils.createTableIfNotExists(arg1, Template.class);
- LogHelper.printD("template table created");
+ LogHelper.d("template table created");
TableUtils.createTableIfNotExists(arg1, ExtraWord.class);
- LogHelper.printD("extra table created");
+ LogHelper.d("extra table created");
+ TableUtils.createTableIfNotExists(arg1, Page.class);
+ LogHelper.d("page table created");
}
catch (Exception e)
{
e.printStackTrace();
- LogHelper.printD("error ontable created");
+ LogHelper.d("error ontable created");
}
}
}
diff --git a/src/net/miz_hi/smileessence/core/Notifier.java b/src/net/miz_hi/smileessence/core/Notifier.java
new file mode 100644
index 00000000..ceb0919b
--- /dev/null
+++ b/src/net/miz_hi/smileessence/core/Notifier.java
@@ -0,0 +1,121 @@
+package net.miz_hi.smileessence.core;
+
+import de.keyboardsurfer.android.widget.crouton.Crouton;
+import de.keyboardsurfer.android.widget.crouton.Style;
+import net.miz_hi.smileessence.event.Event;
+import net.miz_hi.smileessence.event.EventModel;
+import net.miz_hi.smileessence.event.EventViewFactory;
+import net.miz_hi.smileessence.event.IAttackEvent;
+import net.miz_hi.smileessence.event.StatusEventModel;
+import net.miz_hi.smileessence.util.CountUpInteger;
+import net.miz_hi.smileessence.util.UiHandler;
+import net.miz_hi.smileessence.view.MainActivity;
+import twitter4j.User;
+import android.app.Activity;
+import android.view.Gravity;
+import android.view.View;
+import android.widget.Toast;
+
+public class Notifier
+{
+
+ private static User enemyUser;
+ private static long lastUserId = -1;
+ private static long lastStatusId = -1;
+ private static CountUpInteger counterSourceUser = new CountUpInteger(5);
+ private static CountUpInteger counterTargetStatus = new CountUpInteger(5);
+
+ public static void toast(final String text)
+ {
+ final Activity activity = MainActivity.getInstance();
+ if(activity == null || activity.isFinishing())
+ {
+ return;
+ }
+ new UiHandler()
+ {
+
+ @Override
+ public void run()
+ {
+ Toast.makeText(activity, text, Toast.LENGTH_SHORT).show();
+ }
+ }.post();
+ }
+
+ public static void info(String text)
+ {
+ crouton(new Event(text));
+ }
+
+ public static void alert(String text)
+ {
+ crouton(new Event(text).setStyle(Style.ALERT));
+ }
+
+ public static void crouton(final Event event)
+ {
+ final Activity activity = MainActivity.getInstance();
+ if(activity == null || activity.isFinishing())
+ {
+ return;
+ }
+
+ new UiHandler()
+ {
+
+ @Override
+ public void run()
+ {
+ Crouton.showText(activity, event.getText(), event.getStyle());
+ }
+ }.post();
+ }
+
+ public static Event buildEvent(final EventModel model)
+ {
+ if(model instanceof StatusEventModel)
+ {
+ StatusEventModel se = (StatusEventModel)model;
+ if(se instanceof IAttackEvent)
+ {
+ if(lastUserId != se.source.getId())
+ {
+ counterSourceUser.reset();
+ lastUserId = se.source.getId();
+ }
+ else
+ {
+ if (counterSourceUser.isOver())
+ {
+ return Event.getNullEvent();
+ }
+
+ if(counterSourceUser.countUp())
+ {
+ return new Event(se.source.getScreenName() + "U󂯂Ă܂");
+ }
+ }
+
+ if(lastStatusId != se.targetModel.statusId)
+ {
+ counterTargetStatus.reset();
+ lastStatusId = se.targetModel.statusId;
+ }
+ else
+ {
+ if(counterTargetStatus.isOver())
+ {
+ return Event.getNullEvent();
+ }
+ if(counterTargetStatus.countUp())
+ {
+ return new Event("Ȃ̃cC[gU󂯂Ă܂");
+ }
+ }
+ }
+ }
+
+ return new Event(model.getText());
+ }
+}
diff --git a/src/net/miz_hi/smileessence/data/UserModel.java b/src/net/miz_hi/smileessence/data/UserModel.java
index 0ede185a..467e6ea5 100644
--- a/src/net/miz_hi/smileessence/data/UserModel.java
+++ b/src/net/miz_hi/smileessence/data/UserModel.java
@@ -6,7 +6,7 @@ import java.util.concurrent.Future;
import net.miz_hi.smileessence.Client;
import net.miz_hi.smileessence.async.MyExecutor;
-import net.miz_hi.smileessence.util.TwitterManager;
+import net.miz_hi.smileessence.twitter.TwitterManager;
import twitter4j.User;
public class UserModel
@@ -25,6 +25,8 @@ public class UserModel
public int favoriteCount;
public Date createdAt;
public boolean isProtected;
+ private Boolean isFriend = null;
+ private Boolean isFollower = null;
private UserModel(){}
@@ -47,7 +49,7 @@ public class UserModel
followerCount = user.getFollowersCount();
favoriteCount = user.getFavouritesCount();
createdAt = user.getCreatedAt();
- isProtected = user.isProtected();
+ isProtected = user.isProtected();
IconCaches.checkIconCache(UserModel.this);
return this;
}
@@ -81,46 +83,55 @@ public class UserModel
public boolean isFriend()
{
- Future<Boolean> resp = MyExecutor.submit(new Callable<Boolean>()
+ if(isFriend == null)
{
+ Future<Boolean> resp = MyExecutor.submit(new Callable<Boolean>()
+ {
- @Override
- public Boolean call() throws Exception
- {
- return TwitterManager.isFollowing(Client.getMainAccount(), userId);
- }
- });
- try
- {
- return resp.get();
- }
- catch (Exception e)
- {
- e.printStackTrace();
- return false;
- }
+ @Override
+ public Boolean call() throws Exception
+ {
+ return TwitterManager.isFollowing(Client.getMainAccount(), userId);
+ }
+ });
+ try
+ {
+ isFriend = resp.get();
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ return false;
+ }
+ }
+
+ return isFriend.booleanValue();
}
public boolean isFollower()
{
- Future<Boolean> resp = MyExecutor.submit(new Callable<Boolean>()
+ if(isFollower == null)
{
+ Future<Boolean> resp = MyExecutor.submit(new Callable<Boolean>()
+ {
- @Override
- public Boolean call() throws Exception
+ @Override
+ public Boolean call() throws Exception
+ {
+ return TwitterManager.isFollowed(Client.getMainAccount(), userId);
+ }
+ });
+ try
{
- return TwitterManager.isFollowed(Client.getMainAccount(), userId);
+ isFollower = resp.get();
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ return false;
}
- });
- try
- {
- return resp.get();
- }
- catch (Exception e)
- {
- e.printStackTrace();
- return false;
}
+ return isFollower.booleanValue();
}
public static UserModel getNullUserModel()
diff --git a/src/net/miz_hi/smileessence/data/extra/ExtraWordListAdapter.java b/src/net/miz_hi/smileessence/data/extra/ExtraWordListAdapter.java
index 043f620b..a254bf76 100644
--- a/src/net/miz_hi/smileessence/data/extra/ExtraWordListAdapter.java
+++ b/src/net/miz_hi/smileessence/data/extra/ExtraWordListAdapter.java
@@ -22,16 +22,13 @@ public class ExtraWordListAdapter extends CustomListAdapter<ExtraWord>
{
if(convertedView == null)
{
- convertedView = getInflater().inflate(R.layout.menuitem_layout, null);
+ convertedView = getInflater().inflate(R.layout.menuitem_white, null);
}
- convertedView.setBackgroundColor(Client.getColor(R.color.LightGray));
-
ExtraWord ExtraWord = (ExtraWord)getItem(position);
TextView viewText = (TextView)convertedView.findViewById(R.id.textView_menuItem);
viewText.setText(ExtraWord.getText());
- viewText.setTextColor(Client.getColor(R.color.Black));
ExtraWordOnClickListener listener = new ExtraWordOnClickListener(this, getActivity(), ExtraWord);
diff --git a/src/net/miz_hi/smileessence/data/extra/ExtraWords.java b/src/net/miz_hi/smileessence/data/extra/ExtraWords.java
index 21972f7d..86ffa86c 100644
--- a/src/net/miz_hi/smileessence/data/extra/ExtraWords.java
+++ b/src/net/miz_hi/smileessence/data/extra/ExtraWords.java
@@ -7,7 +7,7 @@ import java.util.List;
public class ExtraWords
{
- private static List<ExtraWord> ExtraWords = new ArrayList<ExtraWord>();
+ private static List<ExtraWord> extraWords = new ArrayList<ExtraWord>();
static
{
@@ -16,12 +16,12 @@ public class ExtraWords
private static void read()
{
- ExtraWords.clear();
+ extraWords.clear();
if(ExtraWordDB.instance().findAll() != null)
{
for(ExtraWord ExtraWord : ExtraWordDB.instance().findAll())
{
- ExtraWords.add(ExtraWord);
+ extraWords.add(ExtraWord);
}
}
}
@@ -29,7 +29,7 @@ public class ExtraWords
public static void update()
{
ExtraWordDB.instance().deleteAll();
- for(ExtraWord ExtraWord : ExtraWords)
+ for(ExtraWord ExtraWord : extraWords)
{
ExtraWordDB.instance().save(ExtraWord);
}
@@ -38,37 +38,37 @@ public class ExtraWords
public static void addExtraWord(String ExtraWord)
{
- ExtraWords.add(new ExtraWord(ExtraWord));
+ extraWords.add(new ExtraWord(ExtraWord));
update();
}
public static void addExtraWord(ExtraWord ExtraWord)
{
- ExtraWords.add(ExtraWord);
+ extraWords.add(ExtraWord);
update();
}
public static void setExtraWord(String ExtraWord, int index)
{
- ExtraWords.set(index, new ExtraWord(ExtraWord));
+ extraWords.set(index, new ExtraWord(ExtraWord));
update();
}
public static void setExtraWord(ExtraWord ExtraWord, int index)
{
- ExtraWords.set(index, ExtraWord);
+ extraWords.set(index, ExtraWord);
update();
}
public static void deleteExtraWord(ExtraWord ExtraWord)
{
- ExtraWords.remove(ExtraWord);
+ extraWords.remove(ExtraWord);
update();
}
public static List<ExtraWord> getExtraWords()
{
- return Collections.unmodifiableList(ExtraWords);
+ return Collections.unmodifiableList(extraWords);
}
}
diff --git a/src/net/miz_hi/smileessence/data/page/Page.java b/src/net/miz_hi/smileessence/data/page/Page.java
new file mode 100644
index 00000000..51655136
--- /dev/null
+++ b/src/net/miz_hi/smileessence/data/page/Page.java
@@ -0,0 +1,59 @@
+package net.miz_hi.smileessence.data.page;
+
+import java.util.Map;
+
+import com.j256.ormlite.field.DatabaseField;
+import com.j256.ormlite.table.DatabaseTable;
+
+@DatabaseTable(tableName="pages")
+public class Page
+{
+ @DatabaseField(generatedId = true)
+ private Integer id;
+ @DatabaseField
+ private String className;
+ @DatabaseField
+ private String data;
+
+ public Page()
+ {
+ }
+
+ public Page(String className, String data)
+ {
+ this.className = className;
+ this.data = data;
+ }
+
+ public Integer getId()
+ {
+ return id;
+ }
+
+ public void setId(Integer id)
+ {
+ this.id = id;
+ }
+
+ public String getClassName()
+ {
+ return className;
+ }
+
+ public void setClassName(String className)
+ {
+ this.className = className;
+ }
+
+ public String getData()
+ {
+ return data;
+ }
+
+ public void setData(String data)
+ {
+ this.data = data;
+ }
+
+
+}
diff --git a/src/net/miz_hi/smileessence/data/page/PageDB.java b/src/net/miz_hi/smileessence/data/page/PageDB.java
new file mode 100644
index 00000000..761823fe
--- /dev/null
+++ b/src/net/miz_hi/smileessence/data/page/PageDB.java
@@ -0,0 +1,102 @@
+package net.miz_hi.smileessence.data.page;
+
+import java.util.List;
+
+import net.miz_hi.smileessence.Client;
+import net.miz_hi.smileessence.core.DataBaseHelper;
+import android.content.Context;
+import android.util.Log;
+
+import com.j256.ormlite.dao.Dao;
+
+public class PageDB
+{
+ private Context context;
+ private static PageDB instance = new PageDB(Client.getApplication());
+
+ private PageDB(Context context)
+ {
+ this.context = context;
+ }
+
+ public static PageDB instance()
+ {
+ return instance;
+ }
+
+ public void save(Page Page)
+ {
+ DataBaseHelper helper = new DataBaseHelper(context);
+ try
+ {
+ Dao<Page, Integer> dao = helper.getDao(Page.class);
+ dao.createOrUpdate(Page);
+ }
+ catch (Exception e)
+ {
+ Log.e(PageDB.class.getSimpleName(), "error on save");
+ }
+ finally
+ {
+ helper.close();
+ }
+ }
+
+ public void delete(Page Page)
+ {
+ DataBaseHelper helper = new DataBaseHelper(context);
+ try
+ {
+ Dao<Page, Integer> dao = helper.getDao(Page.class);
+ dao.delete(Page);
+ }
+ catch (Exception e)
+ {
+ Log.e(PageDB.class.getSimpleName(), "error on delete");
+ }
+ finally
+ {
+ helper.close();
+ }
+ }
+
+ public void deleteAll()
+ {
+ DataBaseHelper helper = new DataBaseHelper(context);
+ try
+ {
+ for (Page Page : findAll())
+ {
+ Dao<Page, Integer> dao = helper.getDao(Page.class);
+ dao.delete(Page);
+ }
+ }
+ catch (Exception e)
+ {
+ Log.e(PageDB.class.getSimpleName(), "error on delete");
+ }
+ finally
+ {
+ helper.close();
+ }
+ }
+
+ public List<Page> findAll()
+ {
+ DataBaseHelper helper = new DataBaseHelper(context);
+ try
+ {
+ Dao<Page, Integer> dao = helper.getDao(Page.class);
+ return dao.queryForAll();
+ }
+ catch (Exception e)
+ {
+ Log.e(PageDB.class.getSimpleName(), "error on findAll");
+ return null;
+ }
+ finally
+ {
+ helper.close();
+ }
+ }
+}
diff --git a/src/net/miz_hi/smileessence/data/page/Pages.java b/src/net/miz_hi/smileessence/data/page/Pages.java
new file mode 100644
index 00000000..28a009e6
--- /dev/null
+++ b/src/net/miz_hi/smileessence/data/page/Pages.java
@@ -0,0 +1,84 @@
+package net.miz_hi.smileessence.data.page;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+
+import net.miz_hi.smileessence.view.IRemainable;
+
+import android.support.v4.app.Fragment;
+
+public class Pages
+{
+
+ private static List<Page> Pages = new ArrayList<Page>();
+
+ static
+ {
+ read();
+ }
+
+ private static void read()
+ {
+ Pages.clear();
+ if(PageDB.instance().findAll() != null)
+ {
+ for(Page Page : PageDB.instance().findAll())
+ {
+ Pages.add(Page);
+ }
+ }
+ }
+
+ public static void update()
+ {
+ PageDB.instance().deleteAll();
+ for(Page Page : Pages)
+ {
+ PageDB.instance().save(Page);
+ }
+ read();
+ }
+
+ public static void clear()
+ {
+ PageDB.instance().deleteAll();
+ read();
+ }
+
+ public static void addPage(Fragment fragment)
+ {
+ Pages.add(new Page(fragment.getClass().getSimpleName(), ((IRemainable)fragment).save()));
+ update();
+ }
+
+ public static void addPage(Page Page)
+ {
+ Pages.add(Page);
+ update();
+ }
+
+ public static void setPage(Fragment fragment, int index)
+ {
+ Pages.set(index, new Page(fragment.getClass().getSimpleName(), ((IRemainable)fragment).save()));
+ update();
+ }
+
+ public static void setPage(Page Page, int index)
+ {
+ Pages.set(index, Page);
+ update();
+ }
+
+ public static void deletePage(Page Page)
+ {
+ Pages.remove(Page);
+ update();
+ }
+
+ public static List<Page> getPages()
+ {
+ return Collections.unmodifiableList(Pages);
+ }
+}
diff --git a/src/net/miz_hi/smileessence/data/template/TemplateListAdapter.java b/src/net/miz_hi/smileessence/data/template/TemplateListAdapter.java
index aef66dd5..0c2562e1 100644
--- a/src/net/miz_hi/smileessence/data/template/TemplateListAdapter.java
+++ b/src/net/miz_hi/smileessence/data/template/TemplateListAdapter.java
@@ -22,16 +22,13 @@ public class TemplateListAdapter extends CustomListAdapter<Template>
{
if(convertedView == null)
{
- convertedView = getInflater().inflate(R.layout.menuitem_layout, null);
+ convertedView = getInflater().inflate(R.layout.menuitem_white, null);
}
- convertedView.setBackgroundColor(Client.getColor(R.color.LightGray));
-
Template template = (Template)getItem(position);
TextView viewText = (TextView)convertedView.findViewById(R.id.textView_menuItem);
viewText.setText(template.getText());
- viewText.setTextColor(Client.getColor(R.color.Black));
TemplateOnClickListener listener = new TemplateOnClickListener(this, getActivity(), template);
diff --git a/src/net/miz_hi/smileessence/dialog/AuthDialogHelper.java b/src/net/miz_hi/smileessence/dialog/AuthDialogHelper.java
deleted file mode 100644
index 22d82141..00000000
--- a/src/net/miz_hi/smileessence/dialog/AuthDialogHelper.java
+++ /dev/null
@@ -1,62 +0,0 @@
-package net.miz_hi.smileessence.dialog;
-
-import net.miz_hi.smileessence.Client;
-import net.miz_hi.smileessence.R;
-import net.miz_hi.smileessence.auth.Consumers;
-import net.miz_hi.smileessence.auth.Consumers.Consumer;
-import android.app.Activity;
-import android.app.Dialog;
-import android.view.Gravity;
-import android.view.View;
-import android.view.View.OnClickListener;
-import android.widget.Button;
-import android.widget.TextView;
-
-public class AuthDialogHelper
-{
- private Activity activity;
- private Consumer consumer;
- private Runnable onClick;
-
- public AuthDialogHelper(Activity activity)
- {
- this.activity = activity;
- this.consumer = Consumers.getDedault();
- }
-
- public void setConsumer(Consumer consumer)
- {
- this.consumer = consumer;
- }
-
- public Dialog getAuthDialog()
- {
-
- TextView titleView = new TextView(activity);
- titleView.setText("F؂Ă");
- titleView.setTextColor(Client.getColor(R.color.White));
- titleView.setPadding(10, 20, 0, 20);
- Button authButton = new Button(activity);
- authButton.setText("F؃y[W");
- authButton.setGravity(Gravity.CENTER);
- authButton.setOnClickListener(new OnClickListener()
- {
-
- @Override
- public void onClick(View v)
- {
- if (onClick != null)
- {
- onClick.run();
- }
- }
- });
- return SimpleDialogHelper.createDialog(activity, titleView, authButton);
- }
-
- public void setOnComplete(Runnable runnable)
- {
- onClick = runnable;
- }
-
-}
diff --git a/src/net/miz_hi/smileessence/dialog/CheckBoxListDialog.java b/src/net/miz_hi/smileessence/dialog/CheckBoxListDialog.java
new file mode 100644
index 00000000..a73485c8
--- /dev/null
+++ b/src/net/miz_hi/smileessence/dialog/CheckBoxListDialog.java
@@ -0,0 +1,104 @@
+package net.miz_hi.smileessence.dialog;
+
+import net.miz_hi.smileessence.Client;
+import net.miz_hi.smileessence.R;
+import net.miz_hi.smileessence.util.CustomListAdapter;
+import android.app.Activity;
+import android.app.AlertDialog;
+import android.app.Dialog;
+import android.content.DialogInterface.OnClickListener;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.CheckBox;
+import android.widget.CompoundButton;
+import android.widget.LinearLayout.LayoutParams;
+import android.widget.ListAdapter;
+import android.widget.ListView;
+import android.widget.CompoundButton.OnCheckedChangeListener;
+import android.widget.LinearLayout;
+import android.widget.ScrollView;
+import android.widget.TextView;
+
+public class CheckBoxListDialog
+{
+
+ private Activity activity;
+ private String title;
+ private OnClickListener onClicked;
+ private CheckBoxItem[] items;
+
+ public CheckBoxListDialog(Activity activity)
+ {
+ this.activity = activity;
+ }
+
+ public void setTitle(String str)
+ {
+ this.title = str;
+ }
+
+ public void setOnClicked(OnClickListener listener)
+ {
+ this.onClicked = listener;
+ }
+
+ public CheckBoxItem[] getItems()
+ {
+ return items;
+ }
+
+ public void setItems(CheckBoxItem... items)
+ {
+ this.items = items;
+ }
+
+ public Dialog createDialog()
+ {
+ LayoutInflater inflater = activity.getLayoutInflater();
+ ScrollView scroll = new ScrollView(activity);
+ LinearLayout linearLayout = new LinearLayout(activity);
+ linearLayout.setOrientation(LinearLayout.VERTICAL);
+ LayoutParams p = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
+ p.setMargins(0, 10, 0, 10);
+
+ for (final CheckBoxItem item : items)
+ {
+ CheckBox checkbox = new CheckBox(activity);
+ checkbox.setLayoutParams(p);
+ checkbox.setText(item.name);
+ checkbox.setChecked(item.value);
+ checkbox.setOnCheckedChangeListener(new OnCheckedChangeListener()
+ {
+
+ @Override
+ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked)
+ {
+ item.value = isChecked;
+ }
+ });
+ linearLayout.addView(checkbox);
+ }
+ scroll.addView(linearLayout);
+
+ ContentDialog dialog = new ContentDialog(activity, title);
+ dialog.setContentView(scroll);
+ dialog.setOnClickListener(onClicked);
+ return dialog.create();
+
+ }
+
+ public static class CheckBoxItem
+ {
+
+ public String name;
+ public boolean value;
+
+ public CheckBoxItem(String name, boolean startValue)
+ {
+ this.name = name;
+ this.value = startValue;
+ }
+ }
+
+}
diff --git a/src/net/miz_hi/smileessence/dialog/CheckBoxListDialogHelper.java b/src/net/miz_hi/smileessence/dialog/CheckBoxListDialogHelper.java
deleted file mode 100644
index 6dc04434..00000000
--- a/src/net/miz_hi/smileessence/dialog/CheckBoxListDialogHelper.java
+++ /dev/null
@@ -1,116 +0,0 @@
-package net.miz_hi.smileessence.dialog;
-
-import net.miz_hi.smileessence.Client;
-import net.miz_hi.smileessence.R;
-import android.app.Activity;
-import android.app.AlertDialog;
-import android.app.Dialog;
-import android.content.DialogInterface.OnClickListener;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.widget.CheckBox;
-import android.widget.CompoundButton;
-import android.widget.CompoundButton.OnCheckedChangeListener;
-import android.widget.LinearLayout;
-import android.widget.TextView;
-
-public class CheckBoxListDialogHelper
-{
-
- private Activity activity;
- private String title;
- private OnClickListener onClicked;
- private CheckBoxItem[] items;
-
- public CheckBoxListDialogHelper(Activity activity)
- {
- this.activity = activity;
- }
-
- public void setTitle(String str)
- {
- this.title = str;
- }
-
- public void setOnClicked(OnClickListener listener)
- {
- this.onClicked = listener;
- }
-
- public CheckBoxItem[] getItems()
- {
- return items;
- }
-
- public void setItems(CheckBoxItem... items)
- {
- this.items = items;
- }
-
- public Dialog createDialog()
- {
- LayoutInflater inflater = activity.getLayoutInflater();
- View view = inflater.inflate(R.layout.dialog_base_layout, null);
- LinearLayout titleLinearLayout = (LinearLayout) view.findViewById(R.id.linearLayout_dialogTitle);
- LinearLayout itemsLinearLayout = (LinearLayout) view.findViewById(R.id.linearLayout_dialogItems);
-
- TextView viewTitle = new TextView(activity);
- viewTitle.setTextSize(15);
- viewTitle.setTextColor(Client.getResource().getColor(R.color.White));
- viewTitle.setText(title);
- viewTitle.setPadding(10, 15, 0, 15);
- titleLinearLayout.addView(viewTitle);
-
- for (final CheckBoxItem item : items)
- {
-
- View viewItem = inflater.inflate(R.layout.checkboxitem_layout, null);
- CheckBox viewCheckBox = (CheckBox) viewItem.findViewById(R.id.checkBox_checkboxItem);
- viewCheckBox.setText(item.name);
- viewCheckBox.setChecked(item.value);
- viewCheckBox.setOnCheckedChangeListener(new OnCheckedChangeListener()
- {
-
- @Override
- public void onCheckedChanged(CompoundButton buttonView, boolean isChecked)
- {
- item.value = isChecked;
- }
- });
-
- itemsLinearLayout.addView(viewItem);
- }
-
- itemsLinearLayout.setClickable(true);
-
- final AlertDialog.Builder builder = new AlertDialog.Builder(activity);
- builder.setPositiveButton("OK", onClicked);
- builder.setNegativeButton("LZ", onClicked);
- builder.setView(view);
- Dialog dialog = builder.create();
-// dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
-
-
-// LayoutParams lp = dialog.getWindow().getAttributes();
-// DisplayMetrics metrics = activity.getResources().getDisplayMetrics();
-// lp.width = (int) (metrics.widthPixels * 0.95);
-// lp.gravity = Gravity.CENTER;
-
- return dialog;
-
- }
-
- public static class CheckBoxItem
- {
-
- public String name;
- public boolean value;
-
- public CheckBoxItem(String name, boolean startValue)
- {
- this.name = name;
- this.value = startValue;
- }
- }
-
-}
diff --git a/src/net/miz_hi/smileessence/dialog/YesNoDialogHelper.java b/src/net/miz_hi/smileessence/dialog/ConfirmDialog.java
index cc17bd5e..ad970080 100644
--- a/src/net/miz_hi/smileessence/dialog/YesNoDialogHelper.java
+++ b/src/net/miz_hi/smileessence/dialog/ConfirmDialog.java
@@ -1,16 +1,12 @@
package net.miz_hi.smileessence.dialog;
-import net.miz_hi.smileessence.Client;
-import net.miz_hi.smileessence.R;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.widget.TextView;
+import android.widget.FrameLayout;
-public class YesNoDialogHelper
+public class ConfirmDialog
{
private Activity activity;
@@ -18,11 +14,8 @@ public class YesNoDialogHelper
private String textPositive = "͂";
private String textNegative = "";
private OnClickListener listener;
- private LayoutInflater layoutInflater;
- private View dialogView;
- private View contentView;
- public YesNoDialogHelper(Activity activity, String title)
+ public ConfirmDialog(Activity activity, String title)
{
this.activity = activity;
this.textTitle = title;
@@ -47,37 +40,27 @@ public class YesNoDialogHelper
{
this.listener = listener;
}
-
- public void setContentView(View view)
- {
- this.contentView = view;
- }
-
+
public AlertDialog createYesNoAlert()
{
AlertDialog.Builder ad = new AlertDialog.Builder(activity);
ad.setTitle(textTitle);
- ad.setView(contentView);
ad.setCancelable(false);
ad.setPositiveButton(textPositive, listener);
ad.setNegativeButton(textNegative, listener);
return ad.create();
}
- public static void show(Activity activity, String title, String text, final Runnable onYes)
+ public static void show(Activity activity, String text, final Runnable onYes)
{
- show(activity, title, text, onYes, null);
+ show(activity, text, onYes, null);
}
- public static void show(Activity activity, String title, String text, final Runnable onYes, final Runnable onNo)
+ public static void show(Activity activity, String text, final Runnable onYes, final Runnable onNo)
{
- YesNoDialogHelper helper = new YesNoDialogHelper(activity, title);
- TextView viewText = new TextView(activity);
- viewText.setText(text);
- viewText.setTextColor(Client.getColor(R.color.White));
- viewText.setPadding(10, 20, 0, 20);
- helper.setContentView(viewText);
- helper.setOnClickListener(new OnClickListener()
+ ConfirmDialog helper = new ConfirmDialog(activity, text);
+ FrameLayout frame = new FrameLayout(activity);
+ OnClickListener listener = new OnClickListener()
{
@Override
@@ -101,7 +84,8 @@ public class YesNoDialogHelper
}
}
}
- });
+ };
+ helper.setOnClickListener(listener);
helper.createYesNoAlert().show();
}
diff --git a/src/net/miz_hi/smileessence/dialog/ContentDialog.java b/src/net/miz_hi/smileessence/dialog/ContentDialog.java
new file mode 100644
index 00000000..efc672c3
--- /dev/null
+++ b/src/net/miz_hi/smileessence/dialog/ContentDialog.java
@@ -0,0 +1,58 @@
+package net.miz_hi.smileessence.dialog;
+
+import android.app.Activity;
+import android.app.AlertDialog;
+import android.content.DialogInterface.OnClickListener;
+import android.view.View;
+
+public class ContentDialog
+{
+
+ private Activity activity;
+ private String title;
+ private View content;
+ private String positive = "";
+ private String negative = "LZ";
+ private OnClickListener listener;
+
+ public ContentDialog(Activity activity, String title)
+ {
+ this.activity = activity;
+ this.title = title;
+ }
+
+ public void setTitle(String title)
+ {
+ this.title = title;
+ }
+
+ public void setTextPositive(String textPositive)
+ {
+ this.positive = textPositive;
+ }
+
+ public void setTextNegative(String textNegative)
+ {
+ this.negative = textNegative;
+ }
+
+ public void setContentView(View content)
+ {
+ this.content = content;
+ }
+
+ public void setOnClickListener(OnClickListener listener)
+ {
+ this.listener = listener;
+ }
+
+ public AlertDialog create()
+ {
+ AlertDialog.Builder ad = new AlertDialog.Builder(activity);
+ ad.setTitle(title);
+ ad.setView(content);
+ ad.setPositiveButton(positive, listener);
+ ad.setNegativeButton(negative, listener);
+ return ad.create();
+ }
+}
diff --git a/src/net/miz_hi/smileessence/dialog/DialogAdapter.java b/src/net/miz_hi/smileessence/dialog/DialogAdapter.java
deleted file mode 100644
index fc5dc40b..00000000
--- a/src/net/miz_hi/smileessence/dialog/DialogAdapter.java
+++ /dev/null
@@ -1,206 +0,0 @@
-package net.miz_hi.smileessence.dialog;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import net.miz_hi.smileessence.Client;
-import net.miz_hi.smileessence.R;
-import net.miz_hi.smileessence.command.CommandMenuClose;
-import net.miz_hi.smileessence.command.ICommand;
-import net.miz_hi.smileessence.command.IConfirmable;
-import net.miz_hi.smileessence.command.IHideable;
-import net.miz_hi.smileessence.preference.EnumPreferenceKey.EnumValueType;
-import net.miz_hi.smileessence.preference.EnumPreferenceKey;
-import net.miz_hi.smileessence.preference.PreferenceHelper;
-import android.app.Activity;
-import android.app.Dialog;
-import android.graphics.Color;
-import android.util.DisplayMetrics;
-import android.view.Gravity;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.View.OnClickListener;
-import android.view.ViewGroup;
-import android.view.Window;
-import android.view.WindowManager.LayoutParams;
-import android.widget.LinearLayout;
-import android.widget.TextView;
-
-public abstract class DialogAdapter
-{
-
- protected Activity activity;
- protected List<ICommand> list;
- protected static LayoutInflater layoutInflater;
- protected static Dialog dialog;
- protected View[] titleViews;
-
- public DialogAdapter(Activity activity)
- {
- this.activity = activity;
- DialogAdapter.layoutInflater = LayoutInflater.from(activity);
- this.list = new ArrayList<ICommand>();
- }
-
- public DialogAdapter setMenuItems(List<? extends ICommand> list)
- {
- this.list.clear();
- this.list.addAll(list);
- return this;
- }
-
- public List<ICommand> getList()
- {
- return list;
- }
-
- public static Dialog getDialog()
- {
- return dialog;
- }
-
- public boolean isShowing()
- {
- if (dialog == null)
- {
- return false;
- }
- else
- {
- return dialog.isShowing();
- }
- }
-
- public void setTitle(View... views)
- {
- titleViews = views;
- }
-
- public View[] getTitleViews()
- {
- return titleViews;
- }
-
- public void setTitle(String string)
- {
- TextView title = new TextView(activity);
- title.setTextSize(15);
- title.setTextColor(Client.getResource().getColor(R.color.White));
- title.setText(string);
- title.setPadding(10, 15, 0, 15);
- setTitle(title);
- }
-
- public abstract Dialog createMenuDialog(boolean init);
-
- protected Dialog createMenuDialog()
- {
- dispose();
-
- dialog = new Dialog(activity);
- dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
-
- View view = layoutInflater.inflate(R.layout.dialog_base_layout, null);
- LinearLayout titleLinearLayout = (LinearLayout) view.findViewById(R.id.linearLayout_dialogTitle);
- LinearLayout itemsLinearLayout = (LinearLayout) view.findViewById(R.id.linearLayout_dialogItems);
-
- titleLinearLayout.removeAllViews();
- itemsLinearLayout.removeAllViews();
-
- for (View v : titleViews)
- {
- if(v.getParent() != null)
- {
- ((ViewGroup)v.getParent()).removeView(v);
- }
- titleLinearLayout.addView(v);
- }
-
- for (ICommand item : list)
- {
- boolean isEnabled = true;
-
- if(item instanceof IHideable)
- {
- PreferenceHelper pref = Client.getPreferenceHelper();
- isEnabled = pref.getPreferenceValue(item.getClass().getSimpleName(), EnumValueType.BOOLEAN, false);
- }
-
- if(item.getDefaultVisibility() && isEnabled)
- {
- itemsLinearLayout.addView(new MenuItemView(activity, item).getView());
- }
- }
- itemsLinearLayout.addView(new MenuItemView(activity, new CommandMenuClose()).getView());
- itemsLinearLayout.setClickable(true);
- dialog.setContentView(view);
- LayoutParams lp = dialog.getWindow().getAttributes();
- DisplayMetrics metrics = activity.getResources().getDisplayMetrics();
- lp.width = (int) (metrics.widthPixels * 0.95);
- lp.gravity = Gravity.BOTTOM;
- return dialog;
- }
-
- public static void dispose()
- {
- if (dialog != null)
- {
- dialog.dismiss();
- }
- }
-
- public static class MenuItemView
- {
- private Activity activity;
- private ICommand item;
- private LayoutInflater layoutInflater;
-
- public MenuItemView(Activity activity, ICommand item)
- {
- this.activity = activity;
- this.item = item;
- layoutInflater = LayoutInflater.from(activity);
- }
-
- public View getView()
- {
- View view = layoutInflater.inflate(R.layout.menuitem_layout, null);
- TextView textView = (TextView) view.findViewById(R.id.textView_menuItem);
- textView.setText(item.getName());
- view.setOnClickListener(new OnClickListener()
- {
- @Override
- public void onClick(View view)
- {
- view.setBackgroundColor(Color.rgb(30, 30, 120));
- if(item instanceof IConfirmable && Client.<Boolean>getPreferenceValue(EnumPreferenceKey.CONFIRM_DIALOG))
- {
- YesNoDialogHelper.show(activity, item.getName(), "s܂H", new Runnable()
- {
- @Override
- public void run()
- {
- item.run();
- }
- },
- new Runnable()
- {
-
- @Override
- public void run()
- {
- dispose();
- }
- });
- }
- else
- {
- item.run();
- }
- }
- });
- return view;
- }
-
- }
-}
diff --git a/src/net/miz_hi/smileessence/dialog/ExpandMenuDialog.java b/src/net/miz_hi/smileessence/dialog/ExpandMenuDialog.java
new file mode 100644
index 00000000..78b79c33
--- /dev/null
+++ b/src/net/miz_hi/smileessence/dialog/ExpandMenuDialog.java
@@ -0,0 +1,119 @@
+package net.miz_hi.smileessence.dialog;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import net.miz_hi.smileessence.Client;
+import net.miz_hi.smileessence.command.ICommand;
+import net.miz_hi.smileessence.command.IHideable;
+import net.miz_hi.smileessence.menu.ExpandMenuListAdapter;
+import net.miz_hi.smileessence.preference.EnumPreferenceKey.EnumValueType;
+import net.miz_hi.smileessence.preference.PreferenceHelper;
+import android.app.Activity;
+import android.app.AlertDialog;
+import android.app.Dialog;
+import android.util.DisplayMetrics;
+import android.view.Gravity;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.WindowManager.LayoutParams;
+import android.widget.ExpandableListView;
+import android.widget.ExpandableListView.OnGroupClickListener;
+
+public abstract class ExpandMenuDialog extends MenuDialog
+{
+
+ protected View titleView;
+ protected String title;
+
+ public ExpandMenuDialog(Activity activity)
+ {
+ super(activity);
+ }
+
+ public void setTitle(View view)
+ {
+ titleView = view;
+ }
+
+ public View getTitleView()
+ {
+ return titleView;
+ }
+
+ public void setTitle(String title)
+ {
+ this.title = title;
+ }
+
+ public abstract List<List<ICommand>> getLists();
+
+ public abstract List<String> getGroups();
+
+ public Dialog create()
+ {
+ dispose();
+
+ AlertDialog.Builder builder = new AlertDialog.Builder(activity);
+
+ if(titleView == null)
+ {
+ builder.setTitle(title);
+ }
+ else
+ {
+ builder.setCustomTitle(titleView);
+ }
+
+ List<List<ICommand>> list1 = getLists();
+ List<List<ICommand>> list2 = new ArrayList<List<ICommand>>();
+
+ for(int i = 0; i < list1.size(); i++)
+ {
+ List<ICommand> list = list1.get(i);
+ List<ICommand> newList = new ArrayList<ICommand>();
+ for(ICommand command : list)
+ {
+ boolean isEnabled = true;
+
+ if(command instanceof IHideable)
+ {
+ PreferenceHelper pref = Client.getPreferenceHelper();
+ isEnabled = pref.getPreferenceValue(command.getClass().getSimpleName(), EnumValueType.BOOLEAN, false);
+ }
+
+ if(command.getDefaultVisibility() && isEnabled)
+ {
+ newList.add(command);
+ }
+ }
+ list2.add(i, newList);
+ }
+
+ ExpandableListView listview = new ExpandableListView(activity);
+ listview.setOnGroupClickListener(new OnGroupClickListener()
+ {
+
+ @Override
+ public boolean onGroupClick(ExpandableListView parent, View v, int groupPosition, long id)
+ {
+ parent.smoothScrollToPosition(groupPosition);
+ return false;
+ }
+ });
+
+ ExpandMenuListAdapter adapter = new ExpandMenuListAdapter(activity, getGroups(), list2);
+ listview.setAdapter(adapter);
+ builder.setView(listview);
+ dialog = builder.create();
+ LayoutParams lp = dialog.getWindow().getAttributes();
+ DisplayMetrics metrics = activity.getResources().getDisplayMetrics();
+ lp.width = (int) (metrics.widthPixels * 0.9);
+ lp.gravity = Gravity.CENTER;
+ lp.height = (int) (metrics.heightPixels * 0.8);
+
+ return dialog;
+ }
+}
diff --git a/src/net/miz_hi/smileessence/dialog/MenuDialog.java b/src/net/miz_hi/smileessence/dialog/MenuDialog.java
new file mode 100644
index 00000000..1a679b52
--- /dev/null
+++ b/src/net/miz_hi/smileessence/dialog/MenuDialog.java
@@ -0,0 +1,45 @@
+package net.miz_hi.smileessence.dialog;
+
+import android.app.Activity;
+import android.app.Dialog;
+import android.view.LayoutInflater;
+
+public abstract class MenuDialog
+{
+ protected Activity activity;
+ protected static LayoutInflater inflater;
+ protected static Dialog dialog;
+
+ public MenuDialog(Activity activity)
+ {
+ this.activity = activity;
+ inflater = LayoutInflater.from(activity);
+ }
+
+ public static Dialog getDialog()
+ {
+ return dialog;
+ }
+
+ public boolean isShowing()
+ {
+ if (dialog == null)
+ {
+ return false;
+ }
+ else
+ {
+ return dialog.isShowing();
+ }
+ }
+
+ public abstract Dialog create();
+
+ public static void dispose()
+ {
+ if (dialog != null)
+ {
+ dialog.dismiss();
+ }
+ }
+}
diff --git a/src/net/miz_hi/smileessence/dialog/OneButtonDialog.java b/src/net/miz_hi/smileessence/dialog/OneButtonDialog.java
new file mode 100644
index 00000000..37189fdc
--- /dev/null
+++ b/src/net/miz_hi/smileessence/dialog/OneButtonDialog.java
@@ -0,0 +1,78 @@
+package net.miz_hi.smileessence.dialog;
+
+import net.miz_hi.smileessence.Client;
+import net.miz_hi.smileessence.R;
+import net.miz_hi.smileessence.auth.Consumers;
+import net.miz_hi.smileessence.auth.Consumers.Consumer;
+import net.miz_hi.smileessence.view.MainActivity;
+import android.app.Activity;
+import android.app.Dialog;
+import android.util.AttributeSet;
+import android.view.Gravity;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.view.ViewGroup.LayoutParams;
+import android.widget.Button;
+import android.widget.TextView;
+
+public class OneButtonDialog
+{
+ private Activity activity;
+ private String title;
+ private String text;
+ private Runnable onClick;
+
+ public OneButtonDialog(Activity activity)
+ {
+ this.activity = activity;
+ }
+
+ public void setTitle(String title)
+ {
+ this.title = title;
+ }
+
+ public void setText(String text)
+ {
+ this.text = text;
+ }
+
+ public Dialog create()
+ {
+ final Dialog dialog = new Dialog(activity);
+ dialog.setTitle(title);
+ Button button = (Button) activity.getLayoutInflater().inflate(R.layout.simplebutton, null);
+ button.setText(text);
+ button.setGravity(Gravity.CENTER);
+ button.setOnClickListener(new OnClickListener()
+ {
+
+ @Override
+ public void onClick(View v)
+ {
+ if (onClick != null)
+ {
+ onClick.run();
+ dialog.dismiss();
+ }
+ }
+ });
+ dialog.addContentView(button, new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
+ return dialog;
+ }
+
+ public void setOnClick(Runnable runnable)
+ {
+ onClick = runnable;
+ }
+
+ public static void show(Activity activity, String title, String text, Runnable onClick)
+ {
+ OneButtonDialog dialog = new OneButtonDialog(activity);
+ dialog.setTitle(title);
+ dialog.setText(text);
+ dialog.setOnClick(onClick);
+ dialog.create().show();
+ }
+
+}
diff --git a/src/net/miz_hi/smileessence/dialog/ProgressDialogHelper.java b/src/net/miz_hi/smileessence/dialog/ProgressDialogHelper.java
deleted file mode 100644
index 9d62b305..00000000
--- a/src/net/miz_hi/smileessence/dialog/ProgressDialogHelper.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package net.miz_hi.smileessence.dialog;
-
-import android.app.Activity;
-import android.app.ProgressDialog;
-
-public class ProgressDialogHelper
-{
-
- public static ProgressDialog makeProgressDialog(final Activity activity, ProgressDialog pd)
- {
- pd.setIndeterminate(false);
- pd.setProgressStyle(ProgressDialog.STYLE_SPINNER);
- pd.setMax(100);
- pd.setMessage("Please Wait...");
- pd.incrementProgressBy(0);
- pd.incrementSecondaryProgressBy(0);
- pd.setCancelable(false);
- return pd;
- }
-
-}
diff --git a/src/net/miz_hi/smileessence/dialog/ReviewDialog.java b/src/net/miz_hi/smileessence/dialog/ReviewDialog.java
new file mode 100644
index 00000000..edce2e83
--- /dev/null
+++ b/src/net/miz_hi/smileessence/dialog/ReviewDialog.java
@@ -0,0 +1,62 @@
+package net.miz_hi.smileessence.dialog;
+
+import java.util.zip.Inflater;
+
+import net.miz_hi.smileessence.R;
+import android.app.Activity;
+import android.app.AlertDialog;
+import android.content.DialogInterface.OnClickListener;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.widget.EditText;
+import android.widget.RatingBar;
+import android.widget.SeekBar;
+import android.widget.SeekBar.OnSeekBarChangeListener;
+import android.widget.TextView;
+
+public class ReviewDialog
+{
+
+ private Activity activity;
+ private String title;
+ private OnClickListener listener;
+ private LayoutInflater layoutInflater;
+ private RatingBar ratingBar;
+ private EditText editText;
+
+
+ public ReviewDialog(Activity activity, String title)
+ {
+ this.activity = activity;
+ this.title = title;
+ layoutInflater = LayoutInflater.from(activity);
+ }
+
+ public void setOnClickListener(OnClickListener listener)
+ {
+ this.listener = listener;
+ }
+
+ public int getProgress()
+ {
+ return (int) this.ratingBar.getRating();
+ }
+
+ public String getText()
+ {
+ return this.editText.getText().toString();
+ }
+
+ public AlertDialog create()
+ {
+ View v = layoutInflater.inflate(R.layout.dialog_review, null);
+ ratingBar = (RatingBar) v.findViewById(R.id.review_rating);
+ editText = (EditText) v.findViewById(R.id.review_comment);
+
+ ContentDialog dialog = new ContentDialog(activity, title);
+ dialog.setContentView(v);
+ dialog.setOnClickListener(listener);
+ return dialog.create();
+ }
+
+}
diff --git a/src/net/miz_hi/smileessence/dialog/ReviewDialogHelper.java b/src/net/miz_hi/smileessence/dialog/ReviewDialogHelper.java
deleted file mode 100644
index a1b949ec..00000000
--- a/src/net/miz_hi/smileessence/dialog/ReviewDialogHelper.java
+++ /dev/null
@@ -1,103 +0,0 @@
-package net.miz_hi.smileessence.dialog;
-
-import net.miz_hi.smileessence.R;
-import android.app.Activity;
-import android.app.AlertDialog;
-import android.content.DialogInterface.OnClickListener;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.widget.EditText;
-import android.widget.SeekBar;
-import android.widget.SeekBar.OnSeekBarChangeListener;
-import android.widget.TextView;
-
-public class ReviewDialogHelper
-{
-
- private Activity activity;
- private String title;
- private OnClickListener listener;
- private int seekBarMax;
- private int seekBarStart = 1;
- private LayoutInflater layoutInflater;
- private View dialogView;
- private TextView levelView;
- private SeekBar seekbar;
- private EditText editView;
- private int levelCorrect = 0;
-
- public ReviewDialogHelper(Activity activity, String title)
- {
- this.activity = activity;
- this.title = title;
- layoutInflater = LayoutInflater.from(activity);
- dialogView = layoutInflater.inflate(R.layout.dialog_review_layout, null);
- levelView = (TextView) dialogView.findViewById(R.id.textView_seekLevel);
- seekbar = (SeekBar) dialogView.findViewById(R.id.seekBar_seekDialog);
- editView = (EditText) dialogView.findViewById(R.id.editText_comment);
- }
-
- public void setOnClickListener(OnClickListener listener)
- {
- this.listener = listener;
- }
-
- public void setSeekBarMax(int i)
- {
- this.seekBarMax = i;
- }
-
- public void setSeekBarStart(int i)
- {
- this.seekBarStart = i;
- }
-
- public void setLevelCorrect(int addition)
- {
- this.levelCorrect = addition;
- }
-
- public int getProgress()
- {
- return this.seekbar.getProgress();
- }
-
- public String getText()
- {
- return this.editView.getText().toString();
- }
-
- public AlertDialog createSeekBarDialog()
- {
- seekbar.setMax(seekBarMax);
- seekbar.setProgress(seekBarStart);
- levelView.setText(Integer.toString(seekBarStart + levelCorrect));
- seekbar.setOnSeekBarChangeListener(new OnSeekBarChangeListener()
- {
- @Override
- public void onStopTrackingTouch(SeekBar seekbar)
- {
- }
-
- @Override
- public void onStartTrackingTouch(SeekBar seekbar)
- {
- }
-
- @Override
- public void onProgressChanged(SeekBar seekbar, int i, boolean flag)
- {
- levelView.setText(String.valueOf(i + levelCorrect));
- }
- });
-
- final AlertDialog.Builder builder = new AlertDialog.Builder(activity);
- builder.setTitle(title);
- builder.setView(dialogView);
- builder.setNegativeButton("LZ", null);
- builder.setPositiveButton("OK", listener);
-
- return builder.create();
- }
-
-}
diff --git a/src/net/miz_hi/smileessence/dialog/SeekBarDialogHelper.java b/src/net/miz_hi/smileessence/dialog/SeekBarDialog.java
index 64969ec4..c644f868 100644
--- a/src/net/miz_hi/smileessence/dialog/SeekBarDialogHelper.java
+++ b/src/net/miz_hi/smileessence/dialog/SeekBarDialog.java
@@ -11,7 +11,7 @@ import android.widget.SeekBar;
import android.widget.SeekBar.OnSeekBarChangeListener;
import android.widget.TextView;
-public class SeekBarDialogHelper
+public class SeekBarDialog
{
private Activity activity;
@@ -25,7 +25,7 @@ public class SeekBarDialogHelper
private SeekBar seekbar;
private int levelCorrect = 0;
- public SeekBarDialogHelper(Activity activity, String title)
+ public SeekBarDialog(Activity activity, String title)
{
this.activity = activity;
this.title = title;
@@ -68,12 +68,11 @@ public class SeekBarDialogHelper
public AlertDialog createSeekBarDialog()
{
+ ContentDialog dialog = new ContentDialog(activity, title);
textView.setText(text);
- textView.setTextColor(Client.getResource().getColor(R.color.White));
seekbar.setMax(seekBarMax);
seekbar.setProgress(seekBarStart);
levelView.setText(Integer.toString(seekBarStart + levelCorrect));
- levelView.setTextColor(Client.getResource().getColor(R.color.White));
seekbar.setOnSeekBarChangeListener(new OnSeekBarChangeListener()
{
@Override
@@ -93,13 +92,9 @@ public class SeekBarDialogHelper
}
});
- final AlertDialog.Builder builder = new AlertDialog.Builder(activity);
- builder.setTitle(title);
- builder.setView(dialogView);
- builder.setNegativeButton("LZ", null);
- builder.setPositiveButton("OK", listener);
-
- return builder.create();
+ dialog.setContentView(dialogView);
+ dialog.setOnClickListener(listener);
+ return dialog.create();
}
}
diff --git a/src/net/miz_hi/smileessence/dialog/SimpleDialogHelper.java b/src/net/miz_hi/smileessence/dialog/SimpleDialogHelper.java
deleted file mode 100644
index 0f3eeb40..00000000
--- a/src/net/miz_hi/smileessence/dialog/SimpleDialogHelper.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package net.miz_hi.smileessence.dialog;
-
-import net.miz_hi.smileessence.R;
-import android.app.Activity;
-import android.app.Dialog;
-import android.util.DisplayMetrics;
-import android.view.Gravity;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.Window;
-import android.view.WindowManager.LayoutParams;
-import android.widget.LinearLayout;
-
-public class SimpleDialogHelper
-{
-
- public static Dialog createDialog(Activity activity, View titleView, View... contentView)
- {
- Dialog dialog = new Dialog(activity);
- dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
- View view = LayoutInflater.from(activity).inflate(R.layout.dialog_base_layout, null);
- LinearLayout titleLinearLayout = (LinearLayout) view.findViewById(R.id.linearLayout_dialogTitle);
- LinearLayout itemsLinearLayout = (LinearLayout) view.findViewById(R.id.linearLayout_dialogItems);
- titleLinearLayout.addView(titleView);
- for(View v : contentView)
- {
- itemsLinearLayout.addView(v);
- }
- dialog.setContentView(view);
- LayoutParams lp = dialog.getWindow().getAttributes();
- DisplayMetrics metrics = activity.getResources().getDisplayMetrics();
- lp.width = (int) (metrics.widthPixels * 0.9);
- lp.gravity = Gravity.CENTER;
- return dialog;
- }
-
-}
diff --git a/src/net/miz_hi/smileessence/dialog/SimpleMenuDialog.java b/src/net/miz_hi/smileessence/dialog/SimpleMenuDialog.java
new file mode 100644
index 00000000..7f8e7191
--- /dev/null
+++ b/src/net/miz_hi/smileessence/dialog/SimpleMenuDialog.java
@@ -0,0 +1,99 @@
+package net.miz_hi.smileessence.dialog;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import net.miz_hi.smileessence.Client;
+import net.miz_hi.smileessence.command.ICommand;
+import net.miz_hi.smileessence.command.IHideable;
+import net.miz_hi.smileessence.menu.MenuListAdapter;
+import net.miz_hi.smileessence.preference.EnumPreferenceKey.EnumValueType;
+import net.miz_hi.smileessence.preference.PreferenceHelper;
+import android.app.Activity;
+import android.app.AlertDialog;
+import android.app.Dialog;
+import android.util.DisplayMetrics;
+import android.view.Gravity;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.WindowManager.LayoutParams;
+import android.widget.ListView;
+
+public abstract class SimpleMenuDialog extends MenuDialog
+{
+
+ protected View titleView;
+ protected String title;
+
+ public SimpleMenuDialog(Activity activity)
+ {
+ super(activity);
+ }
+
+ public void setTitle(View view)
+ {
+ titleView = view;
+ }
+
+ public View getTitleView()
+ {
+ return titleView;
+ }
+
+ public void setTitle(String title)
+ {
+ this.title = title;
+ }
+
+ public abstract List<ICommand> getMenuList();
+
+ public Dialog create()
+ {
+ dispose();
+
+ AlertDialog.Builder builder = new AlertDialog.Builder(activity);
+
+ if(titleView == null)
+ {
+ builder.setTitle(title);
+ }
+ else
+ {
+ builder.setCustomTitle(titleView);
+ }
+
+ List<ICommand> list1 = getMenuList();
+ List<ICommand> list2 = new ArrayList<ICommand>();
+
+ for(ICommand command : list1)
+ {
+ boolean isEnabled = true;
+
+ if(command instanceof IHideable)
+ {
+ PreferenceHelper pref = Client.getPreferenceHelper();
+ isEnabled = pref.getPreferenceValue(command.getClass().getSimpleName(), EnumValueType.BOOLEAN, false);
+ }
+
+ if(command.getDefaultVisibility() && isEnabled)
+ {
+ list2.add(command);
+ }
+ }
+
+ ListView listview = new ListView(activity);
+ MenuListAdapter adapter = new MenuListAdapter(activity);
+ adapter.addAll(list2);
+ adapter.forceNotifyAdapter();
+ listview.setAdapter(adapter);
+ builder.setView(listview);
+ dialog = builder.create();
+ LayoutParams lp = dialog.getWindow().getAttributes();
+ DisplayMetrics metrics = activity.getResources().getDisplayMetrics();
+ lp.width = (int) (metrics.widthPixels * 0.9);
+ lp.gravity = Gravity.CENTER;
+ lp.height = (int) (metrics.heightPixels * 0.8);
+
+ return dialog;
+ }
+}
diff --git a/src/net/miz_hi/smileessence/event/Event.java b/src/net/miz_hi/smileessence/event/Event.java
new file mode 100644
index 00000000..b22e86d1
--- /dev/null
+++ b/src/net/miz_hi/smileessence/event/Event.java
@@ -0,0 +1,58 @@
+package net.miz_hi.smileessence.event;
+
+import net.miz_hi.smileessence.core.Notifier;
+import de.keyboardsurfer.android.widget.crouton.Style;
+
+public class Event
+{
+
+ String text;
+ Style style;
+
+ public Event(String text)
+ {
+ this.text = text;
+ this.style = Style.INFO;
+ }
+
+ public Event setStyle(Style style)
+ {
+ this.style = style;
+ return this;
+ }
+
+ public String getText()
+ {
+ return text;
+ }
+
+ public Style getStyle()
+ {
+ return style;
+ }
+
+ public void raise()
+ {
+ Notifier.crouton(this);
+ }
+
+ public static Event getNullEvent()
+ {
+ return new NullEvent();
+ }
+
+ public static class NullEvent extends Event
+ {
+
+ private NullEvent()
+ {
+ super("");
+ }
+
+ @Override
+ public void raise()
+ {
+ //Null Operation
+ }
+ }
+}
diff --git a/src/net/miz_hi/smileessence/event/EventCommandDialog.java b/src/net/miz_hi/smileessence/event/EventCommandDialog.java
deleted file mode 100644
index b3b4d545..00000000
--- a/src/net/miz_hi/smileessence/event/EventCommandDialog.java
+++ /dev/null
@@ -1,49 +0,0 @@
-package net.miz_hi.smileessence.event;
-
-import net.miz_hi.smileessence.command.user.UserCommandFollow;
-import net.miz_hi.smileessence.command.user.UserCommandOpenFavstar;
-import net.miz_hi.smileessence.command.user.UserCommandOpenPage;
-import net.miz_hi.smileessence.command.user.UserCommandOpenProfiel;
-import net.miz_hi.smileessence.command.user.UserCommandRemove;
-import net.miz_hi.smileessence.command.user.UserCommandReply;
-import net.miz_hi.smileessence.data.UserModel;
-import net.miz_hi.smileessence.data.UserStore;
-import net.miz_hi.smileessence.dialog.DialogAdapter;
-import android.app.Activity;
-import android.app.Dialog;
-
-public class EventCommandDialog extends DialogAdapter
-{
-
- private EventModel model;
-
- public EventCommandDialog(Activity activity, EventModel model)
- {
- super(activity);
- this.model = model;
- }
-
- @Override
- public Dialog createMenuDialog(boolean init)
- {
- UserModel user = UserStore.put(model.source);
- if(init)
- {
- list.clear();
-
- list.add(new UserCommandReply(user.screenName));
- list.add(new UserCommandOpenProfiel(activity, user.screenName));
- list.add(new UserCommandOpenPage(activity, user.screenName));
- list.add(new UserCommandOpenFavstar(activity, user.screenName));
- list.add(new UserCommandFollow(user.screenName));
- list.add(new UserCommandRemove(user.screenName));
-
- setTitle("@"+ user.screenName);
- }
-
- return super.createMenuDialog();
- }
-
-
-
-}
diff --git a/src/net/miz_hi/smileessence/event/EventViewFactory.java b/src/net/miz_hi/smileessence/event/EventViewFactory.java
index 9e6977f8..0dce2a4d 100644
--- a/src/net/miz_hi/smileessence/event/EventViewFactory.java
+++ b/src/net/miz_hi/smileessence/event/EventViewFactory.java
@@ -18,9 +18,9 @@ public class EventViewFactory
public static View getToastView(Activity activity, EventModel model, View viewBase)
{
- if(model instanceof StatusEvent)
+ if(model instanceof StatusEventModel)
{
- return getToastView(activity, (StatusEvent)model, viewBase);
+ return getToastView(activity, (StatusEventModel)model, viewBase);
}
else if(model instanceof UserEvent)
{
@@ -32,7 +32,7 @@ public class EventViewFactory
}
}
- private static View getToastView(Activity activity, StatusEvent model, View viewBase)
+ private static View getToastView(Activity activity, StatusEventModel model, View viewBase)
{
LayoutInflater layoutInflater = LayoutInflater.from(activity);
if (viewBase == null)
@@ -93,9 +93,9 @@ public class EventViewFactory
public static View getView(EventModel model, View viewBase)
{
- if(model instanceof StatusEvent)
+ if(model instanceof StatusEventModel)
{
- return getView((StatusEvent)model, viewBase);
+ return getView((StatusEventModel)model, viewBase);
}
else if(model instanceof UserEvent)
{
@@ -131,7 +131,7 @@ public class EventViewFactory
return viewBase;
}
- private static View getView(StatusEvent model, View viewBase)
+ private static View getView(StatusEventModel model, View viewBase)
{
LayoutInflater layoutInflater = LayoutInflater.from(MainActivity.getInstance());
if (viewBase == null)
diff --git a/src/net/miz_hi/smileessence/event/FavoriteEvent.java b/src/net/miz_hi/smileessence/event/FavoriteEvent.java
index 6f0d4222..26235eb2 100644
--- a/src/net/miz_hi/smileessence/event/FavoriteEvent.java
+++ b/src/net/miz_hi/smileessence/event/FavoriteEvent.java
@@ -3,7 +3,7 @@ package net.miz_hi.smileessence.event;
import twitter4j.Status;
import twitter4j.User;
-public class FavoriteEvent extends StatusEvent implements IAttackEvent
+public class FavoriteEvent extends StatusEventModel implements IAttackEvent
{
// private int favedCount;
diff --git a/src/net/miz_hi/smileessence/event/HistoryListAdapter.java b/src/net/miz_hi/smileessence/event/HistoryListAdapter.java
index 1480ea84..f507d881 100644
--- a/src/net/miz_hi/smileessence/event/HistoryListAdapter.java
+++ b/src/net/miz_hi/smileessence/event/HistoryListAdapter.java
@@ -1,6 +1,7 @@
package net.miz_hi.smileessence.event;
import net.miz_hi.smileessence.R;
+import net.miz_hi.smileessence.core.Notifier;
import net.miz_hi.smileessence.listener.EventOnClickListener;
import net.miz_hi.smileessence.util.CustomListAdapter;
import android.app.Activity;
@@ -10,23 +11,15 @@ import android.view.ViewGroup;
public class HistoryListAdapter extends CustomListAdapter<EventModel>
{
- private ToastManager manager;
-
public HistoryListAdapter(Activity activity)
{
super(activity, 1000);
- manager = ToastManager.getInstance();
}
-
- public void notice(EventModel model)
- {
- manager.noticeEvent(model);
- }
@Override
public void addFirst(final EventModel model)
{
- manager.noticeEvent(model);
+ Notifier.buildEvent(model).raise();
HistoryListAdapter.super.addFirst(model);
}
diff --git a/src/net/miz_hi/smileessence/event/ReplyEvent.java b/src/net/miz_hi/smileessence/event/ReplyEvent.java
index fe33b4ce..6ceafe89 100644
--- a/src/net/miz_hi/smileessence/event/ReplyEvent.java
+++ b/src/net/miz_hi/smileessence/event/ReplyEvent.java
@@ -3,7 +3,7 @@ package net.miz_hi.smileessence.event;
import twitter4j.Status;
import twitter4j.User;
-public class ReplyEvent extends StatusEvent
+public class ReplyEvent extends StatusEventModel
{
public ReplyEvent(User source, Status targetStatus)
diff --git a/src/net/miz_hi/smileessence/event/RetweetEvent.java b/src/net/miz_hi/smileessence/event/RetweetEvent.java
index 25e7d0ae..3b119877 100644
--- a/src/net/miz_hi/smileessence/event/RetweetEvent.java
+++ b/src/net/miz_hi/smileessence/event/RetweetEvent.java
@@ -3,7 +3,7 @@ package net.miz_hi.smileessence.event;
import twitter4j.Status;
import twitter4j.User;
-public class RetweetEvent extends StatusEvent implements IAttackEvent
+public class RetweetEvent extends StatusEventModel implements IAttackEvent
{
// private int retweetedCount;
diff --git a/src/net/miz_hi/smileessence/event/StatusEvent.java b/src/net/miz_hi/smileessence/event/StatusEventModel.java
index 11041001..fb978c89 100644
--- a/src/net/miz_hi/smileessence/event/StatusEvent.java
+++ b/src/net/miz_hi/smileessence/event/StatusEventModel.java
@@ -5,12 +5,12 @@ import net.miz_hi.smileessence.data.StatusStore;
import twitter4j.Status;
import twitter4j.User;
-public abstract class StatusEvent extends EventModel
+public abstract class StatusEventModel extends EventModel
{
public StatusModel targetModel;
- public StatusEvent(User source, Status targetStatus)
+ public StatusEventModel(User source, Status targetStatus)
{
super(source);
this.targetModel = StatusStore.put(targetStatus);
diff --git a/src/net/miz_hi/smileessence/event/ToastManager.java b/src/net/miz_hi/smileessence/event/ToastManager.java
deleted file mode 100644
index 17d977a4..00000000
--- a/src/net/miz_hi/smileessence/event/ToastManager.java
+++ /dev/null
@@ -1,124 +0,0 @@
-package net.miz_hi.smileessence.event;
-
-import net.miz_hi.smileessence.util.CountUpInteger;
-import net.miz_hi.smileessence.util.UiHandler;
-import net.miz_hi.smileessence.view.MainActivity;
-import twitter4j.User;
-import android.app.Activity;
-import android.view.Gravity;
-import android.view.View;
-import android.widget.Toast;
-
-public class ToastManager
-{
-
- private static ToastManager instance;
- private Activity activity;
- private Toast toast;
- private View viewToastBase;
- private User enemyUser;
- private long lastUserId = -1;
- private long lastStatusId = -1;
- private CountUpInteger counterSourceUser = new CountUpInteger(5);
- private CountUpInteger counterTargetStatus = new CountUpInteger(5);
-
- private ToastManager(Activity activity)
- {
- this.activity = activity;
- }
-
- public static ToastManager getInstance()
- {
- if(instance == null)
- {
- instance = new ToastManager(MainActivity.getInstance());
- }
- return instance;
- }
-
- public static void toast(String text)
- {
- getInstance().showToast(text);
- }
-
- private void showToast(final String text)
- {
- if(activity == null || activity.isFinishing())
- {
- return;
- }
- new UiHandler()
- {
-
- @Override
- public void run()
- {
- Toast.makeText(activity, text, Toast.LENGTH_SHORT).show();
- }
- }.postDelayed(200);
- }
-
- public void noticeEvent(final EventModel model)
- {
- if(model instanceof StatusEvent)
- {
- StatusEvent se = (StatusEvent)model;
- if(se instanceof IAttackEvent)
- {
- if(lastUserId != se.source.getId())
- {
- counterSourceUser.reset();
- lastUserId = se.source.getId();
- }
- else
- {
- if (counterSourceUser.isOver())
- {
- return;
- }
-
- if(counterSourceUser.countUp())
- {
- showToast(se.source.getScreenName() + "U󂯂Ă܂");
- return;
- }
- }
-
- if(lastStatusId != se.targetModel.statusId)
- {
- counterTargetStatus.reset();
- lastStatusId = se.targetModel.statusId;
- }
- else
- {
- if(counterTargetStatus.isOver())
- {
- return;
- }
- if(counterTargetStatus.countUp())
- {
- showToast("Ȃ̃cC[gU󂯂Ă܂");
- return;
- }
- }
- }
- }
-
- new UiHandler()
- {
- @Override
- public void run()
- {
- if (toast == null)
- {
- toast = new Toast(activity);
- }
- viewToastBase = EventViewFactory.getToastView(activity, model, viewToastBase);
- toast.setView(viewToastBase);
- toast.setGravity(Gravity.BOTTOM, 0, 80);
- toast.setDuration(Toast.LENGTH_SHORT);
- toast.show();
- }
- }.post();
- }
-}
diff --git a/src/net/miz_hi/smileessence/event/UnfavoriteEvent.java b/src/net/miz_hi/smileessence/event/UnfavoriteEvent.java
index 8850ee8f..74783e79 100644
--- a/src/net/miz_hi/smileessence/event/UnfavoriteEvent.java
+++ b/src/net/miz_hi/smileessence/event/UnfavoriteEvent.java
@@ -3,7 +3,7 @@ package net.miz_hi.smileessence.event;
import twitter4j.Status;
import twitter4j.User;
-public class UnfavoriteEvent extends StatusEvent implements IAttackEvent
+public class UnfavoriteEvent extends StatusEventModel implements IAttackEvent
{
public UnfavoriteEvent(User source, Status targetStatus)
diff --git a/src/net/miz_hi/smileessence/listener/EventOnClickListener.java b/src/net/miz_hi/smileessence/listener/EventOnClickListener.java
index b1418d0f..8bf1b55a 100644
--- a/src/net/miz_hi/smileessence/listener/EventOnClickListener.java
+++ b/src/net/miz_hi/smileessence/listener/EventOnClickListener.java
@@ -2,8 +2,8 @@ package net.miz_hi.smileessence.listener;
import net.miz_hi.smileessence.Client;
import net.miz_hi.smileessence.R;
-import net.miz_hi.smileessence.event.EventCommandDialog;
import net.miz_hi.smileessence.event.EventModel;
+import net.miz_hi.smileessence.menu.EventMenu;
import net.miz_hi.smileessence.util.ColorUtils;
import net.miz_hi.smileessence.util.UiHandler;
import android.app.Activity;
@@ -24,7 +24,6 @@ public class EventOnClickListener implements OnClickListener
@Override
public void onClick(final View v)
{
- final EventCommandDialog adapter = new EventCommandDialog(activity, model);
v.setBackgroundColor(Client.getColor(R.color.MetroBlue));
v.invalidate();
new UiHandler()
@@ -33,7 +32,7 @@ public class EventOnClickListener implements OnClickListener
public void run()
{
v.setBackgroundColor(ColorUtils.setAlpha(Client.getColor(R.color.LightGray), 200));
- adapter.createMenuDialog(true).show();
+ new EventMenu(activity, model).create().show();
}
}.postDelayed(50);
}
diff --git a/src/net/miz_hi/smileessence/listener/ExtraWordOnClickListener.java b/src/net/miz_hi/smileessence/listener/ExtraWordOnClickListener.java
index f264ea52..9b137bc3 100644
--- a/src/net/miz_hi/smileessence/listener/ExtraWordOnClickListener.java
+++ b/src/net/miz_hi/smileessence/listener/ExtraWordOnClickListener.java
@@ -4,7 +4,8 @@ import net.miz_hi.smileessence.Client;
import net.miz_hi.smileessence.R;
import net.miz_hi.smileessence.data.extra.ExtraWord;
import net.miz_hi.smileessence.data.extra.ExtraWords;
-import net.miz_hi.smileessence.dialog.YesNoDialogHelper;
+import net.miz_hi.smileessence.dialog.ConfirmDialog;
+import net.miz_hi.smileessence.dialog.ContentDialog;
import net.miz_hi.smileessence.util.ColorUtils;
import net.miz_hi.smileessence.util.CustomListAdapter;
import net.miz_hi.smileessence.util.UiHandler;
@@ -13,119 +14,80 @@ import android.content.DialogInterface;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.View.OnLongClickListener;
+import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.TextView;
public class ExtraWordOnClickListener implements OnClickListener, OnLongClickListener
{
private CustomListAdapter adapter;
- private ExtraWord ExtraWord;
+ private ExtraWord extraWord;
private Activity activity;
- public ExtraWordOnClickListener(CustomListAdapter adapter, Activity activity, ExtraWord ExtraWord)
+ public ExtraWordOnClickListener(CustomListAdapter adapter, Activity activity, ExtraWord extraWord)
{
this.adapter = adapter;
this.activity = activity;
- this.ExtraWord = ExtraWord;
+ this.extraWord = extraWord;
}
@Override
public void onClick(final View v)
{
- v.setBackgroundColor(Client.getColor(R.color.MetroBlue));
- v.invalidate();
- new UiHandler()
+ final EditText editText = new EditText(activity);
+ editText.setText(extraWord.getText());
+
+ ContentDialog dialog = new ContentDialog(activity, "ҏW");
+ dialog.setContentView(editText);
+ dialog.setOnClickListener(new DialogInterface.OnClickListener()
{
+
@Override
- public void run()
+ public void onClick(DialogInterface dialog, int which)
{
- v.setBackgroundColor(ColorUtils.setAlpha(Client.getColor(R.color.LightGray), 200));
-
- final EditText editText = new EditText(activity);
- editText.setText(ExtraWord.getText());
-
- YesNoDialogHelper helper = new YesNoDialogHelper(activity, "ҏW");
- helper.setContentView(editText);
- helper.setOnClickListener(new DialogInterface.OnClickListener()
+ switch(which)
{
-
- @Override
- public void onClick(DialogInterface dialog, int which)
+ case DialogInterface.BUTTON_NEGATIVE:
+ {
+ break;
+ }
+ case DialogInterface.BUTTON_POSITIVE:
{
- switch(which)
- {
- case DialogInterface.BUTTON_NEGATIVE:
- {
- break;
- }
- case DialogInterface.BUTTON_POSITIVE:
- {
- String newText = editText.getText().toString();
- ExtraWord.setText(newText);
- ExtraWords.update();
- adapter.clear();
- adapter.addAll(ExtraWords.getExtraWords());
- adapter.forceNotifyAdapter();
- v.getParent().requestLayout();
- break;
- }
- }
+ String newText = editText.getText().toString();
+ extraWord.setText(newText);
+ ExtraWords.update();
+ adapter.forceNotifyAdapter();
+ break;
}
- });
- helper.setTextPositive("");
- helper.setTextNegative("LZ");
- helper.createYesNoAlert().show();
+ }
}
- }.postDelayed(50);
+ });
+ dialog.create().show();
}
@Override
public boolean onLongClick(final View v)
{
- v.setBackgroundColor(Client.getColor(R.color.MetroBlue));
- v.invalidate();
- new UiHandler()
+ ConfirmDialog.show(activity, "폜Ă낵łH", new Runnable()
{
+
@Override
public void run()
{
- v.setBackgroundColor(ColorUtils.setAlpha(Client.getColor(R.color.LightGray), 200));
-
- TextView viewText = new TextView(activity);
- viewText.setText("폜Ă낵łH");
- viewText.setTextColor(Client.getColor(R.color.White));
- YesNoDialogHelper helper = new YesNoDialogHelper(activity, "폜");
- helper.setContentView(viewText);
- helper.setOnClickListener(new DialogInterface.OnClickListener()
+ new UiHandler()
{
-
+
@Override
- public void onClick(DialogInterface dialog, int which)
+ public void run()
{
- switch(which)
- {
- case DialogInterface.BUTTON_NEGATIVE:
- {
- break;
- }
- case DialogInterface.BUTTON_POSITIVE:
- {
- ExtraWords.deleteExtraWord(ExtraWord);
- adapter.clear();
- adapter.notifyDataSetChanged();
- adapter.addAll(ExtraWords.getExtraWords());
- adapter.notifyDataSetChanged();
-
- break;
- }
- }
+ ExtraWords.deleteExtraWord(extraWord);
+ adapter.removeElement(extraWord);
+ adapter.forceNotifyAdapter();
+ ExtraWords.update();
}
- });
- helper.setTextPositive("͂");
- helper.setTextNegative("");
- helper.createYesNoAlert().show();
+ }.post();
}
- }.postDelayed(50);
+ });
return true;
}
diff --git a/src/net/miz_hi/smileessence/listener/MyUserStreamListener.java b/src/net/miz_hi/smileessence/listener/MyUserStreamListener.java
index a344e7db..686ef197 100644
--- a/src/net/miz_hi/smileessence/listener/MyUserStreamListener.java
+++ b/src/net/miz_hi/smileessence/listener/MyUserStreamListener.java
@@ -1,26 +1,30 @@
package net.miz_hi.smileessence.listener;
+import de.keyboardsurfer.android.widget.crouton.Style;
import net.miz_hi.smileessence.Client;
+import net.miz_hi.smileessence.core.Notifier;
import net.miz_hi.smileessence.data.StatusModel;
import net.miz_hi.smileessence.data.StatusStore;
import net.miz_hi.smileessence.data.extra.ExtraWord;
import net.miz_hi.smileessence.data.extra.ExtraWords;
import net.miz_hi.smileessence.event.BlockEvent;
import net.miz_hi.smileessence.event.DirectMessageEvent;
+import net.miz_hi.smileessence.event.Event;
import net.miz_hi.smileessence.event.FavoriteEvent;
import net.miz_hi.smileessence.event.FollowEvent;
import net.miz_hi.smileessence.event.HistoryListAdapter;
import net.miz_hi.smileessence.event.ReplyEvent;
import net.miz_hi.smileessence.event.RetweetEvent;
-import net.miz_hi.smileessence.event.ToastManager;
import net.miz_hi.smileessence.event.UnblockEvent;
import net.miz_hi.smileessence.event.UnfavoriteEvent;
import net.miz_hi.smileessence.preference.EnumPreferenceKey;
import net.miz_hi.smileessence.status.StatusListAdapter;
import net.miz_hi.smileessence.system.MainSystem;
+import net.miz_hi.smileessence.system.RelationSystem;
import net.miz_hi.smileessence.util.LogHelper;
+import net.miz_hi.smileessence.view.ExtractFragment;
import net.miz_hi.smileessence.view.MainActivity;
-import net.miz_hi.smileessence.view.RelationListPageFragment;
+import net.miz_hi.smileessence.view.RelationFragment;
import twitter4j.ConnectionLifeCycleListener;
import twitter4j.DirectMessage;
import twitter4j.StallWarning;
@@ -35,7 +39,6 @@ public class MyUserStreamListener implements UserStreamListener, ConnectionLifeC
private StatusListAdapter homeListAdapter;
private StatusListAdapter mentionsListAdapter;
private HistoryListAdapter eventListAdapter;
- private StatusListAdapter relationListAdapter;
private int exceptionCount;
@@ -43,30 +46,25 @@ public class MyUserStreamListener implements UserStreamListener, ConnectionLifeC
{
}
- public void setHomeListAdapter(StatusListAdapter adapter)
+ public void setHomeAdapter(StatusListAdapter adapter)
{
this.homeListAdapter = adapter;
}
- public void setMentionsListAdapter(StatusListAdapter adapter)
+ public void setMentionsAdapter(StatusListAdapter adapter)
{
this.mentionsListAdapter = adapter;
}
- public void setEventListAdapter(HistoryListAdapter adapter)
+ public void setHistoryAdapter(HistoryListAdapter adapter)
{
this.eventListAdapter = adapter;
}
-
- public void setRelationListAdapter(StatusListAdapter adapter)
- {
- this.relationListAdapter = adapter;
- }
@Override
public void onDeletionNotice(StatusDeletionNotice arg0)
{
- LogHelper.printD("on status detete");
+ LogHelper.d("on status detete");
final StatusModel model = StatusStore.get(arg0.getStatusId());
if (model == null)
{
@@ -78,8 +76,11 @@ public class MyUserStreamListener implements UserStreamListener, ConnectionLifeC
homeListAdapter.notifyAdapter();
mentionsListAdapter.removeElement(model);
mentionsListAdapter.notifyAdapter();
- relationListAdapter.removeElement(model);
- relationListAdapter.notifyAdapter();
+ for(StatusListAdapter adapter : RelationSystem.getAdapters())
+ {
+ adapter.removeElement(model);
+ adapter.notifyAdapter();
+ }
}
}
@@ -109,7 +110,7 @@ public class MyUserStreamListener implements UserStreamListener, ConnectionLifeC
}
else if (!model.isRetweet && model.isReply)
{
- eventListAdapter.notice(new ReplyEvent(status.getUser(), status));
+ Notifier.buildEvent(new ReplyEvent(status.getUser(), status)).raise();
}
if (model.isReply)
@@ -118,28 +119,32 @@ public class MyUserStreamListener implements UserStreamListener, ConnectionLifeC
mentionsListAdapter.notifyAdapter();
}
- if(!ExtraWords.getExtraWords().isEmpty())
+ if(!model.isRetweet && !ExtraWords.getExtraWords().isEmpty())
{
for(ExtraWord word : ExtraWords.getExtraWords())
{
if(model.text.contains(word.getText()))
{
- mentionsListAdapter.addFirst(model);
- mentionsListAdapter.notifyAdapter();
+ ExtractFragment.singleton().getAdapter().addFirst(model);
+ ExtractFragment.singleton().getAdapter().notifyAdapter();
break;
}
}
}
-
- if(RelationListPageFragment.getChasingId() > -1 && model.inReplyToStatusId == RelationListPageFragment.getChasingId())
+ if(RelationSystem.isChasing())
{
- relationListAdapter.addFirst(model);
- relationListAdapter.notifyAdapter();
- RelationListPageFragment.setChasingId(model.statusId);
+ RelationFragment rel = RelationSystem.getRelationByChasingId(model.inReplyToStatusId);
+ if(rel != null)
+ {
+ StatusListAdapter relAdapter = RelationSystem.getAdapter(rel);
+ relAdapter.addFirst(model);
+ relAdapter.notifyAdapter();
+ rel.setChasingId(model.statusId);
+ }
}
+
homeListAdapter.addFirst(model);
homeListAdapter.notifyAdapter();
-
}
@Override
@@ -150,13 +155,8 @@ public class MyUserStreamListener implements UserStreamListener, ConnectionLifeC
@Override
public void onException(Exception arg0)
{
- if(exceptionCount++ > 3)
- {
- return;
- }
-
- ToastManager.toast("ڑ؂܂");
- MainSystem.getInstance().connectUserStream();
+ arg0.printStackTrace();
+ Notifier.alert("ڑ؂܂");
}
@Override
@@ -198,8 +198,8 @@ public class MyUserStreamListener implements UserStreamListener, ConnectionLifeC
StatusStore.putFavoritedStatus(targetStatus.getId());
}
- MainSystem.getInstance().homeListAdapter.forceNotifyAdapter();
- MainSystem.getInstance().mentionsListAdapter.forceNotifyAdapter();
+ MainSystem.getInstance().homeListAdapter.notifyAdapter();
+ MainSystem.getInstance().mentionsListAdapter.notifyAdapter();
}
if (targetUser.getId() == Client.getMainAccount().getUserId())
{
@@ -247,8 +247,8 @@ public class MyUserStreamListener implements UserStreamListener, ConnectionLifeC
StatusStore.removeFavoritedStatus(targetStatus.getId());
}
- MainSystem.getInstance().homeListAdapter.forceNotifyAdapter();
- MainSystem.getInstance().mentionsListAdapter.forceNotifyAdapter();
+ MainSystem.getInstance().homeListAdapter.notifyAdapter();
+ MainSystem.getInstance().mentionsListAdapter.notifyAdapter();
}
if(Client.<Boolean>getPreferenceValue(EnumPreferenceKey.NOTICE_UNFAV))
@@ -309,7 +309,7 @@ public class MyUserStreamListener implements UserStreamListener, ConnectionLifeC
@Override
public void onConnect()
{
- ToastManager.toast("ڑ܂");
+ Notifier.info("ڑ܂");
}
@Override
diff --git a/src/net/miz_hi/smileessence/listener/PageChangeListener.java b/src/net/miz_hi/smileessence/listener/PageChangeListener.java
new file mode 100644
index 00000000..77ed52da
--- /dev/null
+++ b/src/net/miz_hi/smileessence/listener/PageChangeListener.java
@@ -0,0 +1,59 @@
+package net.miz_hi.smileessence.listener;
+
+import net.miz_hi.smileessence.Client;
+import net.miz_hi.smileessence.async.MyExecutor;
+import net.miz_hi.smileessence.core.Notifier;
+import net.miz_hi.smileessence.preference.EnumPreferenceKey;
+import net.miz_hi.smileessence.util.LogHelper;
+import net.miz_hi.smileessence.util.UiHandler;
+import net.miz_hi.smileessence.view.MainActivity;
+import net.miz_hi.smileessence.view.PostFragment;
+import android.content.Context;
+import android.support.v4.view.ViewPager.OnPageChangeListener;
+import android.util.Log;
+import android.view.inputmethod.InputMethodManager;
+import android.widget.Toast;
+
+public class PageChangeListener implements OnPageChangeListener
+{
+
+ boolean isOpening = false;
+
+ @Override
+ public void onPageScrollStateChanged(int position)
+ {
+ }
+
+ @Override
+ public void onPageScrolled(int arg0, float arg1, int arg2)
+ {
+ }
+
+ @Override
+ public void onPageSelected(final int position)
+ {
+ MyExecutor.execute(new Runnable()
+ {
+
+ @Override
+ public void run()
+ {
+ if(position == MainActivity.PAGE_POST)
+ {
+ PostFragment.singleton().load();
+ isOpening = true;
+ }
+ else
+ {
+ if(isOpening)
+ {
+ PostFragment.singleton().save();
+ }
+ isOpening = false;
+ }
+ }
+ });
+
+ }
+
+}
diff --git a/src/net/miz_hi/smileessence/listener/PostEditTextListener.java b/src/net/miz_hi/smileessence/listener/PostEditTextListener.java
new file mode 100644
index 00000000..72b1b335
--- /dev/null
+++ b/src/net/miz_hi/smileessence/listener/PostEditTextListener.java
@@ -0,0 +1,57 @@
+package net.miz_hi.smileessence.listener;
+
+import net.miz_hi.smileessence.Client;
+import net.miz_hi.smileessence.preference.EnumPreferenceKey;
+import net.miz_hi.smileessence.system.PostSystem;
+import net.miz_hi.smileessence.view.PostFragment;
+import android.content.Context;
+import android.text.Editable;
+import android.text.TextWatcher;
+import android.view.View;
+import android.view.View.OnFocusChangeListener;
+import android.view.inputmethod.InputMethodManager;
+import android.widget.EditText;
+import android.widget.TextView;
+
+public class PostEditTextListener implements TextWatcher, OnFocusChangeListener
+{
+
+ TextView viewCount;
+
+ public PostEditTextListener(TextView viewCount)
+ {
+ this.viewCount = viewCount;
+ }
+
+ @Override
+ public void onFocusChange(View v, boolean hasFocus)
+ {
+ if(hasFocus)
+ {
+ InputMethodManager imm = (InputMethodManager) Client.getApplication().getSystemService(Context.INPUT_METHOD_SERVICE);
+ imm.showSoftInput(v, 0);
+ }
+ else
+ {
+ InputMethodManager imm = (InputMethodManager) Client.getApplication().getSystemService(Context.INPUT_METHOD_SERVICE);
+ imm.hideSoftInputFromWindow(v.getWindowToken(), 0);
+ }
+ }
+
+ @Override
+ public void afterTextChanged(Editable arg0)
+ {
+ }
+
+ @Override
+ public void beforeTextChanged(CharSequence arg0, int arg1, int arg2, int arg3)
+ {
+ }
+
+ @Override
+ public void onTextChanged(CharSequence arg0, int arg1, int arg2, int arg3)
+ {
+ viewCount.setText(String.valueOf(140 - arg0.length()));
+ }
+
+}
diff --git a/src/net/miz_hi/smileessence/listener/StatusOnClickListener.java b/src/net/miz_hi/smileessence/listener/StatusOnClickListener.java
index 457bd5b3..2adf9d4e 100644
--- a/src/net/miz_hi/smileessence/listener/StatusOnClickListener.java
+++ b/src/net/miz_hi/smileessence/listener/StatusOnClickListener.java
@@ -24,7 +24,6 @@ public class StatusOnClickListener implements OnClickListener
@Override
public void onClick(final View v)
{
- final StatusMenu adapter = new StatusMenu(activity, model);
v.setBackgroundColor(Client.getColor(R.color.MetroBlue));
v.invalidate();
new UiHandler()
@@ -34,9 +33,11 @@ public class StatusOnClickListener implements OnClickListener
public void run()
{
v.setBackgroundColor(model.backgroundColor);
- adapter.createMenuDialog(true).show();
+ new StatusMenu(activity, model).create().show();
}
- }.postDelayed(50);
+ }.postDelayed(20);
+
}
+
}
diff --git a/src/net/miz_hi/smileessence/listener/TemplateOnClickListener.java b/src/net/miz_hi/smileessence/listener/TemplateOnClickListener.java
index 840ef749..62ed8b12 100644
--- a/src/net/miz_hi/smileessence/listener/TemplateOnClickListener.java
+++ b/src/net/miz_hi/smileessence/listener/TemplateOnClickListener.java
@@ -2,9 +2,11 @@ package net.miz_hi.smileessence.listener;
import net.miz_hi.smileessence.Client;
import net.miz_hi.smileessence.R;
+import net.miz_hi.smileessence.data.extra.ExtraWords;
import net.miz_hi.smileessence.data.template.Template;
import net.miz_hi.smileessence.data.template.Templates;
-import net.miz_hi.smileessence.dialog.YesNoDialogHelper;
+import net.miz_hi.smileessence.dialog.ConfirmDialog;
+import net.miz_hi.smileessence.dialog.ContentDialog;
import net.miz_hi.smileessence.util.ColorUtils;
import net.miz_hi.smileessence.util.CustomListAdapter;
import net.miz_hi.smileessence.util.UiHandler;
@@ -32,100 +34,60 @@ public class TemplateOnClickListener implements OnClickListener, OnLongClickList
@Override
public void onClick(final View v)
{
- v.setBackgroundColor(Client.getColor(R.color.MetroBlue));
- v.invalidate();
- new UiHandler()
+ final EditText editText = new EditText(activity);
+ editText.setText(template.getText());
+
+ ContentDialog dialog = new ContentDialog(activity, "ҏW");
+ dialog.setContentView(editText);
+ dialog.setOnClickListener(new DialogInterface.OnClickListener()
{
+
@Override
- public void run()
+ public void onClick(DialogInterface dialog, int which)
{
- v.setBackgroundColor(ColorUtils.setAlpha(Client.getColor(R.color.LightGray), 200));
-
- final EditText editText = new EditText(activity);
- editText.setText(template.getText());
-
- YesNoDialogHelper helper = new YesNoDialogHelper(activity, "ҏW");
- helper.setContentView(editText);
- helper.setOnClickListener(new DialogInterface.OnClickListener()
+ switch(which)
{
-
- @Override
- public void onClick(DialogInterface dialog, int which)
+ case DialogInterface.BUTTON_NEGATIVE:
+ {
+ break;
+ }
+ case DialogInterface.BUTTON_POSITIVE:
{
- switch(which)
- {
- case DialogInterface.BUTTON_NEGATIVE:
- {
- break;
- }
- case DialogInterface.BUTTON_POSITIVE:
- {
- String newText = editText.getText().toString();
- template.setText(newText);
- Templates.update();
- adapter.clear();
- adapter.addAll(Templates.getTemplates());
- adapter.forceNotifyAdapter();
- v.getParent().requestLayout();
- break;
- }
- }
+ String newText = editText.getText().toString();
+ template.setText(newText);
+ Templates.update();
+ adapter.forceNotifyAdapter();
+ break;
}
- });
- helper.setTextPositive("");
- helper.setTextNegative("LZ");
- helper.createYesNoAlert().show();
+ }
}
- }.postDelayed(50);
+ });
+ dialog.create().show();
}
@Override
public boolean onLongClick(final View v)
{
- v.setBackgroundColor(Client.getColor(R.color.MetroBlue));
- v.invalidate();
- new UiHandler()
+ ConfirmDialog.show(activity, "폜Ă낵łH", new Runnable()
{
+
@Override
public void run()
{
- v.setBackgroundColor(ColorUtils.setAlpha(Client.getColor(R.color.LightGray), 200));
-
- TextView viewText = new TextView(activity);
- viewText.setText("폜Ă낵łH");
- viewText.setTextColor(Client.getColor(R.color.White));
- YesNoDialogHelper helper = new YesNoDialogHelper(activity, "폜");
- helper.setContentView(viewText);
- helper.setOnClickListener(new DialogInterface.OnClickListener()
+ new UiHandler()
{
-
+
@Override
- public void onClick(DialogInterface dialog, int which)
+ public void run()
{
- switch(which)
- {
- case DialogInterface.BUTTON_NEGATIVE:
- {
- break;
- }
- case DialogInterface.BUTTON_POSITIVE:
- {
- Templates.deleteTemplate(template);
- adapter.clear();
- adapter.notifyDataSetChanged();
- adapter.addAll(Templates.getTemplates());
- adapter.notifyDataSetChanged();
-
- break;
- }
- }
+ Templates.deleteTemplate(template);
+ adapter.removeElement(template);
+ adapter.forceNotifyAdapter();
+ Templates.update();
}
- });
- helper.setTextPositive("͂");
- helper.setTextNegative("");
- helper.createYesNoAlert().show();
+ }.post();
}
- }.postDelayed(50);
+ });
return true;
}
diff --git a/src/net/miz_hi/smileessence/listener/TweetViewTouchListener.java b/src/net/miz_hi/smileessence/listener/TweetViewTouchListener.java
deleted file mode 100644
index 57d83d25..00000000
--- a/src/net/miz_hi/smileessence/listener/TweetViewTouchListener.java
+++ /dev/null
@@ -1,83 +0,0 @@
-package net.miz_hi.smileessence.listener;
-
-import net.miz_hi.smileessence.view.TweetView;
-import android.view.MotionEvent;
-import android.view.View;
-import android.view.View.OnTouchListener;
-
-public class TweetViewTouchListener implements OnTouchListener
-{
-
- // Xʒu̓씻f
- private float MARGIN_X = 60.0f;
- // GꂽuԂXʒu
- private float mDownX;
- // GꂽuԂYʒu
- private float mDownY;
- // Eړ
- private final static int MOVE_RIGHT = 1;
- // ړ
- private final static int MOVE_LEFT = -1;
-
- public boolean onTouch(MotionEvent event)
- {
- int action = event.getAction();
- switch (action)
- {
- case MotionEvent.ACTION_DOWN:
- {
- actionDown(event);
- }
- case MotionEvent.ACTION_UP:
- {
- return actionUp(event);
- }
- }
- return false;
- }
-
- private void actionDown(MotionEvent event)
- {
- // ʒuۑ
- mDownX = event.getX();
- mDownY = event.getY();
- }
-
- private boolean actionUp(MotionEvent event)
- {
- // ݈ʒu ACTION_DOWN ̈ʒur
- float moveX = mDownX - event.getX();
- float moveY = mDownY - event.getY();
- // ړ͈͓Ȃ疳
- if (Math.abs(moveX) > MARGIN_X )
- {
- changeList(moveX > 0 ? MOVE_RIGHT : MOVE_LEFT);
- return true;
- }
- return false;
- }
-
- private void changeList(int i)
- {
- switch (i)
- {
- case MOVE_LEFT:
- {
- break;
- }
- case MOVE_RIGHT:
- {
- TweetView.getInstance();
- TweetView.close();
- break;
- }
- }
- }
-
- @Override
- public boolean onTouch(View v, MotionEvent event)
- {
- return onTouch(event);
- }
-
-}
diff --git a/src/net/miz_hi/smileessence/menu/EventMenu.java b/src/net/miz_hi/smileessence/menu/EventMenu.java
new file mode 100644
index 00000000..1f1f67ad
--- /dev/null
+++ b/src/net/miz_hi/smileessence/menu/EventMenu.java
@@ -0,0 +1,44 @@
+package net.miz_hi.smileessence.menu;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import net.miz_hi.smileessence.command.ICommand;
+import net.miz_hi.smileessence.command.user.UserCommandFollow;
+import net.miz_hi.smileessence.command.user.UserCommandOpenFavstar;
+import net.miz_hi.smileessence.command.user.UserCommandOpenInfo;
+import net.miz_hi.smileessence.command.user.UserCommandOpenPage;
+import net.miz_hi.smileessence.command.user.UserCommandRemove;
+import net.miz_hi.smileessence.command.user.UserCommandReply;
+import net.miz_hi.smileessence.data.UserModel;
+import net.miz_hi.smileessence.data.UserStore;
+import net.miz_hi.smileessence.dialog.SimpleMenuDialog;
+import net.miz_hi.smileessence.event.EventModel;
+import android.app.Activity;
+import android.app.Dialog;
+
+public class EventMenu extends SimpleMenuDialog
+{
+
+ private EventModel model;
+ private UserModel user;
+
+ public EventMenu(Activity activity, EventModel model)
+ {
+ super(activity);
+ this.model = model;
+ this.user = UserStore.put(model.source);
+ setTitle("@"+ this.user.screenName);
+ }
+
+ @Override
+ public List<ICommand> getMenuList()
+ {
+ List<ICommand> items = new ArrayList<ICommand>();
+ items.add(new UserCommandReply(user.screenName));
+ items.add(new UserCommandOpenInfo(user.screenName));
+ items.add(new UserCommandFollow(user.screenName));
+ items.add(new UserCommandRemove(user.screenName));
+ return items;
+ }
+}
diff --git a/src/net/miz_hi/smileessence/menu/ExpandMenuListAdapter.java b/src/net/miz_hi/smileessence/menu/ExpandMenuListAdapter.java
new file mode 100644
index 00000000..029906ca
--- /dev/null
+++ b/src/net/miz_hi/smileessence/menu/ExpandMenuListAdapter.java
@@ -0,0 +1,135 @@
+package net.miz_hi.smileessence.menu;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import net.miz_hi.smileessence.Client;
+import net.miz_hi.smileessence.R;
+import net.miz_hi.smileessence.command.ICommand;
+import net.miz_hi.smileessence.command.IConfirmable;
+import net.miz_hi.smileessence.dialog.ConfirmDialog;
+import net.miz_hi.smileessence.preference.EnumPreferenceKey;
+import android.app.Activity;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.view.ViewGroup;
+import android.widget.BaseExpandableListAdapter;
+import android.widget.TextView;
+
+public class ExpandMenuListAdapter extends BaseExpandableListAdapter
+{
+
+ private List<String> groups;
+ private List<List<ICommand>> children;
+ private Activity activity;
+ private LayoutInflater inflater;
+
+ public ExpandMenuListAdapter(Activity activity, Collection<String> groups, Collection<List<ICommand>> children)
+ {
+ this.activity = activity;
+ this.groups = new ArrayList<String>(groups);
+ this.children = new ArrayList<List<ICommand>>(children);
+ this.inflater = activity.getLayoutInflater();
+ }
+
+ @Override
+ public Object getChild(int arg0, int arg1)
+ {
+ return children.get(arg0).get(arg1);
+ }
+
+ @Override
+ public long getChildId(int arg0, int arg1)
+ {
+ return arg1;
+ }
+
+ @Override
+ public View getChildView(int arg0, int arg1, boolean arg2, View view, ViewGroup arg4)
+ {
+ if(view == null)
+ {
+ view = inflater.inflate(R.layout.menuitem_white, null);
+ }
+
+ final ICommand item = (ICommand) getChild(arg0, arg1);
+
+ TextView textView = (TextView) view.findViewById(R.id.textView_menuItem);
+ textView.setText(item.getName());
+ view.setOnClickListener(new OnClickListener()
+ {
+ @Override
+ public void onClick(View view)
+ {
+ if(item instanceof IConfirmable && Client.<Boolean>getPreferenceValue(EnumPreferenceKey.CONFIRM_DIALOG))
+ {
+ ConfirmDialog.show(activity, "s܂H", new Runnable()
+ {
+ @Override
+ public void run()
+ {
+ item.run();
+ }
+ });
+ }
+ else
+ {
+ item.run();
+ }
+ }
+ });
+ return view;
+ }
+
+ @Override
+ public int getChildrenCount(int arg0)
+ {
+ return children.get(arg0).size();
+ }
+
+ @Override
+ public Object getGroup(int arg0)
+ {
+ return groups.get(arg0);
+ }
+
+ @Override
+ public int getGroupCount()
+ {
+ return children.size();
+ }
+
+ @Override
+ public long getGroupId(int arg0)
+ {
+ return arg0;
+ }
+
+ @Override
+ public View getGroupView(int arg0, boolean arg1, View arg2, ViewGroup arg3)
+ {
+ if(arg2 == null)
+ {
+ arg2 = inflater.inflate(R.layout.menuparent_white, null);
+ }
+ TextView textView = (TextView) arg2.findViewById(R.id.textView_menuItem);
+ textView.setText(groups.get(arg0).toString());
+ return arg2;
+ }
+
+ @Override
+ public boolean hasStableIds()
+ {
+ return true;
+ }
+
+ @Override
+ public boolean isChildSelectable(int arg0, int arg1)
+ {
+ return true;
+ }
+
+
+}
diff --git a/src/net/miz_hi/smileessence/menu/MainMenu.java b/src/net/miz_hi/smileessence/menu/MainMenu.java
index 2ba6b264..7dd5534a 100644
--- a/src/net/miz_hi/smileessence/menu/MainMenu.java
+++ b/src/net/miz_hi/smileessence/menu/MainMenu.java
@@ -1,55 +1,40 @@
package net.miz_hi.smileessence.menu;
+import java.util.ArrayList;
+import java.util.List;
+
import net.miz_hi.smileessence.command.CommandEditExtraWord;
import net.miz_hi.smileessence.command.CommandEditMenu;
import net.miz_hi.smileessence.command.CommandEditTemplate;
-import net.miz_hi.smileessence.command.CommandOpenFavstar;
-import net.miz_hi.smileessence.command.CommandOpenSetting;
+import net.miz_hi.smileessence.command.CommandOpenPostPage;
import net.miz_hi.smileessence.command.CommandReConnect;
-import net.miz_hi.smileessence.command.CommandReport;
-import net.miz_hi.smileessence.command.CommandTweet;
-import net.miz_hi.smileessence.dialog.DialogAdapter;
+import net.miz_hi.smileessence.command.ICommand;
+import net.miz_hi.smileessence.command.main.CommandOpenFavstar;
+import net.miz_hi.smileessence.command.main.CommandOpenSetting;
+import net.miz_hi.smileessence.command.main.CommandReport;
+import net.miz_hi.smileessence.dialog.SimpleMenuDialog;
import android.app.Activity;
-import android.app.Dialog;
-public class MainMenu extends DialogAdapter
+public class MainMenu extends SimpleMenuDialog
{
-
- private static MainMenu instance;
- private MainMenu(Activity activity)
+ public MainMenu(Activity activity)
{
super(activity);
+ setTitle("Cj[");
}
@Override
- public Dialog createMenuDialog(boolean init)
- {
- if (init)
- {
- list.clear();
- list.add(new CommandTweet());
- list.add(new CommandOpenSetting(activity));
- list.add(new CommandReConnect());
- list.add(new CommandEditTemplate(activity));
- list.add(new CommandEditExtraWord(activity));
- list.add(new CommandEditMenu(activity));
- list.add(new CommandOpenFavstar(activity));
- list.add(new CommandReport());
-
- setTitle("j[");
- }
-
- return super.createMenuDialog();
- }
-
- public static void init(Activity activity)
- {
- instance = new MainMenu(activity);
- }
-
- public static MainMenu getInstance()
+ public List<ICommand> getMenuList()
{
- return instance;
+ List<ICommand> items = new ArrayList<ICommand>();
+ items.add(new CommandOpenSetting(activity));
+ items.add(new CommandReConnect());
+ items.add(new CommandEditTemplate(activity));
+ items.add(new CommandEditExtraWord(activity));
+ items.add(new CommandEditMenu(activity));
+ items.add(new CommandOpenFavstar(activity));
+ items.add(new CommandReport());
+ return items;
}
}
diff --git a/src/net/miz_hi/smileessence/menu/MenuListAdapter.java b/src/net/miz_hi/smileessence/menu/MenuListAdapter.java
new file mode 100644
index 00000000..6d734107
--- /dev/null
+++ b/src/net/miz_hi/smileessence/menu/MenuListAdapter.java
@@ -0,0 +1,62 @@
+package net.miz_hi.smileessence.menu;
+
+import android.app.Activity;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.View.OnClickListener;
+import android.widget.TextView;
+import net.miz_hi.smileessence.Client;
+import net.miz_hi.smileessence.R;
+import net.miz_hi.smileessence.command.ICommand;
+import net.miz_hi.smileessence.command.IConfirmable;
+import net.miz_hi.smileessence.dialog.ConfirmDialog;
+import net.miz_hi.smileessence.preference.EnumPreferenceKey;
+import net.miz_hi.smileessence.util.CustomListAdapter;
+
+public class MenuListAdapter extends CustomListAdapter<ICommand>
+{
+
+ public MenuListAdapter(Activity activity)
+ {
+ super(activity, 100);
+
+ }
+
+ @Override
+ public View getView(int position, View convertedView, ViewGroup parent)
+ {
+ if(convertedView == null)
+ {
+ convertedView = getInflater().inflate(R.layout.menuitem_white, null);
+ }
+
+ final ICommand item = (ICommand) getItem(position);
+
+ TextView textView = (TextView) convertedView.findViewById(R.id.textView_menuItem);
+ textView.setText(item.getName());
+ convertedView.setOnClickListener(new OnClickListener()
+ {
+ @Override
+ public void onClick(View view)
+ {
+ if(item instanceof IConfirmable && Client.<Boolean>getPreferenceValue(EnumPreferenceKey.CONFIRM_DIALOG))
+ {
+ ConfirmDialog.show(getActivity(), "s܂H", new Runnable()
+ {
+ @Override
+ public void run()
+ {
+ item.run();
+ }
+ });
+ }
+ else
+ {
+ item.run();
+ }
+ }
+ });
+ return convertedView;
+ }
+
+}
diff --git a/src/net/miz_hi/smileessence/menu/StatusMenu.java b/src/net/miz_hi/smileessence/menu/StatusMenu.java
index c17e658d..222d68ce 100644
--- a/src/net/miz_hi/smileessence/menu/StatusMenu.java
+++ b/src/net/miz_hi/smileessence/menu/StatusMenu.java
@@ -12,18 +12,20 @@ import net.miz_hi.smileessence.async.AsyncFavoriteTask;
import net.miz_hi.smileessence.async.AsyncRetweetTask;
import net.miz_hi.smileessence.async.MyExecutor;
import net.miz_hi.smileessence.command.CommandAddTemplate;
-import net.miz_hi.smileessence.command.CommandAppendHashtag;
-import net.miz_hi.smileessence.command.CommandMenuParent;
import net.miz_hi.smileessence.command.CommandOpenUrl;
-import net.miz_hi.smileessence.command.MenuCommand;
-import net.miz_hi.smileessence.command.status.StatusCommandAddReply;
+import net.miz_hi.smileessence.command.ICommand;
+import net.miz_hi.smileessence.command.IHideable;
+import net.miz_hi.smileessence.command.post.CommandAppendHashtag;
import net.miz_hi.smileessence.command.status.StatusCommandChaseRelation;
import net.miz_hi.smileessence.command.status.StatusCommandClipboard;
import net.miz_hi.smileessence.command.status.StatusCommandCongrats;
import net.miz_hi.smileessence.command.status.StatusCommandCopy;
import net.miz_hi.smileessence.command.status.StatusCommandDelete;
import net.miz_hi.smileessence.command.status.StatusCommandFavAndRetweet;
+import net.miz_hi.smileessence.command.status.StatusCommandFavorite;
import net.miz_hi.smileessence.command.status.StatusCommandNanigaja;
+import net.miz_hi.smileessence.command.status.StatusCommandReply;
+import net.miz_hi.smileessence.command.status.StatusCommandRetweet;
import net.miz_hi.smileessence.command.status.StatusCommandReview;
import net.miz_hi.smileessence.command.status.StatusCommandThankToFav;
import net.miz_hi.smileessence.command.status.StatusCommandTofuBuster;
@@ -32,31 +34,29 @@ import net.miz_hi.smileessence.command.status.StatusCommandUnOffFav;
import net.miz_hi.smileessence.command.status.StatusCommandUnOffRetweet;
import net.miz_hi.smileessence.command.status.StatusCommandUnfavorite;
import net.miz_hi.smileessence.command.status.StatusCommandWarotaRT;
+import net.miz_hi.smileessence.command.user.UserCommandAddReply;
import net.miz_hi.smileessence.command.user.UserCommandFollow;
import net.miz_hi.smileessence.command.user.UserCommandOpenFavstar;
+import net.miz_hi.smileessence.command.user.UserCommandOpenInfo;
import net.miz_hi.smileessence.command.user.UserCommandOpenPage;
-import net.miz_hi.smileessence.command.user.UserCommandOpenProfiel;
import net.miz_hi.smileessence.command.user.UserCommandRemove;
import net.miz_hi.smileessence.command.user.UserCommandReply;
import net.miz_hi.smileessence.data.StatusModel;
-import net.miz_hi.smileessence.dialog.DialogAdapter;
-import net.miz_hi.smileessence.event.ToastManager;
+import net.miz_hi.smileessence.dialog.ExpandMenuDialog;
import net.miz_hi.smileessence.status.StatusViewFactory;
-import net.miz_hi.smileessence.system.TweetSystem;
-import net.miz_hi.smileessence.util.TwitterManager;
+import net.miz_hi.smileessence.twitter.TwitterManager;
import net.miz_hi.smileessence.util.UiHandler;
-import net.miz_hi.smileessence.view.TweetView;
import twitter4j.HashtagEntity;
import twitter4j.MediaEntity;
import twitter4j.URLEntity;
import twitter4j.UserMentionEntity;
import android.app.Activity;
-import android.app.Dialog;
import android.view.View;
import android.view.View.OnClickListener;
-import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.LinearLayout.LayoutParams;
-public class StatusMenu extends DialogAdapter
+public class StatusMenu extends ExpandMenuDialog
{
private StatusModel model;
@@ -64,65 +64,75 @@ public class StatusMenu extends DialogAdapter
{
super(activity);
this.model = model;
+ setTitle(getHeaderView());
}
-
- @Override
- public Dialog createMenuDialog(boolean init)
+
+ private View getHeaderView()
{
- if (init)
+ View viewStatus = StatusViewFactory.getView(inflater, model);
+ LayoutParams p = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
+ p.setMargins(5, 5, 5, 0);
+ viewStatus.setLayoutParams(p);
+
+ View commands = inflater.inflate(R.layout.statusmenu_header, null);
+ View reply = commands.findViewById(R.id.statusmenu_reply);
+ View retweet = commands.findViewById(R.id.statusmenu_retweet);
+ View favorite = commands.findViewById(R.id.statusmenu_favorite);
+
+ final StatusCommandReply commandReply = new StatusCommandReply(model);
+ final StatusCommandRetweet commandRetweet = new StatusCommandRetweet(model);
+ final StatusCommandFavorite commandFavorite = new StatusCommandFavorite(model);
+
+ if(!commandRetweet.getDefaultVisibility())
+ {
+ retweet.setVisibility(View.INVISIBLE);
+ }
+
+ reply.setOnClickListener(new OnClickListener()
{
- View viewStatus = StatusViewFactory.getView(layoutInflater, model);
-
- View viewCommands = layoutInflater.inflate(R.layout.dialog_statuscommand_layout, null);
- ImageView viewReply = (ImageView) viewCommands.findViewById(R.id.imageView_status_reply);
- ImageView viewRetweet = (ImageView) viewCommands.findViewById(R.id.imageView_status_retweet);
- ImageView viewFavorite = (ImageView) viewCommands.findViewById(R.id.imageView_status_favorite);
-
- viewReply.setOnClickListener(onClickReply);
- viewRetweet.setOnClickListener(onClickRetweet);
- viewFavorite.setOnClickListener(onClickFavorite);
-
- if(model.user.isProtected)
- {
- viewRetweet.setVisibility(View.INVISIBLE);
- }
- else
- {
- viewRetweet.setVisibility(View.VISIBLE);
- }
-
- list.clear();
- if (!getURLMenu().isEmpty())
+ @Override
+ public void onClick(View arg0)
{
- list.add(new CommandMenuParent(this, "URLJ", getURLMenu()));
+ commandReply.run();
+ dispose();
}
+ });
+ retweet.setOnClickListener(new OnClickListener()
+ {
- for(MenuCommand item: getStatusMenu())
+ @Override
+ public void onClick(View v)
{
- list.add(item);
- }
-
- for(MenuCommand item : getHashtagMenu())
- {
- list.add(item);
+ commandRetweet.run();
+ dispose();
}
+ });
+ favorite.setOnClickListener(new OnClickListener()
+ {
- for (String name : getUsersList())
+ @Override
+ public void onClick(View v)
{
- list.add(new CommandMenuParent(this, "@" + name, getUserMenu(getUsersList()).get(name)));
+ commandFavorite.run();
+ dispose();
}
-
- setTitle(viewStatus, viewCommands);
- }
-
- return super.createMenuDialog();
+ });
+
+ commands.setLayoutParams(p);
+
+ LinearLayout header = new LinearLayout(activity);
+ header.setOrientation(LinearLayout.VERTICAL);
+
+ header.setBackgroundColor(Client.getColor(R.color.White));
+ header.addView(viewStatus);
+ header.addView(commands);
+ return header;
}
-
- public List<MenuCommand> getStatusMenu()
+
+ public List<ICommand> getStatusMenu()
{
- List<MenuCommand> list = new ArrayList<MenuCommand>();
- list.add(new StatusCommandAddReply(model));
+ List<ICommand> list = new ArrayList<ICommand>();
list.add(new StatusCommandDelete(model));
list.add(new StatusCommandFavAndRetweet(model));
list.add(new StatusCommandChaseRelation(model));
@@ -143,9 +153,9 @@ public class StatusMenu extends DialogAdapter
return list;
}
- private List<MenuCommand> getURLMenu()
+ private List<ICommand> getURLMenu()
{
- List<MenuCommand> list = new ArrayList<MenuCommand>();
+ List<ICommand> list = new ArrayList<ICommand>();
if (model.urls != null)
{
for (URLEntity urlEntity : model.urls)
@@ -171,9 +181,9 @@ public class StatusMenu extends DialogAdapter
return list;
}
- private List<MenuCommand> getHashtagMenu()
+ private List<ICommand> getHashtagMenu()
{
- List<MenuCommand> list = new ArrayList<MenuCommand>();
+ List<ICommand> list = new ArrayList<ICommand>();
if (model.hashtags != null)
{
for (HashtagEntity hashtag : model.hashtags)
@@ -205,120 +215,69 @@ public class StatusMenu extends DialogAdapter
return list;
}
- private Map<String, List<MenuCommand>> getUserMenu(List<String> userList)
+ private Map<String, List<ICommand>> getUserMenu(List<String> userList)
{
- Map<String, List<MenuCommand>> map = new HashMap<String, List<MenuCommand>>();
+ Map<String, List<ICommand>> map = new HashMap<String, List<ICommand>>();
for (String userName : userList)
{
- ArrayList<MenuCommand> list = new ArrayList<MenuCommand>();
+ ArrayList<ICommand> list = new ArrayList<ICommand>();
list.add(new UserCommandReply(userName));
- list.add(new UserCommandOpenProfiel(activity, userName));
- list.add(new UserCommandOpenPage(activity, userName));
- list.add(new UserCommandOpenFavstar(activity, userName));
- list.add(new UserCommandFollow(userName));
- list.add(new UserCommandRemove(userName));
+ list.add(new UserCommandAddReply(userName));
+ list.add(new UserCommandOpenInfo(userName));
map.put(userName, list);
}
return map;
}
- private OnClickListener onClickReply = new OnClickListener()
+ @Override
+ public List<List<ICommand>> getLists()
{
-
- @Override
- public void onClick(View v)
+
+ List<List<ICommand>> list = new ArrayList<List<ICommand>>();
+
+ List<ICommand> url = getURLMenu();
+ if (!url.isEmpty())
{
- v.setBackgroundColor(Client.getColor(R.color.MetroBlue));
- v.invalidate();
- new UiHandler()
- {
-
- @Override
- public void run()
- {
- TweetSystem.setReply(model.screenName, model.statusId);
- TweetView.open();
- dispose();
- }
- }.postDelayed(20);
+ list.add(url);
}
- };
-
- private OnClickListener onClickRetweet = new OnClickListener()
- {
-
- @Override
- public void onClick(View v)
+
+ List<ICommand> commands = getStatusMenu();
+ list.add(commands);
+
+ for (String name : getUsersList())
{
- v.setBackgroundColor(Client.getColor(R.color.MetroBlue));
- v.invalidate();
- final Future<Boolean> resp = MyExecutor.submit(new AsyncRetweetTask(model.statusId));
- MyExecutor.execute(new Runnable()
- {
-
- @Override
- public void run()
- {
- try
- {
- boolean b = resp.get();
- String str = b ? TwitterManager.MESSAGE_RETWEET_SUCCESS : TwitterManager.MESSAGE_RETWEET_DEPLICATE;
- ToastManager.toast(str);
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
- });
- new UiHandler()
- {
-
- @Override
- public void run()
- {
- dispose();
- }
- }.postDelayed(20);
+ List<ICommand> user = getUserMenu(getUsersList()).get(name);
+ list.add(user);
}
- };
-
- private OnClickListener onClickFavorite = new OnClickListener()
- {
-
- @Override
- public void onClick(View v)
+
+ List<ICommand> hashtag = getHashtagMenu();
+ if(!hashtag.isEmpty())
{
- v.setBackgroundColor(Client.getColor(R.color.MetroBlue));
- v.invalidate();
- final Future<Boolean> resp = MyExecutor.submit(new AsyncFavoriteTask(model.statusId));
- MyExecutor.execute(new Runnable()
- {
+ list.add(hashtag);
+ }
- @Override
- public void run()
- {
- try
- {
- boolean b = resp.get();
- String str = b ? TwitterManager.MESSAGE_FAVORITE_SUCCESS : TwitterManager.MESSAGE_FAVORITE_DEPLICATE;
- ToastManager.toast(str);
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
- });
- new UiHandler()
- {
+ return list;
+ }
- @Override
- public void run()
- {
- dispose();
- }
- }.postDelayed(20);
+ @Override
+ public List<String> getGroups()
+ {
+ List<String> list = new ArrayList<String>();
+ List<ICommand> url = getURLMenu();
+ if (!url.isEmpty())
+ {
+ list.add("URL");
+ }
+ list.add("R}h");
+ for (String name : getUsersList())
+ {
+ list.add("@" + name);
}
- };
+ List<ICommand> hashtag = getHashtagMenu();
+ if(!hashtag.isEmpty())
+ {
+ list.add("nbV^O");
+ }
+ return list;
+ }
}
diff --git a/src/net/miz_hi/smileessence/menu/TweetMenu.java b/src/net/miz_hi/smileessence/menu/TweetMenu.java
index 7f10a39b..73ebb7f9 100644
--- a/src/net/miz_hi/smileessence/menu/TweetMenu.java
+++ b/src/net/miz_hi/smileessence/menu/TweetMenu.java
@@ -1,60 +1,32 @@
package net.miz_hi.smileessence.menu;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
-import net.miz_hi.smileessence.command.CommandAppendHashtag;
-import net.miz_hi.smileessence.command.CommandInsertText;
-import net.miz_hi.smileessence.command.CommandMenuParent;
-import net.miz_hi.smileessence.command.CommandParseMorse;
-import net.miz_hi.smileessence.command.MenuCommand;
+import net.miz_hi.smileessence.command.ICommand;
+import net.miz_hi.smileessence.command.post.CommandAppendHashtag;
+import net.miz_hi.smileessence.command.post.CommandInsertText;
+import net.miz_hi.smileessence.command.post.CommandParseMorse;
import net.miz_hi.smileessence.data.StatusStore;
import net.miz_hi.smileessence.data.template.Template;
import net.miz_hi.smileessence.data.template.Templates;
-import net.miz_hi.smileessence.dialog.DialogAdapter;
+import net.miz_hi.smileessence.dialog.ExpandMenuDialog;
import android.app.Activity;
-import android.app.Dialog;
-public class TweetMenu extends DialogAdapter
+public class TweetMenu extends ExpandMenuDialog
{
- private static TweetMenu instance;
-
- private TweetMenu(Activity activity)
+ public TweetMenu(Activity activity)
{
super(activity);
+ setTitle("cC[gj[");
}
-
- public static void show()
- {
- instance.createMenuDialog(true).show();
- }
-
- @Override
- public Dialog createMenuDialog(boolean init)
- {
- if (init)
- {
- list.clear();
- list.add(new CommandInsertText("^"));
- list.add(new CommandParseMorse());
- if(!getTemplateMenu().isEmpty())
- {
- list.add(new CommandMenuParent(this, "^", getTemplateMenu()));
- }
- if(!getHashtagMenu().isEmpty())
- {
- list.add(new CommandMenuParent(this, "ŋߌnbV^O", getHashtagMenu()));
- }
- setTitle("cC[gj[");
- }
- return super.createMenuDialog();
- }
-
- private List<MenuCommand> getHashtagMenu()
+ private List<ICommand> getHashtagMenu()
{
- List<MenuCommand> list = new ArrayList<MenuCommand>();
+ List<ICommand> list = new ArrayList<ICommand>();
for(String hashtag : StatusStore.getHashtagList())
{
list.add(new CommandAppendHashtag(hashtag));
@@ -62,24 +34,58 @@ public class TweetMenu extends DialogAdapter
return list;
}
- private List<MenuCommand> getTemplateMenu()
+ private List<ICommand> getTemplateMenu()
{
- List<MenuCommand> list = new ArrayList<MenuCommand>();
+ List<ICommand> list = new ArrayList<ICommand>();
for(Template template : Templates.getTemplates())
{
list.add(new CommandInsertText(template.getText()));
}
return list;
}
-
- public static void init(Activity activity)
+
+ @Override
+ public List<List<ICommand>> getLists()
{
- instance = new TweetMenu(activity);
+ List<List<ICommand>> list = new ArrayList<List<ICommand>>();
+
+ //Basic
+ List<ICommand> basic = new ArrayList<ICommand>();
+ basic.add(new CommandInsertText("^"));
+ basic.add(new CommandParseMorse());
+ list.add(basic);
+
+ List<ICommand> template = getTemplateMenu();
+ if(!template.isEmpty())
+ {
+ list.add(template);
+ }
+
+ List<ICommand> hashtag = getHashtagMenu();
+ if(!hashtag.isEmpty())
+ {
+ list.add(hashtag);
+ }
+
+ return list;
}
-
- public static TweetMenu getInstance()
+
+ @Override
+ public List<String> getGroups()
{
- return instance;
+ List<String> list = new ArrayList<String>();
+ list.add("{");
+ List<ICommand> template = getTemplateMenu();
+ if(!template.isEmpty())
+ {
+ list.add("^");
+ }
+ List<ICommand> hashtag = getHashtagMenu();
+ if(!hashtag.isEmpty())
+ {
+ list.add("ŋߌnbV^O");
+ }
+ return list;
}
}
diff --git a/src/net/miz_hi/smileessence/menu/UserMenu.java b/src/net/miz_hi/smileessence/menu/UserMenu.java
index 1bf4aa98..f4bb312e 100644
--- a/src/net/miz_hi/smileessence/menu/UserMenu.java
+++ b/src/net/miz_hi/smileessence/menu/UserMenu.java
@@ -1,17 +1,21 @@
package net.miz_hi.smileessence.menu;
+import java.util.ArrayList;
+import java.util.List;
+
+import net.miz_hi.smileessence.command.ICommand;
import net.miz_hi.smileessence.command.user.UserCommandBlock;
import net.miz_hi.smileessence.command.user.UserCommandFollow;
import net.miz_hi.smileessence.command.user.UserCommandOpenFavstar;
import net.miz_hi.smileessence.command.user.UserCommandOpenPage;
+import net.miz_hi.smileessence.command.user.UserCommandOpenTimeline;
import net.miz_hi.smileessence.command.user.UserCommandRemove;
import net.miz_hi.smileessence.command.user.UserCommandSpam;
import net.miz_hi.smileessence.data.UserModel;
-import net.miz_hi.smileessence.dialog.DialogAdapter;
+import net.miz_hi.smileessence.dialog.SimpleMenuDialog;
import android.app.Activity;
-import android.app.Dialog;
-public class UserMenu extends DialogAdapter
+public class UserMenu extends SimpleMenuDialog
{
private String userName;
private boolean isMe;
@@ -21,24 +25,21 @@ public class UserMenu extends DialogAdapter
super(activity);
this.userName = model.screenName;
this.isMe = model.isMe();
+ setTitle("@" + userName);
}
@Override
- public Dialog createMenuDialog(boolean init)
+ public List<ICommand> getMenuList()
{
- if (init)
- {
- list.clear();
- list.add(new UserCommandOpenPage(activity, userName));
- list.add(new UserCommandOpenFavstar(activity, userName));
- list.add(new UserCommandFollow(userName));
- list.add(new UserCommandRemove(userName));
- list.add(new UserCommandBlock(userName));
- list.add(new UserCommandSpam(userName));
-
- setTitle("@" + userName);
- }
-
- return super.createMenuDialog();
+ List<ICommand> items = new ArrayList<ICommand>();
+
+ items.add(new UserCommandOpenTimeline(userName));
+ items.add(new UserCommandOpenPage(activity, userName));
+ items.add(new UserCommandOpenFavstar(activity, userName));
+ items.add(new UserCommandFollow(userName));
+ items.add(new UserCommandRemove(userName));
+ items.add(new UserCommandBlock(userName));
+ items.add(new UserCommandSpam(userName));
+ return items;
}
}
diff --git a/src/net/miz_hi/smileessence/permission/PermissonChecker.java b/src/net/miz_hi/smileessence/permission/PermissonChecker.java
index 2153d05f..c52aab1b 100644
--- a/src/net/miz_hi/smileessence/permission/PermissonChecker.java
+++ b/src/net/miz_hi/smileessence/permission/PermissonChecker.java
@@ -5,7 +5,7 @@ import java.util.concurrent.Future;
import net.miz_hi.smileessence.async.MyExecutor;
import net.miz_hi.smileessence.auth.Account;
-import net.miz_hi.smileessence.util.TwitterManager;
+import net.miz_hi.smileessence.twitter.TwitterManager;
import twitter4j.Relationship;
import twitter4j.User;
diff --git a/src/net/miz_hi/smileessence/preference/EnumPreferenceKey.java b/src/net/miz_hi/smileessence/preference/EnumPreferenceKey.java
index 51d20af9..15424dda 100644
--- a/src/net/miz_hi/smileessence/preference/EnumPreferenceKey.java
+++ b/src/net/miz_hi/smileessence/preference/EnumPreferenceKey.java
@@ -6,12 +6,13 @@ import net.miz_hi.smileessence.R;
public enum EnumPreferenceKey
{
LAST_USED_USER_ID(EnumValueType.LONG, "user_id", -1L),
+ VISIBLE_FOORER(EnumValueType.BOOLEAN, Client.getResource().getString(R.string.key_setting_footer), true),
TEXT_SIZE(EnumValueType.INTEGER, Client.getResource().getString(R.string.key_setting_textSize), 10),
AFTER_SUBMIT(EnumValueType.BOOLEAN, Client.getResource().getString(R.string.key_setting_aftersubmit), true),
NOTICE_UNFAV(EnumValueType.BOOLEAN, Client.getResource().getString(R.string.key_setting_notice_unfav), false),
OPEN_IME(EnumValueType.BOOLEAN, Client.getResource().getString(R.string.key_setting_open_ime), true),
CONFIRM_DIALOG(EnumValueType.BOOLEAN, Client.getResource().getString(R.string.key_setting_confirm_dialog),true),
-
+ READ_MORSE(EnumValueType.BOOLEAN, Client.getResource().getString(R.string.key_setting_morse), true);
;
private final EnumValueType type;
diff --git a/src/net/miz_hi/smileessence/status/StatusUtils.java b/src/net/miz_hi/smileessence/status/StatusUtils.java
index c8277285..179cea51 100644
--- a/src/net/miz_hi/smileessence/status/StatusUtils.java
+++ b/src/net/miz_hi/smileessence/status/StatusUtils.java
@@ -1,8 +1,14 @@
package net.miz_hi.smileessence.status;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.Future;
+
import net.miz_hi.smileessence.Client;
+import net.miz_hi.smileessence.async.MyExecutor;
import net.miz_hi.smileessence.data.StatusModel;
import net.miz_hi.smileessence.data.StatusStore;
+import net.miz_hi.smileessence.twitter.TwitterManager;
import twitter4j.Status;
import twitter4j.UserMentionEntity;
@@ -34,5 +40,38 @@ public class StatusUtils
{
return st.user.isMe();
}
+
+ public static StatusModel getOrCreateStatusModel(final long id)
+ {
+ StatusModel statusModel = StatusStore.get(id);
+ if(statusModel == null)
+ {
+ Future<Status> f = MyExecutor.submit(new Callable<Status>()
+ {
+
+ @Override
+ public Status call() throws Exception
+ {
+ return TwitterManager.getStatus(Client.getMainAccount(), id);
+ }
+ });
+ Status status;
+ try
+ {
+ status = f.get();
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ status = null;
+ }
+ if(status == null)
+ {
+ return null;
+ }
+ statusModel = StatusStore.put(status);
+ }
+ return statusModel;
+ }
}
diff --git a/src/net/miz_hi/smileessence/status/StatusViewFactory.java b/src/net/miz_hi/smileessence/status/StatusViewFactory.java
index 52c9e7d7..f8346ae9 100644
--- a/src/net/miz_hi/smileessence/status/StatusViewFactory.java
+++ b/src/net/miz_hi/smileessence/status/StatusViewFactory.java
@@ -5,6 +5,7 @@ import net.miz_hi.smileessence.R;
import net.miz_hi.smileessence.data.IconCaches;
import net.miz_hi.smileessence.data.StatusModel;
import net.miz_hi.smileessence.data.StatusStore;
+import net.miz_hi.smileessence.preference.EnumPreferenceKey;
import net.miz_hi.smileessence.util.Morse;
import android.view.LayoutInflater;
import android.view.View;
@@ -62,7 +63,7 @@ public class StatusViewFactory
viewHeader.setTextColor(model.nameColor);
viewHeader.setTextSize(textSize);
String text;
- if(Morse.isMorse(model.text))
+ if(Morse.isMorse(model.text) && Client.<Boolean>getPreferenceValue(EnumPreferenceKey.READ_MORSE))
{
text = model.text + "\n(" + Morse.mcToJa(model.text) + ")";
}
diff --git a/src/net/miz_hi/smileessence/system/MainSystem.java b/src/net/miz_hi/smileessence/system/MainSystem.java
index 8fba2c1b..89646469 100644
--- a/src/net/miz_hi/smileessence/system/MainSystem.java
+++ b/src/net/miz_hi/smileessence/system/MainSystem.java
@@ -9,29 +9,35 @@ import net.miz_hi.smileessence.async.AsyncTimelineGetter;
import net.miz_hi.smileessence.async.MyExecutor;
import net.miz_hi.smileessence.auth.Account;
import net.miz_hi.smileessence.auth.AuthentificationDB;
+import net.miz_hi.smileessence.auth.AuthorizeHelper;
+import net.miz_hi.smileessence.auth.Consumers;
+import net.miz_hi.smileessence.core.EnumRequestCode;
+import net.miz_hi.smileessence.core.Notifier;
import net.miz_hi.smileessence.data.IconCaches;
import net.miz_hi.smileessence.data.StatusModel;
import net.miz_hi.smileessence.data.StatusStore;
import net.miz_hi.smileessence.data.UserStore;
+import net.miz_hi.smileessence.data.page.Page;
+import net.miz_hi.smileessence.data.page.Pages;
+import net.miz_hi.smileessence.dialog.OneButtonDialog;
import net.miz_hi.smileessence.event.HistoryListAdapter;
import net.miz_hi.smileessence.listener.MyUserStreamListener;
-import net.miz_hi.smileessence.menu.MainMenu;
import net.miz_hi.smileessence.preference.EnumPreferenceKey;
import net.miz_hi.smileessence.status.StatusListAdapter;
-import net.miz_hi.smileessence.util.TwitterManager;
-import net.miz_hi.smileessence.view.HistoryListPageFragment;
-import net.miz_hi.smileessence.view.HomeListPageFragment;
-import net.miz_hi.smileessence.view.ListPagerAdapter;
+import net.miz_hi.smileessence.twitter.TwitterManager;
+import net.miz_hi.smileessence.util.NetworkUtils;
+import net.miz_hi.smileessence.view.ExtractFragment;
+import net.miz_hi.smileessence.view.IRemainable;
import net.miz_hi.smileessence.view.MainActivity;
-import net.miz_hi.smileessence.view.MentionsListPageFragment;
-import net.miz_hi.smileessence.view.RelationListPageFragment;
+import net.miz_hi.smileessence.view.RelationFragment;
import twitter4j.Paging;
import twitter4j.TwitterStream;
+import android.app.Activity;
+import android.content.Intent;
+import android.database.Cursor;
import android.net.Uri;
-import android.os.Handler;
-import android.support.v4.app.Fragment;
+import android.provider.MediaStore;
import android.support.v4.app.FragmentActivity;
-import android.support.v4.app.FragmentPagerAdapter;
public class MainSystem
{
@@ -39,67 +45,65 @@ public class MainSystem
private static MainSystem instance = new MainSystem();
private MyUserStreamListener usListener;
private TwitterStream twitterStream;
- public FragmentPagerAdapter pageAdapter;
public StatusListAdapter homeListAdapter;
public StatusListAdapter mentionsListAdapter;
- public StatusListAdapter relationListAdapter;
public HistoryListAdapter historyListAdapter;
- public Uri tempFilePath;
-
+ public StatusListAdapter extractListAdapter;
+ public AuthorizeHelper authHelper;
+ public Uri tempFilePath;
public static MainSystem getInstance()
{
return instance;
}
- public void start(FragmentActivity activity)
+ public void initialize(FragmentActivity activity)
{
homeListAdapter = new StatusListAdapter(activity);
mentionsListAdapter = new StatusListAdapter(activity);
historyListAdapter = new HistoryListAdapter(activity);
- relationListAdapter = new StatusListAdapter(activity);
-
- MainMenu.init(activity);
-
- Fragment[] fragments = new Fragment[4];
- fragments[0] = Fragment.instantiate(activity, HomeListPageFragment.class.getName());
- fragments[1] = Fragment.instantiate(activity, MentionsListPageFragment.class.getName());
- fragments[2] = Fragment.instantiate(activity, HistoryListPageFragment.class.getName());
- fragments[3] = Fragment.instantiate(activity, RelationListPageFragment.class.getName());
-
- pageAdapter = new ListPagerAdapter(activity.getSupportFragmentManager(), fragments);
+ extractListAdapter = new StatusListAdapter(activity);
}
- public void twitterSetup(Handler handler)
+ public void setup(Activity activity)
{
- long lastUsedId = (Long) Client.getPreferenceValue(EnumPreferenceKey.LAST_USED_USER_ID);
-
- for (Account account : AuthentificationDB.instance().findAll())
+ if (Client.hasAuthedAccount())
{
- if (account.getUserId() == lastUsedId)
+ long lastUsedId = (Long) Client.getPreferenceValue(EnumPreferenceKey.LAST_USED_USER_ID);
+
+ for (Account account : AuthentificationDB.instance().findAll())
{
- Client.setMainAccount(account);
- usListener = new MyUserStreamListener();
- usListener.setHomeListAdapter(homeListAdapter);
- usListener.setMentionsListAdapter(mentionsListAdapter);
- usListener.setEventListAdapter(historyListAdapter);
- usListener.setRelationListAdapter(relationListAdapter);
- twitterStream = TwitterManager.getTwitterStream(Client.getMainAccount());
- twitterStream.addListener(usListener);
- twitterStream.addConnectionLifeCycleListener(usListener);
- boolean canConnect = TwitterManager.canConnect();
-
- if(canConnect)
+ if (account.getUserId() == lastUsedId)
{
- if(!connectUserStream())
- {
- handler.sendEmptyMessage(MainActivity.HANDLER_NOT_CONNECTION);
- }
- else
- {
+ Client.setMainAccount(account);
+ break;
+ }
+ }
+ if(Client.getMainAccount() == null)
+ {
+ Client.setMainAccount(AuthentificationDB.instance().findAll().get(0));
+ }
+
+ loadRemainablePages();
+
+ usListener = new MyUserStreamListener();
+ usListener.setHomeAdapter(homeListAdapter);
+ usListener.setMentionsAdapter(mentionsListAdapter);
+ usListener.setHistoryAdapter(historyListAdapter);
+ twitterStream = TwitterManager.getTwitterStream(Client.getMainAccount());
+ twitterStream.addListener(usListener);
+ twitterStream.addConnectionLifeCycleListener(usListener);
+ if(connectUserStream(activity))
+ {
+ final Future<List<StatusModel>> resp_home = MyExecutor.submit(new AsyncTimelineGetter(Client.getMainAccount(), null));
+ final Future<List<StatusModel>> resp_mentions = MyExecutor.submit(new AsyncMentionsGetter(Client.getMainAccount(), new Paging(1)));
- final Future<List<StatusModel>> resp_home = MyExecutor.submit(new AsyncTimelineGetter(account, null));
- final Future<List<StatusModel>> resp_mentions = MyExecutor.submit(new AsyncMentionsGetter(account, new Paging(1)));
+ MyExecutor.execute(new Runnable()
+ {
+
+ @Override
+ public void run()
+ {
try
{
List<StatusModel> oldTimeline = resp_home.get();
@@ -109,41 +113,111 @@ public class MainSystem
homeListAdapter.forceNotifyAdapter();
mentionsListAdapter.forceNotifyAdapter();
historyListAdapter.forceNotifyAdapter();
- relationListAdapter.forceNotifyAdapter();
}
catch (Exception e)
{
e.printStackTrace();
+ Notifier.alert("^CC̎擾Ɏs܂");
}
}
- }
- else
+ });
+ }
+ else
+ {
+ Notifier.alert("ڑo܂");
+ }
+ }
+ else
+ {
+ authHelper = new AuthorizeHelper(activity, Consumers.getDedault());
+ //NOT AUTHOLIZED
+ OneButtonDialog.show(activity, "F؂Ă", "F؃y[Ww", new Runnable()
+ {
+
+ @Override
+ public void run()
{
- handler.sendEmptyMessage(MainActivity.HANDLER_NOT_CONNECTION);
+ authHelper.oauthSend();
}
-
- handler.sendEmptyMessage(MainActivity.HANDLER_SETUPED);
- return;
- }
+ });
+
}
}
- public void finish()
+ public void onDestroyed()
{
if (twitterStream != null)
{
twitterStream.shutdown();
twitterStream = null;
}
+ saveRamainablePages();
IconCaches.clearCache();
StatusStore.clearCache();
UserStore.clearCache();
MyExecutor.shutdown();
}
+
+ private void loadRemainablePages()
+ {
+ Pages.update();
+ for(Page page : Pages.getPages())
+ {
+ String className = page.getClassName();
+ if(className.equals(RelationFragment.class.getSimpleName()))
+ {
+ RelationFragment fragment = RelationFragment.newInstance(-1);
+ fragment.load(page.getData());
+ }
+ else if(className.equals(ExtractFragment.class.getSimpleName()))
+ {
+ ExtractFragment fragment = ExtractFragment.singleton();
+ fragment.load(page.getData());
+ }
+ }
+ }
+
+ private void saveRamainablePages()
+ {
+ Pages.clear();
+ for(Object element : MainActivity.getInstance().getFragmentAdapter().getList())
+ {
+ if(element instanceof IRemainable)
+ {
+ Pages.addPage(new Page(element.getClass().getSimpleName(), ((IRemainable) element).save()));
+ }
+ }
+ }
+
+ public void receivePicture(Activity activity, Intent data, int reqCode)
+ {
+ try
+ {
+ Uri uri;
+ if(reqCode == EnumRequestCode.PICTURE.ordinal())
+ {
+ uri = data.getData();
+ }
+ else
+ {
+ uri = MainSystem.getInstance().tempFilePath;
+ }
+ Cursor c = activity.getContentResolver().query(uri, null, null, null, null);
+ c.moveToFirst();
+ String path = c.getString(c.getColumnIndex(MediaStore.MediaColumns.DATA));
+ PostSystem.setPicturePath(path).openPostPage();
+ Notifier.info("摜Zbg܂");
+ }
+ catch(Exception e)
+ {
+ e.printStackTrace();
+ Notifier.alert("s܂");
+ }
+ }
- public boolean connectUserStream()
+ public boolean connectUserStream(Activity activity)
{
- if(!TwitterManager.canConnect())
+ if(!NetworkUtils.canConnect(activity))
{
return false;
}
@@ -154,12 +228,10 @@ public class MainSystem
}
return true;
}
-
- public void refreshLists()
+
+ public void authorize(Activity activity, Uri data)
{
- homeListAdapter.forceNotifyAdapter();
- mentionsListAdapter.forceNotifyAdapter();
- historyListAdapter.forceNotifyAdapter();
- pageAdapter.notifyDataSetChanged();
+ Account account = authHelper.oauthRecieve(data);
+ setup(activity);
}
}
diff --git a/src/net/miz_hi/smileessence/system/PostSystem.java b/src/net/miz_hi/smileessence/system/PostSystem.java
new file mode 100644
index 00000000..8aa3ebaf
--- /dev/null
+++ b/src/net/miz_hi/smileessence/system/PostSystem.java
@@ -0,0 +1,206 @@
+package net.miz_hi.smileessence.system;
+
+import java.io.File;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import net.miz_hi.smileessence.async.AsyncTweetTask;
+import net.miz_hi.smileessence.core.Notifier;
+import net.miz_hi.smileessence.data.StatusModel;
+import net.miz_hi.smileessence.status.StatusUtils;
+import net.miz_hi.smileessence.status.StatusViewFactory;
+import net.miz_hi.smileessence.util.LogHelper;
+import net.miz_hi.smileessence.util.UiHandler;
+import net.miz_hi.smileessence.view.MainActivity;
+import net.miz_hi.smileessence.view.PostFragment;
+import twitter4j.StatusUpdate;
+import android.text.TextUtils;
+import android.view.View;
+import android.widget.EditText;
+
+public class PostSystem
+{
+ public static PostSystem instance;
+ public String text = "";
+ public int cursor = 0;
+ private long inReplyTo = NONE_ID;
+ private String pictPath;
+ public static final long NONE_ID = -1;
+
+ static
+ {
+ instance = new PostSystem();
+ }
+
+ private PostSystem(){}
+
+ public static String getText()
+ {
+ return instance.text;
+ }
+
+ public static PostSystem setText(String text)
+ {
+ instance.text = text;
+ return instance;
+ }
+
+ public static PostSystem clearText()
+ {
+ return setText("");
+ }
+
+ public static PostSystem setCursor(int index)
+ {
+ instance.cursor = index;
+ return instance;
+ }
+
+ public static int getCursor()
+ {
+ return instance.cursor;
+ }
+
+ public static PostSystem appendText(String str)
+ {
+ setText(instance.text + str);
+ return instance;
+ }
+
+ public static PostSystem insertText(String str)
+ {
+ int cursor = instance.cursor;
+ StringBuilder sb = new StringBuilder(getText());
+ sb.insert(cursor, str);
+ cursor = cursor + sb.length();
+ if (cursor > sb.length())
+ {
+ cursor = sb.length();
+ }
+ setText(sb.toString());
+ setCursor(cursor);
+ return instance;
+ }
+
+ public static long getInReplyToStatusId()
+ {
+ return instance.inReplyTo;
+ }
+
+ public static PostSystem setInReplyToStatusId(long statusId)
+ {
+ instance.inReplyTo = statusId;
+ return instance;
+ }
+
+ public static PostSystem setReply(String userName)
+ {
+ return setReply(userName, NONE_ID);
+ }
+
+ public static PostSystem setReply(String userName, long statusId)
+ {
+ setText("@" + userName + " ");
+ setCursor(getText().length());
+ setInReplyToStatusId(statusId);
+ return instance;
+ }
+
+ public static PostSystem clearReply()
+ {
+ setInReplyToStatusId(NONE_ID);
+ return instance;
+ }
+
+ public static PostSystem addReply(String userName)
+ {
+ clearReply();
+ StringBuilder sb = new StringBuilder(getText());
+
+ if((sb.indexOf("@" + userName) != -1))
+ {
+ return instance;
+ }
+ else
+ {
+ sb.append(String.format("@%s ", userName));
+ }
+
+ if(sb.charAt(0) != '.')
+ {
+ sb.insert(0, ".");
+ }
+
+ setText(sb.toString());
+ return instance;
+ }
+
+ public static PostSystem setPicturePath(String path)
+ {
+ instance.pictPath = path;
+ return instance;
+ }
+
+ public static String getPicturePath()
+ {
+ return instance.pictPath;
+ }
+
+ public static PostSystem clearPicturePath()
+ {
+ return setPicturePath(null);
+ }
+
+ public static PostSystem clear()
+ {
+ clearText();
+ clearReply();
+ clearPicturePath();
+ return instance;
+ }
+
+ public static PostSystem submit(String text)
+ {
+ if (TextUtils.isEmpty(text) && getPicturePath() == null)
+ {
+ Notifier.alert("͂Ă");
+ }
+ else
+ {
+ final StatusUpdate update = new StatusUpdate(text);
+ if (getInReplyToStatusId() >= 0)
+ {
+ update.setInReplyToStatusId(getInReplyToStatusId());
+ }
+ if(getPicturePath() != null)
+ {
+ update.setMedia(new File(getPicturePath()));
+ }
+ new UiHandler()
+ {
+
+ @Override
+ public void run()
+ {
+ new AsyncTweetTask(update).addToQueue();
+ clear();
+ }
+ }.postDelayed(10);
+ }
+ return instance;
+ }
+
+ public static void openPostPage()
+ {
+ new UiHandler()
+ {
+
+ @Override
+ public void run()
+ {
+ MainActivity.moveViewPage(MainActivity.PAGE_POST);
+ PostFragment.singleton().load();
+ }
+ }.post();
+ }
+}
diff --git a/src/net/miz_hi/smileessence/system/RelationSystem.java b/src/net/miz_hi/smileessence/system/RelationSystem.java
new file mode 100644
index 00000000..95a0d6f1
--- /dev/null
+++ b/src/net/miz_hi/smileessence/system/RelationSystem.java
@@ -0,0 +1,113 @@
+package net.miz_hi.smileessence.system;
+
+import java.util.Collection;
+import java.util.HashMap;
+
+import net.miz_hi.smileessence.async.MyExecutor;
+import net.miz_hi.smileessence.data.StatusModel;
+import net.miz_hi.smileessence.data.StatusStore;
+import net.miz_hi.smileessence.status.StatusListAdapter;
+import net.miz_hi.smileessence.status.StatusUtils;
+import net.miz_hi.smileessence.view.MainActivity;
+import net.miz_hi.smileessence.view.RelationFragment;
+
+public class RelationSystem
+{
+
+ private static final RelationSystem singleton = new RelationSystem();
+
+ private HashMap<RelationFragment, StatusListAdapter> relFragments = new HashMap<RelationFragment, StatusListAdapter>();
+
+ public static RelationSystem singleton()
+ {
+ return singleton;
+ }
+
+ public static StatusListAdapter getAdapter(RelationFragment relFragment)
+ {
+ return singleton.relFragments.get(relFragment);
+ }
+
+ public static Collection<StatusListAdapter> getAdapters()
+ {
+ return singleton.relFragments.values();
+ }
+
+ public static StatusListAdapter getAdapter(long id)
+ {
+ return getAdapter(getRelationByChasingId(id));
+ }
+
+ public static boolean isChasing()
+ {
+ return !singleton.relFragments.isEmpty();
+ }
+
+ public static void startRelation(final RelationFragment fragment)
+ {
+ if(getAdapter(fragment) == null)
+ {
+ StatusListAdapter adapter = new StatusListAdapter(MainActivity.getInstance());
+ singleton.relFragments.put(fragment, adapter);
+ }
+
+ MyExecutor.execute(new Runnable()
+ {
+
+ @Override
+ public void run()
+ {
+ StatusListAdapter adapter = RelationSystem.getAdapter(fragment);
+ adapter.clear();
+ StatusModel status = StatusUtils.getOrCreateStatusModel(fragment.getChasingId());
+ adapter.addFirst(status);
+ long id = status.statusId;
+ //
+ for(StatusModel status1: StatusStore.getList())
+ {
+ if(status1.inReplyToStatusId == id)
+ {
+ adapter.addFirst(status1);
+ id = status1.statusId;
+ continue;
+ }
+ }
+ fragment.setChasingId(id);
+ //ߋ
+ id = status.inReplyToStatusId;
+ while(id > -1)
+ {
+ StatusModel statusModel1 = StatusUtils.getOrCreateStatusModel(id);
+ if(statusModel1 != null)
+ {
+ adapter.addLast(statusModel1);
+ adapter.forceNotifyAdapter();
+ }
+ else
+ {
+ break;
+ }
+ id = statusModel1.inReplyToStatusId;
+ }
+ }
+ });
+ }
+
+ public static void stopRelation(RelationFragment fragment)
+ {
+ singleton.relFragments.remove(fragment);
+ }
+
+ public static RelationFragment getRelationByChasingId(long id)
+ {
+ for(RelationFragment rel : singleton.relFragments.keySet())
+ {
+ if(rel.getChasingId() == id)
+ {
+ return rel;
+ }
+ }
+ return null;
+ }
+
+}
diff --git a/src/net/miz_hi/smileessence/system/TweetSystem.java b/src/net/miz_hi/smileessence/system/TweetSystem.java
deleted file mode 100644
index 93840014..00000000
--- a/src/net/miz_hi/smileessence/system/TweetSystem.java
+++ /dev/null
@@ -1,171 +0,0 @@
-package net.miz_hi.smileessence.system;
-
-import java.io.File;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import net.miz_hi.smileessence.async.AsyncTweetTask;
-import net.miz_hi.smileessence.data.StatusModel;
-import net.miz_hi.smileessence.data.StatusStore;
-import net.miz_hi.smileessence.event.ToastManager;
-import net.miz_hi.smileessence.menu.TweetMenu;
-import net.miz_hi.smileessence.util.StringUtils;
-import net.miz_hi.smileessence.util.UiHandler;
-import net.miz_hi.smileessence.view.TweetView;
-import twitter4j.StatusUpdate;
-import android.app.Activity;
-import android.widget.EditText;
-
-public class TweetSystem
-{
- private static TweetSystem instance = new TweetSystem();
-
- private long inReplyTo = NONE_ID;
- private String text = "";
- private File pathPict;
- public static final long NONE_ID = -1;
-
- public static void start(Activity activity)
- {
- TweetMenu.init(activity);
- }
-
- public static String getText()
- {
- return instance.text;
- }
-
- public static void setText(String text)
- {
- instance.text = text;
- TweetView view = TweetView.getInstance();
- EditText edit = view.getEditTextTweet();
- edit.setText(text);
- edit.setSelection(text.length());
- }
-
- public static void setCursor(int index)
- {
- TweetView view = TweetView.getInstance();
- EditText edit = view.getEditTextTweet();
- edit.setSelection(index);
- }
-
- public static void appendText(String str)
- {
- setText(getText() + str);
- }
-
- public static void insertText(String str)
- {
- int cursor = TweetView.getInstance().getCursor();
- StringBuilder sb = new StringBuilder(getText());
- sb.insert(cursor, str);
- cursor = cursor + sb.length();
- if (cursor > sb.length())
- {
- cursor = sb.length();
- }
- setText(sb.toString());
- setCursor(cursor);
- }
-
- public static long getInReplyStatusId()
- {
- return instance.inReplyTo;
- }
-
- public static void setInReplyToStatusId(long statusId)
- {
- instance.inReplyTo = statusId;
- }
-
- public static void setReply(String userName, long statusId)
- {
- if(statusId != NONE_ID)
- {
- StatusModel model = StatusStore.get(statusId);
- if(model != null)
- {
- TweetView.getInstance().setInReplyToStatus(model);
- }
- }
- setText("@" + userName + " ");
- setInReplyToStatusId(statusId);
- }
-
- public static void addReply(String userName)
- {
- setInReplyToStatusId(NONE_ID);
- Pattern pattern = Pattern.compile("@"+ userName);
- Matcher hasReply = pattern.matcher(getText());
- StringBuilder sb = new StringBuilder(getText());
-
- if(hasReply.find())
- {
- return;
- }
- else
- {
- sb.append(String.format("@%s ", userName));
- }
-
- if(!getText().startsWith("."))
- {
- sb.insert(0, ".");
- }
-
- setText(sb.toString());
- TweetView.getInstance().removeReply();
- }
-
- public static void setPicturePath(File path)
- {
- instance.pathPict = path;
- TweetView.getInstance().setPictureImage(instance.pathPict);
- }
-
- public static File getPicturePath()
- {
- return instance.pathPict;
- }
-
- public static void clear()
- {
- setText("");
- TweetView.getInstance().removeReply();
- setPicturePath(null);
- setInReplyToStatusId(NONE_ID);
- }
-
- public static void submit()
- {
- if (StringUtils.isNullOrEmpty(getText()) && getPicturePath() == null)
- {
- ToastManager.toast("͂Ă");
- }
- else
- {
-
- final StatusUpdate update = new StatusUpdate(getText());
- if (getInReplyStatusId() >= 0)
- {
- update.setInReplyToStatusId(getInReplyStatusId());
- }
- if(getPicturePath() != null)
- {
- update.setMedia(getPicturePath());
- }
- new UiHandler()
- {
-
- @Override
- public void run()
- {
- new AsyncTweetTask(update).addToQueue();
- clear();
- }
- }.postDelayed(10);
- }
- }
-}
diff --git a/src/net/miz_hi/smileessence/util/TwitterManager.java b/src/net/miz_hi/smileessence/twitter/TwitterManager.java
index 11de771b..658840f0 100644
--- a/src/net/miz_hi/smileessence/util/TwitterManager.java
+++ b/src/net/miz_hi/smileessence/twitter/TwitterManager.java
@@ -1,11 +1,16 @@
-package net.miz_hi.smileessence.util;
+package net.miz_hi.smileessence.twitter;
import java.util.LinkedList;
import java.util.List;
+import java.util.concurrent.Callable;
+import java.util.concurrent.Future;
import net.miz_hi.smileessence.Client;
+import net.miz_hi.smileessence.async.MyExecutor;
import net.miz_hi.smileessence.auth.Account;
-import net.miz_hi.smileessence.event.ToastManager;
+import net.miz_hi.smileessence.core.Notifier;
+import net.miz_hi.smileessence.util.CountUpInteger;
+import net.miz_hi.smileessence.util.StringUtils;
import twitter4j.Paging;
import twitter4j.Relationship;
import twitter4j.ResponseList;
@@ -69,19 +74,6 @@ public class TwitterManager
cb.setUserStreamRepliesAllEnabled(false);
return new TwitterStreamFactory(cb.build()).getInstance();
}
-
- public static boolean canConnect()
- {
- try
- {
- String screenName = getTwitter(Client.getMainAccount()).getScreenName();
- return true;
- }
- catch(Exception e)
- {
- return false;
- }
- }
public static boolean isStatusUpdateLimit()
{
@@ -131,7 +123,7 @@ public class TwitterManager
else if (message.equals(ERROR_STATUS_LIMIT))
{
isStatusUpdateLimit = true;
- ToastManager.toast("規制されています");
+ Notifier.alert("規制されています");
}
}
}
diff --git a/src/net/miz_hi/smileessence/util/ExtendedBoolean.java b/src/net/miz_hi/smileessence/util/ExtendedBoolean.java
deleted file mode 100644
index 5d980c81..00000000
--- a/src/net/miz_hi/smileessence/util/ExtendedBoolean.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package net.miz_hi.smileessence.util;
-
-public class ExtendedBoolean
-{
- private boolean flag;
- private boolean initialized = false;
-
- public ExtendedBoolean()
- {
- this.flag = false;
- }
-
- public ExtendedBoolean(boolean flag)
- {
- this.flag = flag;
- initialized = true;
- }
-
- public boolean get()
- {
- return flag;
- }
-
- public boolean toggle()
- {
- flag = !flag;
- initialized = true;
- return flag;
- }
-
- public boolean set(boolean newValue)
- {
- this.flag = newValue;
- initialized = true;
- return flag;
- }
-
- public boolean isInitialized()
- {
- return initialized;
- }
-
-}
diff --git a/src/net/miz_hi/smileessence/util/LogHelper.java b/src/net/miz_hi/smileessence/util/LogHelper.java
index 21314d76..bb2890be 100644
--- a/src/net/miz_hi/smileessence/util/LogHelper.java
+++ b/src/net/miz_hi/smileessence/util/LogHelper.java
@@ -5,7 +5,7 @@ import android.util.Log;
public class LogHelper
{
- public static void printD(Object obj)
+ public static void d(Object obj)
{
Log.d("SE", obj.toString());
}
diff --git a/src/net/miz_hi/smileessence/util/NamedFragment.java b/src/net/miz_hi/smileessence/util/NamedFragment.java
new file mode 100644
index 00000000..a35358f1
--- /dev/null
+++ b/src/net/miz_hi/smileessence/util/NamedFragment.java
@@ -0,0 +1,24 @@
+package net.miz_hi.smileessence.util;
+
+import android.os.Bundle;
+import android.support.v4.app.Fragment;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+public abstract class NamedFragment extends Fragment
+{
+
+ @Override
+ public void onCreate(Bundle savedInstanceState)
+ {
+ super.onCreate(savedInstanceState);
+ setRetainInstance(true);
+ }
+
+ public abstract String getTitle();
+
+ @Override
+ public abstract View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState);
+
+}
diff --git a/src/net/miz_hi/smileessence/util/NamedFragmentPagerAdapter.java b/src/net/miz_hi/smileessence/util/NamedFragmentPagerAdapter.java
new file mode 100644
index 00000000..d082ee27
--- /dev/null
+++ b/src/net/miz_hi/smileessence/util/NamedFragmentPagerAdapter.java
@@ -0,0 +1,143 @@
+package net.miz_hi.smileessence.util;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+
+import net.miz_hi.smileessence.view.IRemovable;
+import android.support.v4.app.Fragment;
+import android.support.v4.app.FragmentManager;
+import android.support.v4.app.FragmentStatePagerAdapter;
+
+public class NamedFragmentPagerAdapter extends FragmentStatePagerAdapter
+{
+
+ private NamedFragment[] pageArray;
+ private int count;
+ private ArrayList<NamedFragment> pageList = new ArrayList<NamedFragment>();
+ private boolean canMotifyOnChange = true;
+
+ public NamedFragmentPagerAdapter(FragmentManager fm, Collection<NamedFragment> fragments)
+ {
+ super(fm);
+ pageList.addAll(fragments);
+ forceNotifyAdapter();
+ }
+
+ public NamedFragmentPagerAdapter(FragmentManager fm)
+ {
+ super(fm);
+ forceNotifyAdapter();
+ }
+
+ @Override
+ public synchronized CharSequence getPageTitle(int position)
+ {
+ return pageArray[position].getTitle();
+ }
+
+ @Override
+ public synchronized int getCount()
+ {
+ return count;
+ }
+
+ public NamedFragment[] getList()
+ {
+ forceNotifyAdapter();
+ return Arrays.copyOf(pageArray, pageArray.length);
+ }
+
+ public synchronized int add(NamedFragment element)
+ {
+ if (pageList.contains(element))
+ {
+ pageList.remove(element);
+ }
+ pageList.add(element);
+ notifyAdapter();
+ return pageList.indexOf(element);
+ }
+
+ public synchronized void add(NamedFragment element, int index)
+ {
+ if (pageList.contains(element))
+ {
+ pageList.remove(element);
+ }
+ pageList.add(index, element);
+ notifyAdapter();
+ }
+
+ public synchronized void remove(NamedFragment element)
+ {
+ pageList.remove(element);
+ if(element instanceof IRemovable)
+ {
+ ((IRemovable)element).onRemoved();
+ }
+ notifyAdapter();
+ }
+
+ public synchronized void remove(int i)
+ {
+ NamedFragment fragment = pageList.remove(i);
+ remove(fragment);
+ }
+
+ public synchronized void notifyAdapter()
+ {
+ if (canMotifyOnChange)
+ {
+ forceNotifyAdapter();
+ }
+ }
+
+ public synchronized void forceNotifyAdapter()
+ {
+ pageArray = (NamedFragment[]) pageList.toArray(new NamedFragment[]{});
+ count = pageArray.length;
+ notifyDataSetChanged();
+ }
+
+ public synchronized void setCanNotifyOnChange(boolean notifyOnChange)
+ {
+ canMotifyOnChange = notifyOnChange;
+ }
+
+ public synchronized boolean getCanNotifyOnChange()
+ {
+ return canMotifyOnChange;
+ }
+
+ @Override
+ public Fragment getItem(int position)
+ {
+ if(pageArray != null && pageArray.length >= position)
+ {
+ return pageArray[position];
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ @Override
+ public int getItemPosition(Object object)
+ {
+ int index = -1;
+ for(int i = 0;i < pageArray.length; i++)
+ {
+ Object element = pageArray[i];
+ if(element == object)
+ {
+ index = i;
+ break;
+ }
+ }
+ return index != -1 ? index : POSITION_NONE;
+ }
+
+}
diff --git a/src/net/miz_hi/smileessence/util/NetworkUtils.java b/src/net/miz_hi/smileessence/util/NetworkUtils.java
new file mode 100644
index 00000000..b735b92f
--- /dev/null
+++ b/src/net/miz_hi/smileessence/util/NetworkUtils.java
@@ -0,0 +1,22 @@
+package net.miz_hi.smileessence.util;
+
+import android.app.Activity;
+import android.net.ConnectivityManager;
+import android.net.NetworkInfo;
+
+public class NetworkUtils
+{
+ public static boolean canConnect(Activity activity)
+ {
+ ConnectivityManager cm = (ConnectivityManager) activity.getSystemService(Activity.CONNECTIVITY_SERVICE);
+ NetworkInfo info = cm.getActiveNetworkInfo();
+ if(info != null && info.isConnected())
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+}
diff --git a/src/net/miz_hi/smileessence/view/DirectMessageFragment.java b/src/net/miz_hi/smileessence/view/DirectMessageFragment.java
new file mode 100644
index 00000000..174df7c5
--- /dev/null
+++ b/src/net/miz_hi/smileessence/view/DirectMessageFragment.java
@@ -0,0 +1,26 @@
+package net.miz_hi.smileessence.view;
+
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import net.miz_hi.smileessence.util.NamedFragment;
+
+public class DirectMessageFragment extends NamedFragment
+{
+
+ @Override
+ public String getTitle()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
diff --git a/src/net/miz_hi/smileessence/view/ExtraWordActivity.java b/src/net/miz_hi/smileessence/view/ExtraWordActivity.java
index 5570a052..c9dd0461 100644
--- a/src/net/miz_hi/smileessence/view/ExtraWordActivity.java
+++ b/src/net/miz_hi/smileessence/view/ExtraWordActivity.java
@@ -4,7 +4,7 @@ import net.miz_hi.smileessence.R;
import net.miz_hi.smileessence.data.extra.ExtraWord;
import net.miz_hi.smileessence.data.extra.ExtraWordListAdapter;
import net.miz_hi.smileessence.data.extra.ExtraWords;
-import net.miz_hi.smileessence.dialog.YesNoDialogHelper;
+import net.miz_hi.smileessence.dialog.ContentDialog;
import android.app.Activity;
import android.content.DialogInterface;
import android.os.Bundle;
@@ -13,6 +13,7 @@ import android.view.View.OnClickListener;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.ListView;
+import android.widget.TextView;
public class ExtraWordActivity extends Activity
{
@@ -21,10 +22,12 @@ public class ExtraWordActivity extends Activity
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
- setContentView(R.layout.extrawordactivity_layout);
+ setContentView(R.layout.listedit_layout);
- ListView listView = (ListView)findViewById(R.id.listView_extraword);
- ImageButton buttonAdd = (ImageButton)findViewById(R.id.imageButton_extraword_add);
+ TextView titleView = (TextView)findViewById(R.id.listedit_title);
+ titleView.setText("o[h̊Ǘ");
+ ListView listView = (ListView)findViewById(R.id.listedit_listview);
+ ImageButton buttonAdd = (ImageButton)findViewById(R.id.listedit_addbutton);
final ExtraWordListAdapter adapter = new ExtraWordListAdapter(this);
listView.setAdapter(adapter);
adapter.addAll(ExtraWords.getExtraWords());
@@ -36,9 +39,9 @@ public class ExtraWordActivity extends Activity
public void onClick(View v)
{
final EditText editText = new EditText(ExtraWordActivity.this);
- YesNoDialogHelper helper = new YesNoDialogHelper(ExtraWordActivity.this, "ҏW");
- helper.setContentView(editText);
- helper.setOnClickListener(new DialogInterface.OnClickListener()
+ ContentDialog dialog = new ContentDialog(ExtraWordActivity.this, "ҏW");
+ dialog.setContentView(editText);
+ dialog.setOnClickListener(new DialogInterface.OnClickListener()
{
@Override
@@ -64,9 +67,9 @@ public class ExtraWordActivity extends Activity
}
}
});
- helper.setTextPositive("");
- helper.setTextNegative("LZ");
- helper.createYesNoAlert().show();
+ dialog.setTextPositive("");
+ dialog.setTextNegative("LZ");
+ dialog.create().show();
}
});
}
diff --git a/src/net/miz_hi/smileessence/view/ExtractFragment.java b/src/net/miz_hi/smileessence/view/ExtractFragment.java
new file mode 100644
index 00000000..ed977e52
--- /dev/null
+++ b/src/net/miz_hi/smileessence/view/ExtractFragment.java
@@ -0,0 +1,79 @@
+package net.miz_hi.smileessence.view;
+
+import android.annotation.SuppressLint;
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.ViewGroup.LayoutParams;
+import android.widget.ListView;
+import android.widget.ProgressBar;
+import net.miz_hi.smileessence.R;
+import net.miz_hi.smileessence.listener.TimelineScrollListener;
+import net.miz_hi.smileessence.status.StatusListAdapter;
+import net.miz_hi.smileessence.system.MainSystem;
+import net.miz_hi.smileessence.util.NamedFragment;
+
+@SuppressLint("ValidFragment")
+public class ExtractFragment extends NamedFragment implements IRemovable, IRemainable
+{
+
+ public static ExtractFragment singleton = new ExtractFragment();
+ public static boolean isShowing;
+
+ private ExtractFragment()
+ {
+ }
+
+ public static ExtractFragment singleton()
+ {
+ return singleton;
+ }
+
+ @Override
+ public String getTitle()
+ {
+ return "Extracted Tweets";
+ }
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
+ {
+ View page = inflater.inflate(R.layout.listpage_layout, container, false);
+ ListView listView = (ListView)page.findViewById(R.id.listpage_listview);
+ listView.setFastScrollEnabled(true);
+ StatusListAdapter adapter = getAdapter();
+ listView.setAdapter(adapter);
+ listView.setOnScrollListener(new TimelineScrollListener(adapter));
+ isShowing = true;
+ return page;
+ }
+
+ public StatusListAdapter getAdapter()
+ {
+ return MainSystem.getInstance().extractListAdapter;
+ }
+
+ @Override
+ public String save()
+ {
+ return String.valueOf(isShowing);
+ }
+
+ @Override
+ public void load(String data)
+ {
+ isShowing = Boolean.parseBoolean(data);
+ if(isShowing)
+ {
+ MainActivity.addPage(singleton);
+ }
+ }
+
+ @Override
+ public void onRemoved()
+ {
+ isShowing = false;
+ }
+
+}
diff --git a/src/net/miz_hi/smileessence/view/HistoryListPageFragment.java b/src/net/miz_hi/smileessence/view/HistoryFragment.java
index af5c5b5e..4495bf99 100644
--- a/src/net/miz_hi/smileessence/view/HistoryListPageFragment.java
+++ b/src/net/miz_hi/smileessence/view/HistoryFragment.java
@@ -1,37 +1,39 @@
package net.miz_hi.smileessence.view;
-import net.miz_hi.smileessence.Client;
import net.miz_hi.smileessence.R;
import net.miz_hi.smileessence.listener.TimelineScrollListener;
import net.miz_hi.smileessence.system.MainSystem;
+import net.miz_hi.smileessence.util.NamedFragment;
+import android.annotation.SuppressLint;
import android.os.Bundle;
-import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
+import android.widget.LinearLayout;
import android.widget.ListView;
-import android.widget.RelativeLayout;
-import android.widget.TextView;
+import android.widget.ProgressBar;
-public class HistoryListPageFragment extends Fragment
+public class HistoryFragment extends NamedFragment
{
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
-
- RelativeLayout page = (RelativeLayout) inflater.inflate(R.layout.listpage_layout, container, false);
-
- TextView textView = (TextView)page.findViewById(R.id.textView_listpage);
- ListView listView = (ListView)page.findViewById(R.id.listView_listpage);
-
- textView.setTextSize(Client.getTextSize() + 3);
+ LinearLayout page = (LinearLayout) inflater.inflate(R.layout.listpage_layout, container, false);
+ ListView listView = (ListView)page.findViewById(R.id.listpage_listview);
+ ProgressBar progress = new ProgressBar(getActivity());
+ listView.setEmptyView(progress);
listView.setFastScrollEnabled(true);
- textView.setText("History");
listView.setAdapter(MainSystem.getInstance().historyListAdapter);
listView.setOnScrollListener(new TimelineScrollListener(MainSystem.getInstance().historyListAdapter));
return page;
}
+ @Override
+ public String getTitle()
+ {
+ return "History";
+ }
+
}
diff --git a/src/net/miz_hi/smileessence/view/HomeFragment.java b/src/net/miz_hi/smileessence/view/HomeFragment.java
new file mode 100644
index 00000000..fdc3d66d
--- /dev/null
+++ b/src/net/miz_hi/smileessence/view/HomeFragment.java
@@ -0,0 +1,45 @@
+package net.miz_hi.smileessence.view;
+
+import net.miz_hi.smileessence.R;
+import net.miz_hi.smileessence.core.Notifier;
+import net.miz_hi.smileessence.listener.TimelineScrollListener;
+import net.miz_hi.smileessence.system.MainSystem;
+import net.miz_hi.smileessence.util.LogHelper;
+import net.miz_hi.smileessence.util.NamedFragment;
+import android.annotation.SuppressLint;
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.ViewGroup.LayoutParams;
+import android.widget.LinearLayout;
+import android.widget.ListView;
+import android.widget.ProgressBar;
+
+public class HomeFragment extends NamedFragment
+{
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
+ {
+ LinearLayout page = (LinearLayout) inflater.inflate(R.layout.listpage_layout, container, false);
+ ListView listView = (ListView)page.findViewById(R.id.listpage_listview);
+ ProgressBar progress = new ProgressBar(getActivity());
+ progress.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
+ progress.setVisibility(View.GONE);
+ ((ViewGroup)listView.getParent()).addView(progress);
+ listView.setEmptyView(progress);
+ listView.setFastScrollEnabled(true);
+ listView.setAdapter(MainSystem.getInstance().homeListAdapter);
+ listView.setOnScrollListener(new TimelineScrollListener(MainSystem.getInstance().homeListAdapter));
+ listView.destroyDrawingCache();
+ return page;
+ }
+
+ @Override
+ public String getTitle()
+ {
+ return "Home";
+ }
+
+}
diff --git a/src/net/miz_hi/smileessence/view/HomeListPageFragment.java b/src/net/miz_hi/smileessence/view/HomeListPageFragment.java
deleted file mode 100644
index 5f03e1f6..00000000
--- a/src/net/miz_hi/smileessence/view/HomeListPageFragment.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package net.miz_hi.smileessence.view;
-
-import net.miz_hi.smileessence.Client;
-import net.miz_hi.smileessence.R;
-import net.miz_hi.smileessence.listener.TimelineScrollListener;
-import net.miz_hi.smileessence.system.MainSystem;
-import android.os.Bundle;
-import android.support.v4.app.Fragment;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.ListView;
-import android.widget.RelativeLayout;
-import android.widget.TextView;
-
-public class HomeListPageFragment extends Fragment
-{
-
- @Override
- public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
- {
-
- RelativeLayout page = (RelativeLayout) inflater.inflate(R.layout.listpage_layout, container, false);
-
- TextView textView = (TextView)page.findViewById(R.id.textView_listpage);
- ListView listView = (ListView)page.findViewById(R.id.listView_listpage);
-
- textView.setTextSize(Client.getTextSize() + 3);
- listView.setFastScrollEnabled(true);
- textView.setText("Home");
- listView.setAdapter(MainSystem.getInstance().homeListAdapter);
- listView.setOnScrollListener(new TimelineScrollListener(MainSystem.getInstance().homeListAdapter));
-
- return page;
- }
-
-}
diff --git a/src/net/miz_hi/smileessence/view/IRemainable.java b/src/net/miz_hi/smileessence/view/IRemainable.java
new file mode 100644
index 00000000..ab394fcc
--- /dev/null
+++ b/src/net/miz_hi/smileessence/view/IRemainable.java
@@ -0,0 +1,10 @@
+package net.miz_hi.smileessence.view;
+
+import java.util.Map;
+
+public interface IRemainable
+{
+ String save();
+
+ void load(String data);
+}
diff --git a/src/net/miz_hi/smileessence/view/IRemovable.java b/src/net/miz_hi/smileessence/view/IRemovable.java
new file mode 100644
index 00000000..f63fd32b
--- /dev/null
+++ b/src/net/miz_hi/smileessence/view/IRemovable.java
@@ -0,0 +1,6 @@
+package net.miz_hi.smileessence.view;
+
+public interface IRemovable
+{
+ void onRemoved();
+}
diff --git a/src/net/miz_hi/smileessence/view/ListFragment.java b/src/net/miz_hi/smileessence/view/ListFragment.java
new file mode 100644
index 00000000..a3669ca1
--- /dev/null
+++ b/src/net/miz_hi/smileessence/view/ListFragment.java
@@ -0,0 +1,26 @@
+package net.miz_hi.smileessence.view;
+
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import net.miz_hi.smileessence.util.NamedFragment;
+
+public class ListFragment extends NamedFragment
+{
+
+ @Override
+ public String getTitle()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
diff --git a/src/net/miz_hi/smileessence/view/ListPagerAdapter.java b/src/net/miz_hi/smileessence/view/ListPagerAdapter.java
deleted file mode 100644
index 437819e3..00000000
--- a/src/net/miz_hi/smileessence/view/ListPagerAdapter.java
+++ /dev/null
@@ -1,103 +0,0 @@
-package net.miz_hi.smileessence.view;
-
-import java.util.List;
-
-import net.miz_hi.smileessence.util.UiHandler;
-
-import android.support.v4.app.Fragment;
-import android.support.v4.app.FragmentManager;
-import android.support.v4.app.FragmentPagerAdapter;
-
-public class ListPagerAdapter extends FragmentPagerAdapter
-{
-
- private Fragment[] pageArray;
- private List<Fragment> pageList;
- private boolean canMotifyOnChange = true;
-
- public ListPagerAdapter(FragmentManager fm, Fragment... fragments)
- {
- super(fm);
- pageArray = fragments;
- }
-
- @Override
- public int getCount()
- {
- return pageArray.length;
- }
-
- public synchronized void add(Fragment element)
- {
- if (pageList.contains(element))
- {
- pageList.remove(element);
- }
- pageList.add(element);
- notifyAdapter();
- }
-
- public synchronized void remove(Fragment element)
- {
- pageList.remove(element);
- notifyAdapter();
- }
-
- public void notifyAdapter()
- {
- if (canMotifyOnChange)
- {
- new UiHandler()
- {
-
- @Override
- public void run()
- {
- pageArray = (Fragment[]) pageList.toArray();
- notifyDataSetChanged();
- }
- }.post();
- }
- }
-
- public synchronized void forceNotifyAdapter()
- {
- new UiHandler()
- {
- @Override
- public void run()
- {
- notifyDataSetChanged();
- }
- }.post();
- }
-
- public synchronized void setCanNotifyOnChange(boolean notifyOnChange)
- {
- canMotifyOnChange = notifyOnChange;
- }
-
- public synchronized boolean getCanNotifyOnChange()
- {
- return canMotifyOnChange;
- }
-
- @Override
- public Fragment getItem(int position)
- {
- if(pageArray != null && pageArray.length >= position)
- {
- return pageArray[position];
- }
- else
- {
- return null;
- }
- }
-
- @Override
- public int getItemPosition(Object object)
- {
- return super.POSITION_NONE;
- }
-}
diff --git a/src/net/miz_hi/smileessence/view/MainActivity.java b/src/net/miz_hi/smileessence/view/MainActivity.java
index 4c6db02c..0743ff36 100644
--- a/src/net/miz_hi/smileessence/view/MainActivity.java
+++ b/src/net/miz_hi/smileessence/view/MainActivity.java
@@ -1,202 +1,183 @@
package net.miz_hi.smileessence.view;
-import java.io.File;
+import java.util.Arrays;
+import java.util.List;
import net.miz_hi.smileessence.Client;
import net.miz_hi.smileessence.R;
-import net.miz_hi.smileessence.async.MyExecutor;
-import net.miz_hi.smileessence.auth.Account;
-import net.miz_hi.smileessence.auth.AuthorizeHelper;
-import net.miz_hi.smileessence.auth.Consumers;
import net.miz_hi.smileessence.core.EnumRequestCode;
-import net.miz_hi.smileessence.dialog.AuthDialogHelper;
-import net.miz_hi.smileessence.dialog.DialogAdapter;
-import net.miz_hi.smileessence.dialog.ProgressDialogHelper;
-import net.miz_hi.smileessence.dialog.YesNoDialogHelper;
-import net.miz_hi.smileessence.event.ToastManager;
+import net.miz_hi.smileessence.dialog.ConfirmDialog;
+import net.miz_hi.smileessence.listener.PageChangeListener;
import net.miz_hi.smileessence.menu.MainMenu;
-import net.miz_hi.smileessence.menu.TweetMenu;
import net.miz_hi.smileessence.preference.EnumPreferenceKey;
import net.miz_hi.smileessence.system.MainSystem;
-import net.miz_hi.smileessence.system.TweetSystem;
+import net.miz_hi.smileessence.system.PostSystem;
import net.miz_hi.smileessence.util.LogHelper;
+import net.miz_hi.smileessence.util.NamedFragment;
+import net.miz_hi.smileessence.util.NamedFragmentPagerAdapter;
+import net.miz_hi.smileessence.util.UiHandler;
import android.app.Activity;
-import android.app.Dialog;
-import android.app.ProgressDialog;
-import android.content.ContentResolver;
-import android.content.DialogInterface;
-import android.content.DialogInterface.OnCancelListener;
import android.content.Intent;
-import android.content.res.Configuration;
-import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
-import android.os.Handler;
-import android.os.Message;
-import android.provider.MediaStore.MediaColumns;
+import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.view.ViewPager;
-import android.support.v4.view.ViewPager.OnPageChangeListener;
import android.view.KeyEvent;
+import android.view.Menu;
+import android.view.MenuItem;
+import android.view.View;
import android.view.Window;
import android.view.WindowManager;
-import com.slidingmenu.lib.SlidingMenu;
+import com.viewpagerindicator.TitlePageIndicator;
+
+import de.keyboardsurfer.android.widget.crouton.Crouton;
public class MainActivity extends FragmentActivity
{
private static MainActivity instance;
+ public static final int PAGE_POST = 0;
public static final int HANDLER_NOT_AUTHED = 0;
public static final int HANDLER_SETUPED = 1;
public static final int HANDLER_OAUTH_SUCCESS = 2;
public static final int HANDLER_NOT_CONNECTION = 3;
- private AuthorizeHelper authHelper;
- private AuthDialogHelper authDialog;
- private boolean isFirstLoad = false;
- private ViewPager viewPager;
- private ProgressDialog progressDialog;
- private Handler handler = new Handler()
+ NamedFragmentPagerAdapter adapter;
+ ViewPager pager;
+ TitlePageIndicator indicator;
+ View footerBar;
+
+ public static MainActivity getInstance()
{
- @Override
- public void handleMessage(Message msg)
+ return instance;
+ }
+
+ public static void moveViewPage(final int index)
+ {
+ new UiHandler()
{
- progressDialog.dismiss();
- switch (msg.what)
+
+ @Override
+ public void run()
{
- case HANDLER_SETUPED:
- {
- break;
- }
- case HANDLER_OAUTH_SUCCESS:
- {
- MyExecutor.execute(new Runnable()
- {
-
- @Override
- public void run()
- {
- MainSystem.getInstance().twitterSetup(handler);
- }
- });
- break;
- }
- case HANDLER_NOT_CONNECTION:
- {
- ToastManager.toast("ڑo܂");
- break;
- }
+ instance.pager.setCurrentItem(index, false);
}
- }
- };
-
+ }.post();
+ }
+
+ public static int getCurrentPage()
+ {
+ return instance.pager.getCurrentItem();
+ }
+
+ public static int addPage(NamedFragment fragment)
+ {
+ int i = instance.adapter.add(fragment);
+ instance.adapter.forceNotifyAdapter();
+ return i;
+ }
+
+ public static void removePage(int i)
+ {
+ instance.adapter.remove(i);
+ List<NamedFragment> list = Arrays.asList(instance.adapter.getList());
+ instance.adapter = new NamedFragmentPagerAdapter(instance.getSupportFragmentManager(), list);
+ instance.pager.setAdapter(instance.adapter);
+ moveViewPage(i);
+ }
+
+ public static int getPagerCount()
+ {
+ return instance.adapter.getCount();
+ }
+
@Override
public void onCreate(Bundle bundle)
{
super.onCreate(bundle);
requestWindowFeature(Window.FEATURE_NO_TITLE);
- setContentView(R.layout.mainactivity_layout);
- LogHelper.printD("main create");
-
+ setContentView(R.layout.main_layout);
+ LogHelper.d("main create");
instance = this;
- isFirstLoad = true;
- MainSystem.getInstance().start(instance);
- authHelper = new AuthorizeHelper(instance, Consumers.getDedault());
- TweetView.init(instance);
- viewSetUp();
+ initializeViews();
+ MainSystem.getInstance().initialize(instance);
}
-
- @Override
- protected void onResume()
+
+ private void initializeViews()
{
- super.onResume();
- LogHelper.printD("main resume");
- if (isFirstLoad)
+ adapter = new NamedFragmentPagerAdapter(getSupportFragmentManager());
+ adapter.add((NamedFragment) PostFragment.instantiate(instance, PostFragment.class.getName()));
+ adapter.add((NamedFragment) HomeFragment.instantiate(instance, HomeFragment.class.getName()));
+ adapter.add((NamedFragment) MentionsFragment.instantiate(instance, MentionsFragment.class.getName()));
+ adapter.add((NamedFragment) HistoryFragment.instantiate(instance, HistoryFragment.class.getName()));
+ pager = (ViewPager)findViewById(R.id.viewpager);
+ pager.setAdapter(adapter);
+ pager.destroyDrawingCache();
+ indicator = (TitlePageIndicator)findViewById(R.id.indicator);
+ indicator.setTextSize(21);
+ indicator.setViewPager(pager);
+ indicator.setOnPageChangeListener(new PageChangeListener());
+ footerBar = findViewById(R.id.footer);
+ new UiHandler()
{
- isFirstLoad = false;
-
- if (Client.hasAuthedAccount())
- {
- progressDialog = new ProgressDialog(instance);
- ProgressDialogHelper.makeProgressDialog(instance, progressDialog).show();
- MyExecutor.execute(new Runnable()
- {
-
- @Override
- public void run()
- {
- MainSystem.getInstance().twitterSetup(handler);
- }
- });
- }
- else
+
+ @Override
+ public void run()
{
- authDialog = new AuthDialogHelper(instance);
- final Dialog dialog = authDialog.getAuthDialog();
- authDialog.setOnComplete(new Runnable()
- {
- @Override
- public void run()
- {
- dialog.dismiss();
- authHelper.oauthSend();
- }
- });
- dialog.setOnCancelListener(new OnCancelListener()
- {
-
- @Override
- public void onCancel(DialogInterface dialog)
- {
- finish();
- }
- });
- dialog.show();
+ moveViewPage(1);
}
- }
- else
- {
- MainSystem.getInstance().refreshLists();
- }
+ }.post();
- getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
- }
+ }
- public static MainActivity getInstance()
+ @Override
+ public boolean onCreateOptionsMenu(Menu menu)
{
- return instance;
+ getMenuInflater().inflate(R.menu.menu_main, menu);
+ return super.onCreateOptionsMenu(menu);
}
+
+
@Override
- protected void onPause()
+ protected void onPostCreate(Bundle savedInstanceState)
{
- super.onPause();
- LogHelper.printD("main pause");
- getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
+ super.onPostCreate(savedInstanceState);
+ MainSystem.getInstance().setup(instance);
}
@Override
- public void onConfigurationChanged(Configuration newConfig)
+ protected void onResume()
{
- super.onConfigurationChanged(newConfig);
- TweetView.open(); //̔f̂߂ɊJ
- TweetView.close();
- DialogAdapter.dispose();
+ super.onResume();
+ LogHelper.d("main resume");
+ if(Client.<Boolean>getPreferenceValue(EnumPreferenceKey.VISIBLE_FOORER))
+ {
+ footerBar.setVisibility(View.VISIBLE);
+ }
+ else
+ {
+ footerBar.setVisibility(View.GONE);
+ }
+ getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
}
@Override
- protected void onRestart()
+ protected void onPause()
{
- super.onRestart();
- LogHelper.printD("main restart");
+ super.onPause();
+ LogHelper.d("main pause");
+ getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
}
@Override
protected void onDestroy()
{
super.onDestroy();
- LogHelper.printD("main destroy");
- MainSystem.getInstance().finish();
+ LogHelper.d("main destroy");
+ Crouton.cancelAllCroutons();
+ MainSystem.getInstance().onDestroyed();
instance = null;
}
@@ -207,164 +188,145 @@ public class MainActivity extends FragmentActivity
{
return;
}
-
if (reqCode == EnumRequestCode.AUTHORIZE.ordinal())
{
- final Uri uri = data.getData();
-
- Account account = authHelper.oauthRecieve(uri);
- if (account != null)
- {
- Client.setMainAccount(account);
- }
- progressDialog = new ProgressDialog(instance);
- ProgressDialogHelper.makeProgressDialog(instance, progressDialog).show();
- MyExecutor.execute(new Runnable()
- {
-
- @Override
- public void run()
- {
- MainSystem.getInstance().twitterSetup(handler);
- }
- });
+ MainSystem.getInstance().authorize(instance, data.getData());
}
else if(reqCode == EnumRequestCode.PICTURE.ordinal() || reqCode == EnumRequestCode.CAMERA.ordinal())
{
- Uri uri;
- if(reqCode == EnumRequestCode.PICTURE.ordinal())
- {
- uri = data.getData();
- }
- else
- {
- uri = MainSystem.getInstance().tempFilePath;
- }
-
- if(uri == null)
- {
- ToastManager.toast("t@C݂܂");
- return;
- }
- ContentResolver cr = getContentResolver();
- String[] columns = { MediaColumns.DATA };
- Cursor c = cr.query(uri, columns, null, null, null);
- c.moveToFirst();
- if(c.isNull(c.getColumnIndex(MediaColumns.DATA)))
- {
- ToastManager.toast("t@C݂܂");
- return;
- }
-
- File path = new File(c.getString(c.getColumnIndex(MediaColumns.DATA)));
- if (!path.exists())
- {
- ToastManager.toast("t@C݂܂");
- return;
- }
- else
- {
- TweetSystem.setPicturePath(path);
- ToastManager.toast("摜Zbg܂");
- TweetView.open();
- }
+ MainSystem.getInstance().receivePicture(instance, data, reqCode);
}
}
-
+
+ public void onEditClick(View v)
+ {
+ moveViewPage(PAGE_POST);
+ }
+
+ public void onMenuClick(View v)
+ {
+ dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_MENU));
+ }
+
+ public void onTwitterClick(View v)
+ {
+ startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://twitter.com/")));
+ }
+
@Override
- public boolean onKeyDown(int keyCode, KeyEvent event)
+ public boolean dispatchKeyEvent(KeyEvent event)
{
- if (keyCode == KeyEvent.KEYCODE_BACK)
+ if(event.getAction() != KeyEvent.ACTION_DOWN)
{
- TweetView.getInstance();
- if (TweetView.isOpening())
- {
- TweetView.toggle();
- return false;
- }
- else if(viewPager.getCurrentItem() != 0)
- {
- viewPager.setCurrentItem(0, true);
- return false;
- }
- else
+ return super.dispatchKeyEvent(event);
+ }
+ switch(event.getKeyCode())
+ {
+ case KeyEvent.KEYCODE_BACK:
{
- if(Client.<Boolean>getPreferenceValue(EnumPreferenceKey.CONFIRM_DIALOG))
+ if(pager.getCurrentItem() != 1)
{
- YesNoDialogHelper.show(this, "mF", "I܂H", new Runnable()
- {
-
- @Override
- public void run()
- {
- finish();
- }
- });
+ pager.setCurrentItem(1, true);
}
else
{
- finish();
+ if(Client.<Boolean>getPreferenceValue(EnumPreferenceKey.CONFIRM_DIALOG))
+ {
+ ConfirmDialog.show(this, "I܂H", new Runnable()
+ {
+
+ @Override
+ public void run()
+ {
+ finish();
+ }
+ });
+ }
+ else
+ {
+ finish();
+ }
}
return false;
}
- }
- else if (keyCode == KeyEvent.KEYCODE_MENU)
- {
- TweetView.getInstance();
- if(TweetView.isOpening())
- {
- TweetMenu.getInstance().createMenuDialog(true).show();
+ case KeyEvent.KEYCODE_MENU:
+ {
+ openOptionsMenu();
+ return true;
}
- else
+ default:
{
- MainMenu.getInstance().createMenuDialog(true).show();
+ return super.dispatchKeyEvent(event);
}
- return false;
+ }
+
+ }
+
+ @Override
+ public boolean onPrepareOptionsMenu(Menu menu)
+ {
+ Fragment fragment = (NamedFragment) adapter.getItem(getCurrentPage());
+ if(fragment != null && fragment instanceof IRemovable)
+ {
+ menu.findItem(R.id.menu_remove).setVisible(true);
}
else
{
- return super.onKeyDown(keyCode, event);
+ menu.findItem(R.id.menu_remove).setVisible(false);
}
+
+ menu.findItem(R.id.menu_extract).setVisible(!ExtractFragment.isShowing);
+ return super.onPrepareOptionsMenu(menu);
}
-
- private void viewSetUp()
- {
- viewPager = (ViewPager)findViewById(R.id.viewpager);
- viewPager.setAdapter(MainSystem.getInstance().pageAdapter);
- viewPager.setOnPageChangeListener(new OnPageChangeListener()
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item)
+ {
+ switch(item.getItemId())
{
- @Override
- public void onPageScrollStateChanged(int arg0) { }
-
- @Override
- public void onPageScrolled(int arg0, float arg1, int arg2)
- {
+ case R.id.menu_post:
+ {
+ PostSystem.openPostPage();
+ break;
}
-
- @Override
- public void onPageSelected(int position)
+ case R.id.menu_home:
{
- switch (position)
- {
- case 0:
- {
- TweetView.getInstance().getSlidingMenu().setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);
- break;
- }
- default:
- {
- TweetView.getInstance().getSlidingMenu().setTouchModeAbove(SlidingMenu.TOUCHMODE_NONE);
- break;
- }
- }
+ moveViewPage(1);
+ break;
+ }
+ case R.id.menu_option:
+ {
+ new MainMenu(instance).create().show();
+ break;
+ }
+ case R.id.menu_extract:
+ {
+ ExtractFragment fragment = ExtractFragment.singleton();
+ addPage(fragment);
+ moveViewPage(getPagerCount());
+ break;
+ }
+ case R.id.menu_remove:
+ {
+ removePage(getCurrentPage());
+ break;
}
- });
+ case R.id.menu_exit:
+ {
+ finish();
+ break;
+ }
+ }
+ return super.onOptionsItemSelected(item);
}
public ViewPager getViewPager()
{
- return viewPager;
+ return pager;
}
+ public NamedFragmentPagerAdapter getFragmentAdapter()
+ {
+ return adapter;
+ }
}
diff --git a/src/net/miz_hi/smileessence/view/MentionsFragment.java b/src/net/miz_hi/smileessence/view/MentionsFragment.java
new file mode 100644
index 00000000..da453e54
--- /dev/null
+++ b/src/net/miz_hi/smileessence/view/MentionsFragment.java
@@ -0,0 +1,43 @@
+package net.miz_hi.smileessence.view;
+
+import net.miz_hi.smileessence.R;
+import net.miz_hi.smileessence.listener.TimelineScrollListener;
+import net.miz_hi.smileessence.system.MainSystem;
+import net.miz_hi.smileessence.util.NamedFragment;
+import android.annotation.SuppressLint;
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.ViewGroup.LayoutParams;
+import android.widget.LinearLayout;
+import android.widget.ListView;
+import android.widget.ProgressBar;
+
+public class MentionsFragment extends NamedFragment
+{
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
+ {
+ View page = inflater.inflate(R.layout.listpage_layout, container, false);
+ ListView listView = (ListView)page.findViewById(R.id.listpage_listview);
+ ProgressBar progress = new ProgressBar(getActivity());
+ progress.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
+ progress.setVisibility(View.GONE);
+ ((ViewGroup)listView.getParent()).addView(progress);
+ listView.setEmptyView(progress);
+ listView.setFastScrollEnabled(true);
+ listView.setAdapter(MainSystem.getInstance().mentionsListAdapter);
+ listView.setOnScrollListener(new TimelineScrollListener(MainSystem.getInstance().mentionsListAdapter));
+
+ return page;
+ }
+
+ @Override
+ public String getTitle()
+ {
+ return "Mentions";
+ }
+
+}
diff --git a/src/net/miz_hi/smileessence/view/MentionsListPageFragment.java b/src/net/miz_hi/smileessence/view/MentionsListPageFragment.java
deleted file mode 100644
index c7b62ac1..00000000
--- a/src/net/miz_hi/smileessence/view/MentionsListPageFragment.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package net.miz_hi.smileessence.view;
-
-import net.miz_hi.smileessence.Client;
-import net.miz_hi.smileessence.R;
-import net.miz_hi.smileessence.listener.TimelineScrollListener;
-import net.miz_hi.smileessence.system.MainSystem;
-import android.os.Bundle;
-import android.support.v4.app.Fragment;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.ListView;
-import android.widget.RelativeLayout;
-import android.widget.TextView;
-
-public class MentionsListPageFragment extends Fragment
-{
-
- @Override
- public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
- {
-
- RelativeLayout page = (RelativeLayout) inflater.inflate(R.layout.listpage_layout, container, false);
-
- TextView textView = (TextView)page.findViewById(R.id.textView_listpage);
- ListView listView = (ListView)page.findViewById(R.id.listView_listpage);
-
- textView.setTextSize(Client.getTextSize() + 3);
- listView.setFastScrollEnabled(true);
- textView.setText("Mentions");
- listView.setAdapter(MainSystem.getInstance().mentionsListAdapter);
- listView.setOnScrollListener(new TimelineScrollListener(MainSystem.getInstance().mentionsListAdapter));
-
- return page;
- }
-
-}
diff --git a/src/net/miz_hi/smileessence/view/PostFragment.java b/src/net/miz_hi/smileessence/view/PostFragment.java
new file mode 100644
index 00000000..960be6eb
--- /dev/null
+++ b/src/net/miz_hi/smileessence/view/PostFragment.java
@@ -0,0 +1,383 @@
+package net.miz_hi.smileessence.view;
+
+import net.miz_hi.smileessence.Client;
+import net.miz_hi.smileessence.R;
+import net.miz_hi.smileessence.async.MyExecutor;
+import net.miz_hi.smileessence.core.EnumRequestCode;
+import net.miz_hi.smileessence.core.Notifier;
+import net.miz_hi.smileessence.data.StatusModel;
+import net.miz_hi.smileessence.dialog.ConfirmDialog;
+import net.miz_hi.smileessence.listener.PostEditTextListener;
+import net.miz_hi.smileessence.menu.TweetMenu;
+import net.miz_hi.smileessence.preference.EnumPreferenceKey;
+import net.miz_hi.smileessence.status.StatusUtils;
+import net.miz_hi.smileessence.status.StatusViewFactory;
+import net.miz_hi.smileessence.system.MainSystem;
+import net.miz_hi.smileessence.system.PostSystem;
+import net.miz_hi.smileessence.util.NamedFragment;
+import net.miz_hi.smileessence.util.UiHandler;
+import android.annotation.SuppressLint;
+import android.content.ContentValues;
+import android.content.Context;
+import android.content.Intent;
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
+import android.graphics.BitmapFactory.Options;
+import android.os.Bundle;
+import android.provider.MediaStore;
+import android.provider.MediaStore.MediaColumns;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.view.ViewGroup;
+import android.view.inputmethod.InputMethodManager;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.FrameLayout;
+import android.widget.ImageButton;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+@SuppressLint("ValidFragment")
+public class PostFragment extends NamedFragment implements OnClickListener
+{
+
+ TextView textCount;
+ EditText editText;
+ FrameLayout frameInReplyTo;
+ ImageView imagePict;
+ private static PostFragment singleton;
+
+ public static PostFragment singleton()
+ {
+ return singleton;
+ }
+
+ @Override
+ public void onCreate(Bundle savedInstanceState)
+ {
+ super.onCreate(savedInstanceState);
+ singleton = this;
+ }
+
+ @Override
+ public String getTitle()
+ {
+ return "Post";
+ }
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
+ {
+ View page = inflater.inflate(R.layout.post_layout, container, false);
+ editText = (EditText) page.findViewById(R.id.editText_tweet);
+ frameInReplyTo = (FrameLayout) page.findViewById(R.id.frame_inreplyto);
+ imagePict = (ImageView)page.findViewById(R.id.image_pict);
+ textCount = (TextView) page.findViewById(R.id.textView_count);
+ Button imageButtonSubmit = (Button) page.findViewById(R.id.btn_submit);
+ ImageButton imageButtonClear = (ImageButton) page.findViewById(R.id.imBtn_clean);
+ ImageButton imageButtonMenu = (ImageButton) page.findViewById(R.id.imBtn_tweetmenu);
+ ImageButton imageButtonPict = (ImageButton) page.findViewById(R.id.imBtn_pickpict);
+ ImageButton imageButtonCamera = (ImageButton) page.findViewById(R.id.imBtn_camera);
+
+ PostEditTextListener listener = new PostEditTextListener(textCount);
+ editText.setTextSize(Client.getTextSize() + 3);
+ editText.addTextChangedListener(listener);
+ editText.setOnFocusChangeListener(listener);
+ imageButtonSubmit.setOnClickListener(this);
+ imageButtonClear.setOnClickListener(this);
+ imageButtonMenu.setOnClickListener(this);
+ imageButtonPict.setOnClickListener(this);
+ imageButtonCamera.setOnClickListener(this);
+
+ return page;
+ }
+
+ public void load()
+ {
+ new UiHandler()
+ {
+
+ @Override
+ public void run()
+ {
+ String text = PostSystem.getText();
+ setText(text);
+ int cursor = PostSystem.getCursor();
+ setCursor(cursor);
+ long inReplyTo = PostSystem.getInReplyToStatusId();
+ setInReplyTo(inReplyTo);
+ String picturePath = PostSystem.getPicturePath();
+ setPicturePath(picturePath);
+ openIme();
+ }
+ }.post();
+ }
+
+
+ public void save()
+ {
+ String text = editText.getText().toString();
+ PostSystem.setText(text);
+ int cursor = editText.getSelectionEnd();
+ PostSystem.setCursor(cursor);
+ hideIme();
+ }
+
+ public void setText(final String s)
+ {
+ new UiHandler()
+ {
+
+ @Override
+ public void run()
+ {
+ editText.setText(s);
+ textCount.setText(String.valueOf(140 - s.length()));
+ }
+ }.post();
+ }
+
+ public void setCursor(final int i)
+ {
+ new UiHandler()
+ {
+
+ @Override
+ public void run()
+ {
+ if(i > editText.getText().length())
+ {
+ editText.setSelection(editText.getText().length());
+ }
+ else
+ {
+ editText.setSelection(i);
+ }
+
+ }
+ }.post();
+ }
+
+ public void setInReplyTo(final long l)
+ {
+ if(l == PostSystem.NONE_ID)
+ {
+ new UiHandler()
+ {
+
+ @Override
+ public void run()
+ {
+ frameInReplyTo.setVisibility(View.GONE);
+ }
+ }.post();
+
+ return;
+ }
+
+ MyExecutor.execute(new Runnable()
+ {
+
+ @Override
+ public void run()
+ {
+ try
+ {
+ StatusModel status = StatusUtils.getOrCreateStatusModel(l);
+ final View v = StatusViewFactory.getView(MainActivity.getInstance().getLayoutInflater(), status);
+ new UiHandler()
+ {
+
+ @Override
+ public void run()
+ {
+ frameInReplyTo.removeAllViews();
+ frameInReplyTo.addView(v);
+ frameInReplyTo.setVisibility(View.VISIBLE);
+ }
+ }.post();
+ return;
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+ });
+ }
+
+
+ public void setPicturePath(final String path)
+ {
+ if(path == null)
+ {
+ imagePict.setVisibility(View.GONE);
+ return;
+ }
+ MyExecutor.execute(new Runnable()
+ {
+ public void run()
+ {
+ new UiHandler()
+ {
+
+ @Override
+ public void run()
+ {
+ Options opt = new Options();
+ opt.inPurgeable = true; // GC”\ɂ
+ opt.inSampleSize = 2;
+ Bitmap bm = BitmapFactory.decodeFile(path, opt);
+ imagePict.setImageBitmap(bm);
+ imagePict.setVisibility(View.VISIBLE);
+ }
+ }.post();
+ }
+ });
+ }
+
+ public void clear()
+ {
+ setText("");
+ setInReplyTo(PostSystem.NONE_ID);
+ PostSystem.setInReplyToStatusId(PostSystem.NONE_ID);
+ removePicture();
+ }
+
+ public void clearBySubmit()
+ {
+ setText("");
+ setInReplyTo(PostSystem.NONE_ID);
+ PostSystem.setPicturePath(null);
+ imagePict.setVisibility(View.GONE);
+ }
+
+ public void removePicture()
+ {
+ if(imagePict.isShown())
+ {
+ ConfirmDialog.show(MainActivity.getInstance(), "摜̓e܂H", new Runnable()
+ {
+
+ @Override
+ public void run()
+ {
+ PostSystem.setPicturePath(null);
+ imagePict.setVisibility(View.GONE);
+ Notifier.info("܂");
+ }
+ });
+ }
+ }
+
+ public void openIme()
+ {
+ new UiHandler()
+ {
+
+ @Override
+ public void run()
+ {
+ if(Client.<Boolean>getPreferenceValue(EnumPreferenceKey.OPEN_IME))
+ {
+ InputMethodManager imm = (InputMethodManager) Client.getApplication().getSystemService(Context.INPUT_METHOD_SERVICE);
+ imm.showSoftInput(editText, 0);
+ }
+ }
+ }.post();
+ }
+
+ public void hideIme()
+ {
+ new UiHandler()
+ {
+
+ @Override
+ public void run()
+ {
+ InputMethodManager imm = (InputMethodManager) Client.getApplication().getSystemService(Context.INPUT_METHOD_SERVICE);
+ imm.hideSoftInputFromWindow(editText.getWindowToken(), 0);
+ }
+ }.post();
+ }
+
+ private void startGallery()
+ {
+ Intent intent = new Intent(Intent.ACTION_PICK);
+ intent.setType("image/*");
+ getActivity().startActivityForResult(intent, EnumRequestCode.PICTURE.ordinal());
+ }
+
+ private void startCamera()
+ {
+ ContentValues values = new ContentValues();
+ String filename = System.currentTimeMillis() + ".jpg";
+ // Kvȏl߂
+ values.put(MediaColumns.TITLE, filename);
+ values.put(MediaColumns.MIME_TYPE, "image/jpeg");
+ // Uri擾ĊoĂAIntentɂۑƂēn
+ MainSystem.getInstance().tempFilePath = getActivity().getContentResolver().insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values);
+ // Ceg̐ݒ
+ Intent intent = new Intent();
+ intent.setAction(MediaStore.ACTION_IMAGE_CAPTURE);
+ intent.putExtra(MediaStore.EXTRA_OUTPUT, MainSystem.getInstance().tempFilePath);
+ getActivity().startActivityForResult(intent, EnumRequestCode.CAMERA.ordinal());
+ }
+
+ @Override
+ public void onClick(View v)
+ {
+ switch (v.getId())
+ {
+ case R.id.btn_submit:
+ {
+ PostSystem.submit(editText.getText().toString());
+ if (Client.<Boolean> getPreferenceValue(EnumPreferenceKey.AFTER_SUBMIT))
+ {
+ MainActivity.getInstance().getViewPager().setCurrentItem(1);
+ }
+ clearBySubmit();
+ break;
+ }
+ case R.id.imBtn_tweetmenu:
+ {
+ save();
+ new TweetMenu(getActivity()).create().show();
+ break;
+ }
+ case R.id.imBtn_camera:
+ {
+ save();
+ startCamera();
+ break;
+ }
+ case R.id.imBtn_pickpict:
+ {
+ save();
+ startGallery();
+ break;
+ }
+ case R.id.imBtn_clean:
+ {
+ ConfirmDialog.show(getActivity(), "S܂H", new Runnable()
+ {
+ @Override
+ public void run()
+ {
+ clear();
+ save();
+ }
+ });
+ break;
+ }
+ case R.id.image_pict:
+ {
+ removePicture();
+ break;
+ }
+ default:
+ break;
+ }
+ }
+}
diff --git a/src/net/miz_hi/smileessence/view/RelationFragment.java b/src/net/miz_hi/smileessence/view/RelationFragment.java
new file mode 100644
index 00000000..81d6859e
--- /dev/null
+++ b/src/net/miz_hi/smileessence/view/RelationFragment.java
@@ -0,0 +1,93 @@
+package net.miz_hi.smileessence.view;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import net.miz_hi.smileessence.Client;
+import net.miz_hi.smileessence.R;
+import net.miz_hi.smileessence.async.MyExecutor;
+import net.miz_hi.smileessence.data.StatusModel;
+import net.miz_hi.smileessence.data.StatusStore;
+import net.miz_hi.smileessence.listener.TimelineScrollListener;
+import net.miz_hi.smileessence.status.StatusListAdapter;
+import net.miz_hi.smileessence.status.StatusUtils;
+import net.miz_hi.smileessence.system.MainSystem;
+import net.miz_hi.smileessence.system.RelationSystem;
+import net.miz_hi.smileessence.util.LogHelper;
+import net.miz_hi.smileessence.util.NamedFragment;
+import android.annotation.SuppressLint;
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ListView;
+import android.widget.RelativeLayout;
+import android.widget.TextView;
+
+@SuppressLint("ValidFragment")
+public class RelationFragment extends NamedFragment implements IRemovable, IRemainable
+{
+
+ long chasingId = -1;
+ ListView listView;
+
+ private RelationFragment(){};
+
+ public static RelationFragment newInstance(long chansingId)
+ {
+ RelationFragment relFragment = new RelationFragment();
+ relFragment.chasingId = chansingId;
+ return relFragment;
+ }
+
+ public long getChasingId()
+ {
+ return chasingId;
+ }
+
+ public void setChasingId(long id)
+ {
+ chasingId = id;
+ }
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
+ {
+ View page = inflater.inflate(R.layout.listpage_layout, container, false);
+ listView = (ListView)page.findViewById(R.id.listpage_listview);
+ listView.setFastScrollEnabled(true);
+ listView.setAdapter(RelationSystem.getAdapter(this));
+ listView.setOnScrollListener(new TimelineScrollListener(RelationSystem.getAdapter(this)));
+ return page;
+ }
+
+ @Override
+ public String getTitle()
+ {
+ return "Talk";
+ }
+
+ @Override
+ public void onRemoved()
+ {
+ RelationSystem.stopRelation(this);
+ }
+
+ @Override
+ public String save()
+ {
+ StringBuilder builder = new StringBuilder();
+ builder.append(chasingId);
+ return builder.toString();
+ }
+
+ @Override
+ public void load(String data)
+ {
+ String[] ar = data.split(" ");
+ chasingId = Long.parseLong(ar[0]);
+ RelationSystem.startRelation(this);
+ MainActivity.addPage(this);
+ }
+}
diff --git a/src/net/miz_hi/smileessence/view/RelationListPageFragment.java b/src/net/miz_hi/smileessence/view/RelationListPageFragment.java
deleted file mode 100644
index b82a3760..00000000
--- a/src/net/miz_hi/smileessence/view/RelationListPageFragment.java
+++ /dev/null
@@ -1,55 +0,0 @@
-package net.miz_hi.smileessence.view;
-
-import net.miz_hi.smileessence.Client;
-import net.miz_hi.smileessence.R;
-import net.miz_hi.smileessence.listener.TimelineScrollListener;
-import net.miz_hi.smileessence.system.MainSystem;
-import android.os.Bundle;
-import android.support.v4.app.Fragment;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.ListView;
-import android.widget.RelativeLayout;
-import android.widget.TextView;
-
-public class RelationListPageFragment extends Fragment
-{
-
- private static long chasingId = -1;
-
- @Override
- public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
- {
-
- RelativeLayout page = (RelativeLayout) inflater.inflate(R.layout.listpage_layout, container, false);
-
- TextView textView = (TextView)page.findViewById(R.id.textView_listpage);
- ListView listView = (ListView)page.findViewById(R.id.listView_listpage);
-
- textView.setTextSize(Client.getTextSize() + 3);
- listView.setFastScrollEnabled(true);
- textView.setText("Relation");
- listView.setAdapter(MainSystem.getInstance().relationListAdapter);
- listView.setOnScrollListener(new TimelineScrollListener(MainSystem.getInstance().relationListAdapter));
-
- return page;
- }
-
- public static long getChasingId()
- {
- synchronized (RelationListPageFragment.class)
- {
- return chasingId;
- }
- }
-
- public static void setChasingId(long id)
- {
- synchronized (RelationListPageFragment.class)
- {
- chasingId = id;
- }
- }
-
-}
diff --git a/src/net/miz_hi/smileessence/view/SettingActivity.java b/src/net/miz_hi/smileessence/view/SettingActivity.java
index 64fdeb80..e2f66667 100644
--- a/src/net/miz_hi/smileessence/view/SettingActivity.java
+++ b/src/net/miz_hi/smileessence/view/SettingActivity.java
@@ -3,37 +3,43 @@ package net.miz_hi.smileessence.view;
import net.miz_hi.smileessence.Client;
import net.miz_hi.smileessence.R;
import net.miz_hi.smileessence.auth.AuthentificationDB;
-import net.miz_hi.smileessence.dialog.SeekBarDialogHelper;
-import net.miz_hi.smileessence.dialog.YesNoDialogHelper;
+import net.miz_hi.smileessence.dialog.ConfirmDialog;
+import net.miz_hi.smileessence.dialog.SeekBarDialog;
import net.miz_hi.smileessence.preference.EnumPreferenceKey;
+import android.app.AlertDialog;
+import android.app.AlertDialog.Builder;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.preference.Preference;
+import android.preference.Preference.OnPreferenceChangeListener;
import android.preference.Preference.OnPreferenceClickListener;
import android.preference.PreferenceActivity;
+import android.preference.SwitchPreference;
+import android.view.ViewConfiguration;
import android.widget.Toast;
public class SettingActivity extends PreferenceActivity
{
private static final String T4J_URL = "http://twitter4j.org/";
+ private boolean footorFirstClick;
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.preference);
-
+ footorFirstClick = true;
Preference textSize = findPreference(getResources().getString(R.string.key_setting_textSize));
textSize.setOnPreferenceClickListener(new OnPreferenceClickListener()
{
@Override
public boolean onPreferenceClick(Preference preference)
{
- final SeekBarDialogHelper helper = new SeekBarDialogHelper(SettingActivity.this, "eLXgTCY");
+ final SeekBarDialog helper = new SeekBarDialog(SettingActivity.this, "eLXgTCY");
helper.setSeekBarMax(16);
helper.setSeekBarStart(Client.getTextSize() - 8);
helper.setLevelCorrect(8);
@@ -63,13 +69,50 @@ public class SettingActivity extends PreferenceActivity
}
});
+ SwitchPreference footer = (SwitchPreference) findPreference(getResources().getString(R.string.key_setting_footer));
+ footer.setOnPreferenceChangeListener(new OnPreferenceChangeListener()
+ {
+
+ @Override
+ public boolean onPreferenceChange(Preference preference, Object newValue)
+ {
+ boolean hasMenuKey = ViewConfiguration.get(SettingActivity.this).hasPermanentMenuKey();
+ if(footorFirstClick && !hasMenuKey)
+ {
+ footorFirstClick = false;
+ AlertDialog.Builder builder = new Builder(SettingActivity.this);
+ builder.setTitle("x");
+ builder.setCancelable(false);
+ builder.setMessage(
+ "tb^[o[ItɂƁA" +
+ "[̃j[L[ȊOŃCj[JƂłȂȂ܂\r\n\r\n" +
+ "K^CCʂ" +
+ "[̃j[L[삷邱ƂmF" +
+ "ItɂĂ\r\n\r\n" +
+ "j[L[Ȃ[ł͐΂ɃItɂȂł");
+ builder.setPositiveButton("OK", new OnClickListener()
+ {
+
+ @Override
+ public void onClick(DialogInterface dialog, int which)
+ {
+
+ }
+ });
+ builder.create().show();
+ }
+ return true;
+
+ }
+ });
+
Preference deleteAccounts = findPreference(getResources().getString(R.string.key_setting_delete_accounts));
deleteAccounts.setOnPreferenceClickListener(new OnPreferenceClickListener()
{
@Override
public boolean onPreferenceClick(Preference preference)
{
- YesNoDialogHelper helper = new YesNoDialogHelper(SettingActivity.this, "{ɃZbg܂H");
+ ConfirmDialog helper = new ConfirmDialog(SettingActivity.this, "{ɃZbg܂H");
helper.setOnClickListener(new OnClickListener()
{
diff --git a/src/net/miz_hi/smileessence/view/TemplateActivity.java b/src/net/miz_hi/smileessence/view/TemplateActivity.java
index 5b180d4c..54762caf 100644
--- a/src/net/miz_hi/smileessence/view/TemplateActivity.java
+++ b/src/net/miz_hi/smileessence/view/TemplateActivity.java
@@ -4,7 +4,7 @@ import net.miz_hi.smileessence.R;
import net.miz_hi.smileessence.data.template.Template;
import net.miz_hi.smileessence.data.template.TemplateListAdapter;
import net.miz_hi.smileessence.data.template.Templates;
-import net.miz_hi.smileessence.dialog.YesNoDialogHelper;
+import net.miz_hi.smileessence.dialog.ContentDialog;
import android.app.Activity;
import android.content.DialogInterface;
import android.os.Bundle;
@@ -13,6 +13,7 @@ import android.view.View.OnClickListener;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.ListView;
+import android.widget.TextView;
public class TemplateActivity extends Activity
{
@@ -21,10 +22,12 @@ public class TemplateActivity extends Activity
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
- setContentView(R.layout.templateactivity_layout);
+ setContentView(R.layout.listedit_layout);
- ListView listView = (ListView)findViewById(R.id.listView_template);
- ImageButton buttonAdd = (ImageButton)findViewById(R.id.imageButton_template_add);
+ TextView titleView = (TextView)findViewById(R.id.listedit_title);
+ titleView.setText("^̊Ǘ");
+ ListView listView = (ListView)findViewById(R.id.listedit_listview);
+ ImageButton buttonAdd = (ImageButton)findViewById(R.id.listedit_addbutton);
final TemplateListAdapter adapter = new TemplateListAdapter(this);
listView.setAdapter(adapter);
adapter.addAll(Templates.getTemplates());
@@ -36,9 +39,9 @@ public class TemplateActivity extends Activity
public void onClick(View v)
{
final EditText editText = new EditText(TemplateActivity.this);
- YesNoDialogHelper helper = new YesNoDialogHelper(TemplateActivity.this, "ҏW");
- helper.setContentView(editText);
- helper.setOnClickListener(new DialogInterface.OnClickListener()
+ ContentDialog dialog = new ContentDialog(TemplateActivity.this, "ҏW");
+ dialog.setContentView(editText);
+ dialog.setOnClickListener(new DialogInterface.OnClickListener()
{
@Override
@@ -64,9 +67,9 @@ public class TemplateActivity extends Activity
}
}
});
- helper.setTextPositive("");
- helper.setTextNegative("LZ");
- helper.createYesNoAlert().show();
+ dialog.setTextPositive("");
+ dialog.setTextNegative("LZ");
+ dialog.create().show();
}
});
}
diff --git a/src/net/miz_hi/smileessence/view/TweetView.java b/src/net/miz_hi/smileessence/view/TweetView.java
deleted file mode 100644
index 38518f6e..00000000
--- a/src/net/miz_hi/smileessence/view/TweetView.java
+++ /dev/null
@@ -1,393 +0,0 @@
-package net.miz_hi.smileessence.view;
-
-import java.io.File;
-
-import net.miz_hi.smileessence.Client;
-import net.miz_hi.smileessence.R;
-import net.miz_hi.smileessence.core.EnumRequestCode;
-import net.miz_hi.smileessence.data.StatusModel;
-import net.miz_hi.smileessence.dialog.YesNoDialogHelper;
-import net.miz_hi.smileessence.event.ToastManager;
-import net.miz_hi.smileessence.listener.TweetViewTouchListener;
-import net.miz_hi.smileessence.menu.TweetMenu;
-import net.miz_hi.smileessence.preference.EnumPreferenceKey;
-import net.miz_hi.smileessence.status.StatusViewFactory;
-import net.miz_hi.smileessence.system.MainSystem;
-import net.miz_hi.smileessence.system.TweetSystem;
-import net.miz_hi.smileessence.util.UiHandler;
-import android.app.Activity;
-import android.content.ContentValues;
-import android.content.Context;
-import android.content.Intent;
-import android.graphics.Bitmap;
-import android.graphics.BitmapFactory;
-import android.graphics.BitmapFactory.Options;
-import android.provider.MediaStore;
-import android.provider.MediaStore.MediaColumns;
-import android.text.Editable;
-import android.text.TextWatcher;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.View.OnClickListener;
-import android.view.View.OnLongClickListener;
-import android.view.ViewGroup.LayoutParams;
-import android.view.inputmethod.InputMethodManager;
-import android.widget.EditText;
-import android.widget.ImageButton;
-import android.widget.ImageView;
-import android.widget.LinearLayout;
-import android.widget.ListView;
-import android.widget.TextView;
-
-import com.slidingmenu.lib.SlidingMenu;
-import com.slidingmenu.lib.SlidingMenu.OnCloseListener;
-import com.slidingmenu.lib.SlidingMenu.OnClosedListener;
-import com.slidingmenu.lib.SlidingMenu.OnOpenListener;
-import com.slidingmenu.lib.SlidingMenu.OnOpenedListener;
-
-public class TweetView
-{
-
- private static TweetView instance;
- private SlidingMenu menu;
- private Activity activity;
- private EditText editTextTweet;
- private ListView listViewReply;
- private LinearLayout linearLayoutReply;
- private LinearLayout linearLayoutPict;
-
- private TweetView(Activity activity)
- {
- this.activity = activity;
- init();
- }
-
- public static void init(Activity activity)
- {
- instance = new TweetView(activity);
- }
-
- public static TweetView getInstance()
- {
- return instance;
- }
-
- public String getText()
- {
- return editTextTweet.getText().toString();
- }
-
- public int getCursor()
- {
- return editTextTweet.getSelectionEnd();
- }
-
- public void removeReply()
- {
- linearLayoutReply.removeAllViews();
- }
-
- public void setInReplyToStatus(StatusModel status)
- {
- linearLayoutReply.removeAllViews();
- View viewStatus = StatusViewFactory.getView(activity.getLayoutInflater(), status);
- linearLayoutReply.addView(viewStatus);
- }
-
- public void setPictureImage(File path)
- {
- linearLayoutPict.removeAllViews();
- if(path == null)
- {
- return;
- }
- ImageView viewImage = new ImageView(activity);
- Options opt = new Options();
- opt.inPurgeable = true; // GC”\ɂ
- opt.inSampleSize = 2;
- Bitmap bm = BitmapFactory.decodeFile(path.getPath(), opt);
- viewImage.setImageBitmap(bm);
- LayoutParams lp = new LayoutParams(200, 200);
- viewImage.setLayoutParams(lp);
- viewImage.setOnLongClickListener(new OnLongClickListener()
- {
-
- @Override
- public boolean onLongClick(View v)
- {
- YesNoDialogHelper.show(activity, "", "摜̓e܂H", new Runnable()
- {
-
- @Override
- public void run()
- {
- TweetSystem.setPicturePath(null);
- linearLayoutPict.removeAllViews();
- ToastManager.toast("܂");
- }
- });
- return true;
- }
- });
- linearLayoutPict.addView(viewImage);
- }
-
- public static void toggle()
- {
- new UiHandler()
- {
-
- @Override
- public void run()
- {
- getInstance().menu.toggle();
- }
- }.post();
- }
-
- public static void open()
- {
- new UiHandler()
- {
-
- @Override
- public void run()
- {
- getInstance().menu.showMenu();
- }
- }.post();
- }
-
- public static void close()
- {
- new UiHandler()
- {
-
- @Override
- public void run()
- {
- getInstance().menu.showContent();
- }
- }.post();
- }
-
- public static boolean isOpening()
- {
- return getInstance().menu.isMenuShowing();
- }
-
- private void init()
- {
- TweetSystem.start(activity);
- createSlidingMenu();
- editTextTweet = (EditText) menu.findViewById(R.id.editText_tweet);
- final TextView textViewCount = (TextView) menu.findViewById(R.id.textView_count);
- ImageButton imageButtonSubmit = (ImageButton) menu.findViewById(R.id.imageButton_submit);
- ImageButton imageButtonClear = (ImageButton) menu.findViewById(R.id.imageButton_clean);
- ImageButton imageButtonMenu = (ImageButton)menu.findViewById(R.id.imageButton_menu);
- ImageButton imageButtonPict = (ImageButton)menu.findViewById(R.id.imageButton_pict);
- ImageButton imageButtonCamera = (ImageButton)menu.findViewById(R.id.imageButton_camera);
- linearLayoutReply = (LinearLayout)menu.findViewById(R.id.linearLayout_tweet_reply);
- linearLayoutPict = (LinearLayout)menu.findViewById(R.id.linearLayout_tweet_pict);
-
- textViewCount.setText("140");
- editTextTweet.setFocusable(true);
- editTextTweet.setTextSize(Client.getTextSize());
- editTextTweet.addTextChangedListener(new TextWatcher()
- {
-
- @Override
- public void onTextChanged(CharSequence s, int start, int before, int count)
- {
- textViewCount.setText(String.valueOf(140 - s.length()));
- }
-
- @Override
- public void beforeTextChanged(CharSequence s, int start, int count, int after){}
-
- @Override
- public void afterTextChanged(Editable s){}
- });
-
- imageButtonSubmit.setOnClickListener(new OnClickListener()
- {
-
- @Override
- public void onClick(View v)
- {
- TweetSystem.setText(editTextTweet.getText().toString());
- TweetSystem.submit();
- editTextTweet.setText("");
- if(Client.<Boolean>getPreferenceValue(EnumPreferenceKey.AFTER_SUBMIT))
- {
- close();
- }
- }
- });
-
- imageButtonClear.setOnClickListener(new OnClickListener()
- {
-
- @Override
- public void onClick(View v)
- {
- YesNoDialogHelper.show(activity, "", "S܂H", new Runnable()
- {
- @Override
- public void run()
- {
- editTextTweet.setText("");
- TweetSystem.clear();
- }
- });
- }
- });
-
- imageButtonMenu.setOnClickListener(new OnClickListener()
- {
-
- @Override
- public void onClick(View v)
- {
- InputMethodManager imm = (InputMethodManager) Client.getApplication().getSystemService(Context.INPUT_METHOD_SERVICE);
- imm.hideSoftInputFromWindow(editTextTweet.getWindowToken(), 0);
- TweetMenu.show();
- }
- });
-
- imageButtonPict.setOnClickListener(new OnClickListener()
- {
-
- @Override
- public void onClick(View v)
- {
- Intent intent = new Intent(Intent.ACTION_PICK);
- intent.setType("image/*");
- activity.startActivityForResult(intent, EnumRequestCode.PICTURE.ordinal());
- }
- });
-
- imageButtonCamera.setOnClickListener(new OnClickListener()
- {
-
- @Override
- public void onClick(View v)
- {
- ContentValues values = new ContentValues();
-
- //t@C߂
- String filename = System.currentTimeMillis() + ".jpg";
- //Kvȏl߂
- values.put(MediaColumns.TITLE, filename);
- values.put(MediaColumns.MIME_TYPE, "image/jpeg");
- //Uri擾ĊoĂAIntentɂۑƂēn
- MainSystem.getInstance().tempFilePath= activity.getContentResolver().insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values);
-
- //Ceg̐ݒ
- Intent intent = new Intent();
- intent.setAction(MediaStore.ACTION_IMAGE_CAPTURE);
- intent.putExtra(MediaStore.EXTRA_OUTPUT, MainSystem.getInstance().tempFilePath);
- activity.startActivityForResult(intent, EnumRequestCode.CAMERA.ordinal());
- }
- });
- }
-
- private void onOpeningMenu()
- {
- String text = TweetSystem.getText();
- editTextTweet.setText(text);
-
- if(text.startsWith(" RT"))
- {
- editTextTweet.setSelection(0);
- }
- else
- {
- editTextTweet.setSelection(text.length());
- }
- }
-
- private void onOpenedMenu()
- {
- editTextTweet.setTextSize(Client.getTextSize());
- editTextTweet.requestFocus();
-
- if(Client.<Boolean>getPreferenceValue(EnumPreferenceKey.OPEN_IME))
- {
- InputMethodManager imm = (InputMethodManager) Client.getApplication().getSystemService(Context.INPUT_METHOD_SERVICE);
- imm.showSoftInput(editTextTweet, 0);
- }
- }
-
- private void onClosingMenu()
- {
- TweetSystem.setText(editTextTweet.getText().toString());
- }
-
- private void onClosedMenu()
- {
- InputMethodManager imm = (InputMethodManager) Client.getApplication().getSystemService(Context.INPUT_METHOD_SERVICE);
- imm.hideSoftInputFromWindow(editTextTweet.getWindowToken(), 0);
- }
-
- private void createSlidingMenu()
- {
- menu = new SlidingMenu(activity);
- menu.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);
- menu.setShadowWidthRes(R.dimen.shadow_width);
- menu.setBehindOffsetRes(R.dimen.slidingmenu_offset);
- menu.setFadeDegree(0.35f);
- menu.setShadowDrawable(R.drawable.shadow);
- menu.attachToActivity(activity, SlidingMenu.SLIDING_WINDOW);
- View rootView = LayoutInflater.from(activity).inflate(R.layout.tweet_layout, null);
- menu.setMenu(rootView);
- rootView.setOnTouchListener(new TweetViewTouchListener());
-
- menu.setOnOpenListener(new OnOpenListener()
- {
-
- @Override
- public void onOpen()
- {
- onOpeningMenu();
- }
- });
- menu.setOnOpenedListener(new OnOpenedListener()
- {
-
- @Override
- public void onOpened()
- {
- onOpenedMenu();
- }
- });
- menu.setOnCloseListener(new OnCloseListener()
- {
-
- @Override
- public void onClose()
- {
- onClosingMenu();
- }
- });
- menu.setOnClosedListener(new OnClosedListener()
- {
-
- @Override
- public void onClosed()
- {
- onClosedMenu();
- }
- });
- }
-
- public SlidingMenu getSlidingMenu()
- {
- return menu;
- }
-
- public EditText getEditTextTweet()
- {
- return editTextTweet;
- }
-}
diff --git a/src/net/miz_hi/smileessence/view/UserActivity.java b/src/net/miz_hi/smileessence/view/UserActivity.java
deleted file mode 100644
index 5ab8cd50..00000000
--- a/src/net/miz_hi/smileessence/view/UserActivity.java
+++ /dev/null
@@ -1,206 +0,0 @@
-package net.miz_hi.smileessence.view;
-
-import java.util.LinkedList;
-import java.util.List;
-import java.util.concurrent.Callable;
-import java.util.concurrent.Future;
-
-import net.miz_hi.smileessence.Client;
-import net.miz_hi.smileessence.R;
-import net.miz_hi.smileessence.async.AsyncTimelineGetter;
-import net.miz_hi.smileessence.async.MyExecutor;
-import net.miz_hi.smileessence.data.IconCaches;
-import net.miz_hi.smileessence.data.StatusModel;
-import net.miz_hi.smileessence.data.UserModel;
-import net.miz_hi.smileessence.data.UserStore;
-import net.miz_hi.smileessence.dialog.DialogAdapter;
-import net.miz_hi.smileessence.listener.StatusOnClickListener;
-import net.miz_hi.smileessence.menu.UserMenu;
-import net.miz_hi.smileessence.status.StatusViewFactory;
-import net.miz_hi.smileessence.util.StringUtils;
-import net.miz_hi.smileessence.util.TwitterManager;
-import net.miz_hi.smileessence.util.UiHandler;
-import twitter4j.Paging;
-import twitter4j.User;
-import android.app.Activity;
-import android.os.Bundle;
-import android.view.KeyEvent;
-import android.view.View;
-import android.view.Window;
-import android.widget.ImageView;
-import android.widget.LinearLayout;
-import android.widget.TextView;
-
-public class UserActivity extends Activity
-{
-
- private User user;
- private TextView screennameView;
- private TextView nameView;
- private TextView homepageView;
- private TextView locateView;
- private TextView isFollowingView;
- private TextView isFollowedView;
- private TextView isProtectedView;
- private TextView descriptionView;
- private TextView tweetView;
- private TextView followingView;
- private TextView followedView;
- private TextView favoriteView;
- private ImageView iconView;
- private LinearLayout statusesView;
-
- private UserMenu userMenu;
-
- @Override
- public void onCreate(Bundle savedInstanceState)
- {
- super.onCreate(savedInstanceState);
- requestWindowFeature(Window.FEATURE_NO_TITLE);
- setContentView(R.layout.useractivity_layout);
-
- Future f1 = MyExecutor.submit(new Callable<User>()
- {
-
- @Override
- public User call()
- {
- return TwitterManager.getUser(Client.getMainAccount(), getIntent().getStringExtra("screen_name"));
- }
- });
-
- try
- {
- user = (User) f1.get();
- }
- catch (Exception e1)
- {
- e1.printStackTrace();
- finish();
- }
-
- UserModel model = UserStore.put(user);
-
- userMenu = new UserMenu(this, model);
-
- screennameView = (TextView) findViewById(R.id.user_screenname);
- nameView = (TextView) findViewById(R.id.user_name);
- homepageView = (TextView) findViewById(R.id.user_homepage);
- locateView = (TextView) findViewById(R.id.user_locate);
- isFollowingView = (TextView) findViewById(R.id.user_isfollowing);
- isFollowedView = (TextView) findViewById(R.id.user_isfollowed);
- isProtectedView = (TextView) findViewById(R.id.user_isprotected);
- descriptionView = (TextView) findViewById(R.id.user_bio);
- tweetView = (TextView) findViewById(R.id.user_count_tweet);
- followingView = (TextView) findViewById(R.id.user_count_following);
- followedView = (TextView) findViewById(R.id.user_count_followed);
- favoriteView = (TextView) findViewById(R.id.user_count_favorite);
- iconView = (ImageView) findViewById(R.id.user_icon);
- statusesView = (LinearLayout) findViewById(R.id.user_status);
-
- screennameView.setText(model.screenName);
- nameView.setText(model.name);
- if (StringUtils.isNullOrEmpty(model.homePageUrl))
- {
- homepageView.setVisibility(View.GONE);
- }
- else
- {
- homepageView.setText(model.homePageUrl);
- }
- if(StringUtils.isNullOrEmpty(model.location))
- {
- locateView.setVisibility(View.GONE);
- }
- else
- {
- locateView.setText(model.location);
- }
- isFollowingView.setText(model.isFriend() ? "tH[Ă܂" : model.isMe() ? "Ȃł" : "tH[Ă܂");
- isFollowedView.setText(model.isFollower() ? "tH[Ă܂" : model.isMe() ? "Ȃł" : "tH[Ă܂");
- isProtectedView.setText(model.isProtected ? "J" : "J");
- descriptionView.setText(model.description);
- tweetView.setText(Integer.toString(model.statusCount));
- followingView.setText(Integer.toString(model.friendCount));
- followedView.setText(Integer.toString(model.followerCount));
- favoriteView.setText(Integer.toString(model.favoriteCount));
- IconCaches.setIconBitmapToView(model, iconView);
-
- TextView emptyText = new TextView(this);
- emptyText.setText("Now Loading...");
- statusesView.addView(emptyText);
-
- final Future<List<StatusModel>> resp = MyExecutor.submit(new AsyncTimelineGetter(Client.getMainAccount(), user.getId(), new Paging(1)));
- MyExecutor.execute(new Runnable()
- {
- @Override
- public void run()
- {
- try
- {
- final LinkedList<StatusModel> list = new LinkedList<StatusModel>(resp.get());
-
- new UiHandler()
- {
-
- @Override
- public void run()
- {
- statusesView.removeAllViews();
- int i = 0;
- while (!list.isEmpty())
- {
- StatusModel model = list.poll();
- View v = StatusViewFactory.getView(getLayoutInflater(), model);
- if(!model.isRetweet && !model.isReply)
- {
- if(i % 2 == 0)
- {
- model.backgroundColor = Client.getColor(R.color.White);
- }
- else
- {
- model.backgroundColor = Client.getColor(R.color.LightGray);
- }
- }
- v.setBackgroundColor(model.backgroundColor);
- v.setOnClickListener(new StatusOnClickListener(UserActivity.this, model));
- statusesView.addView(v);
- i++;
- }
- statusesView.postInvalidate();
- }
- }.post();
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
- });
- }
-
- public User getUser()
- {
- return user;
- }
-
- @Override
- public boolean onKeyDown(int keyCode, KeyEvent event)
- {
- if (keyCode == KeyEvent.KEYCODE_MENU)
- {
- if (userMenu.isShowing())
- {
- DialogAdapter.dispose();
- }
- else
- {
- userMenu.createMenuDialog(true).show();
- }
- return false;
- }
- return super.onKeyDown(keyCode, event);
- }
-
-}
diff --git a/src/net/miz_hi/smileessence/view/UserInfoFragment.java b/src/net/miz_hi/smileessence/view/UserInfoFragment.java
new file mode 100644
index 00000000..260fb529
--- /dev/null
+++ b/src/net/miz_hi/smileessence/view/UserInfoFragment.java
@@ -0,0 +1,154 @@
+package net.miz_hi.smileessence.view;
+
+import net.miz_hi.smileessence.Client;
+import net.miz_hi.smileessence.R;
+import net.miz_hi.smileessence.async.MyExecutor;
+import net.miz_hi.smileessence.data.IconCaches;
+import net.miz_hi.smileessence.data.UserModel;
+import net.miz_hi.smileessence.menu.UserMenu;
+import net.miz_hi.smileessence.twitter.TwitterManager;
+import net.miz_hi.smileessence.util.NamedFragment;
+import net.miz_hi.smileessence.util.UiHandler;
+import twitter4j.User;
+import android.annotation.SuppressLint;
+import android.os.Bundle;
+import android.text.TextUtils;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.view.ViewGroup;
+import android.widget.Button;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+@SuppressLint("ValidFragment")
+public class UserInfoFragment extends NamedFragment implements OnClickListener, IRemovable
+{
+
+ UserModel user;
+ TextView screennameView;
+ TextView nameView;
+ TextView homepageView;
+ TextView locateView;
+ TextView isFollowingView;
+ TextView isFollowedView;
+ TextView isProtectedView;
+ TextView descriptionView;
+ TextView tweetcountView;
+ TextView followingView;
+ TextView followedView;
+ TextView favoriteView;
+ ImageView iconView;
+
+ private UserInfoFragment(){}
+
+ public static UserInfoFragment newInstance(UserModel user)
+ {
+ UserInfoFragment fragment = new UserInfoFragment();
+ fragment.user = user;
+ return fragment;
+ }
+
+ @Override
+ public String getTitle()
+ {
+ return user.screenName + "'s Profile";
+ }
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
+ {
+ View page = inflater.inflate(R.layout.userinfo_layout, container, false);
+ Button reload = (Button)page.findViewById(R.id.user_reload);
+ reload.setOnClickListener(this);
+ Button menu = (Button)page.findViewById(R.id.user_menu);
+ menu.setOnClickListener(this);
+
+ screennameView = (TextView) page.findViewById(R.id.user_screenname);
+ nameView = (TextView) page.findViewById(R.id.user_name);
+ homepageView = (TextView) page.findViewById(R.id.user_homepage);
+ locateView = (TextView) page.findViewById(R.id.user_locate);
+ isFollowingView = (TextView) page.findViewById(R.id.user_isfollowing);
+ isFollowedView = (TextView) page.findViewById(R.id.user_isfollowed);
+ isProtectedView = (TextView) page.findViewById(R.id.user_isprotected);
+ descriptionView = (TextView) page.findViewById(R.id.user_bio);
+ tweetcountView = (TextView) page.findViewById(R.id.user_count_tweet);
+ followingView = (TextView) page.findViewById(R.id.user_count_following);
+ followedView = (TextView) page.findViewById(R.id.user_count_followed);
+ favoriteView = (TextView) page.findViewById(R.id.user_count_favorite);
+ iconView = (ImageView) page.findViewById(R.id.user_icon);
+ reload();
+ return page;
+ }
+
+ private void reload()
+ {
+ new UiHandler()
+ {
+
+ @Override
+ public void run()
+ {
+ screennameView.setText(user.screenName);
+ nameView.setText(user.name);
+ if(TextUtils.isEmpty(user.homePageUrl))
+ {
+ homepageView.setVisibility(View.GONE);
+ }
+ else
+ {
+ homepageView.setText(user.homePageUrl);
+ }
+ if(TextUtils.isEmpty(user.location))
+ {
+ locateView.setVisibility(View.GONE);
+ }
+ else
+ {
+ locateView.setText(user.location);
+ }
+ isFollowingView.setText(user.isFriend() ? "tH[Ă܂" : user.isMe() ? "Ȃł" : "tH[Ă܂");
+ isFollowedView.setText(user.isFollower() ? "tH[Ă܂" : user.isMe() ? "Ȃł" : "tH[Ă܂");
+ isProtectedView.setText(user.isProtected ? "J" : "J");
+ descriptionView.setText(user.description);
+ tweetcountView.setText(Integer.toString(user.statusCount));
+ followingView.setText(Integer.toString(user.friendCount));
+ followedView.setText(Integer.toString(user.followerCount));
+ favoriteView.setText(Integer.toString(user.favoriteCount));
+ IconCaches.setIconBitmapToView(user, iconView);
+ }
+ }.post();
+ }
+
+ @Override
+ public void onClick(View v)
+ {
+ switch(v.getId())
+ {
+ case R.id.user_reload:
+ {
+ MyExecutor.execute(new Runnable()
+ {
+ public void run()
+ {
+ User u = TwitterManager.getUser(Client.getMainAccount(), user.userId);
+ user.updateData(u);
+ reload();
+ }
+ });
+ break;
+ }
+ case R.id.user_menu:
+ {
+ new UserMenu(getActivity(), user).create().show();
+ break;
+ }
+ }
+ }
+
+ @Override
+ public void onRemoved()
+ {
+ }
+
+}
diff --git a/src/net/miz_hi/smileessence/view/UserTimelineFragment.java b/src/net/miz_hi/smileessence/view/UserTimelineFragment.java
new file mode 100644
index 00000000..3b1d529f
--- /dev/null
+++ b/src/net/miz_hi/smileessence/view/UserTimelineFragment.java
@@ -0,0 +1,83 @@
+package net.miz_hi.smileessence.view;
+
+import net.miz_hi.smileessence.Client;
+import net.miz_hi.smileessence.R;
+import net.miz_hi.smileessence.async.AsyncTimelineGetter;
+import net.miz_hi.smileessence.async.MyExecutor;
+import net.miz_hi.smileessence.data.UserModel;
+import net.miz_hi.smileessence.listener.TimelineScrollListener;
+import net.miz_hi.smileessence.status.StatusListAdapter;
+import net.miz_hi.smileessence.twitter.TwitterManager;
+import net.miz_hi.smileessence.util.NamedFragment;
+import twitter4j.Paging;
+import twitter4j.User;
+import android.annotation.SuppressLint;
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.ViewGroup.LayoutParams;
+import android.widget.ListView;
+import android.widget.ProgressBar;
+
+@SuppressLint("ValidFragment")
+public class UserTimelineFragment extends NamedFragment implements IRemovable
+{
+
+ UserModel user;
+ StatusListAdapter adapter;
+
+ private UserTimelineFragment(){};
+
+ public static UserTimelineFragment newInstance(UserModel user)
+ {
+ UserTimelineFragment fragment = new UserTimelineFragment();
+ fragment.user = user;
+ return fragment;
+ }
+
+ @Override
+ public String getTitle()
+ {
+ return user.screenName + "'s Timeline";
+ }
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
+ {
+ View page = inflater.inflate(R.layout.listpage_layout, container, false);
+ ListView listView = (ListView)page.findViewById(R.id.listpage_listview);
+ ProgressBar progress = new ProgressBar(getActivity());
+ progress.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
+ progress.setVisibility(View.GONE);
+ ((ViewGroup)listView.getParent()).addView(progress);
+ listView.setEmptyView(progress);
+ listView.setFastScrollEnabled(true);
+ adapter = new StatusListAdapter(getActivity());
+ listView.setAdapter(adapter);
+ listView.setOnScrollListener(new TimelineScrollListener(adapter));
+ getUserTimeline();
+ return page;
+ }
+
+ private void getUserTimeline()
+ {
+ MyExecutor.execute(new Runnable()
+ {
+ public void run()
+ {
+ User u = TwitterManager.getUser(Client.getMainAccount(), user.userId);
+ user.updateData(u);
+ adapter.addAll(new AsyncTimelineGetter(Client.getMainAccount(), user.userId, new Paging(1)).call());
+ adapter.forceNotifyAdapter();
+ }
+ });
+ }
+
+ @Override
+ public void onRemoved()
+ {
+ adapter.clear();
+ }
+
+}