This commit is contained in:
seven332 committed 2014-11-29 23:08:59 +08:00
1 parent 083e7007af
commit dcfdd31bc4
8 files changed
+61 -15

No files matched your search

+1 -1
View File
@@ -41,7 +41,7 @@
android:name=".StartActivity"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar.Transparent" >
android:theme="@style/AppTheme.NoActionBar.Fullscreen.Transparent" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
+20
View File
@@ -14,11 +14,31 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/list_menu_right"
style="@style/Drawer"
android:layout_gravity="right|end" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<View
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="3"
android:background="#ff3f51b5" />
<View
android:id="@+id/background"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="2" />
</LinearLayout>
<com.hippo.ehviewer.widget.TagListView
android:id="@+id/list_menu_tag_list"
android:layout_width="match_parent"
+1 -2
View File
@@ -162,7 +162,7 @@
<item name="@android:layout_height">48dp</item>
<item name="mpWidth">48dp</item>
<item name="mpHeight">48dp</item>
<item name="mpColor">@color/material_progress_blue</item>
<item name="mpColor">?attr/themeColor</item>
<item name="mpThickness">4dp</item>
<item name="mpInnerRadius">19dp</item>
</style>
@@ -172,7 +172,6 @@
<item name="@android:layout_height">16dp</item>
<item name="mpWidth">16dp</item>
<item name="mpHeight">16dp</item>
<item name="mpColor">@color/material_progress_blue</item>
<item name="mpThickness">2dp</item>
<item name="mpInnerRadius">6dp</item>
</style>
+6 -1
View File
@@ -122,8 +122,13 @@
<item name="android:windowBackground">@color/background_little_light</item>
</style>
<style name="AppTheme.NoActionBar.Fullscreen">
<item name="android:windowFullscreen">true</item>
<item name="android:windowContentOverlay">@null</item>
</style>
<!-- Theme for start activity -->
<style name="AppTheme.NoActionBar.Transparent">
<style name="AppTheme.NoActionBar.Fullscreen.Transparent">
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:colorBackgroundCacheHint">@null</item>
<item name="android:windowIsTranslucent">true</item>
+5 -4
View File
@@ -16,7 +16,6 @@
package com.hippo.ehviewer;
import android.annotation.SuppressLint;
import android.app.AlertDialog;
import android.content.Intent;
import android.graphics.Typeface;
@@ -182,13 +181,15 @@ public class StartActivity extends AbsActivity {
}).create();
}
@SuppressWarnings("deprecation")
@SuppressLint("InlinedApi")
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.start_activity);
View decorView = getWindow().getDecorView();
int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
decorView.setSystemUiVisibility(uiOptions);
View main = findViewById(R.id.main);
TextView text = (TextView) findViewById(R.id.text);
text.setTypeface(Typeface.createFromAsset(getAssets(),"fonts/GloriaHallelujah.ttf"));
@@ -199,7 +200,7 @@ public class StartActivity extends AbsActivity {
// Show welcome in progress
AlphaAnimation aa = new AlphaAnimation(0.3f, 1.0f);
aa.setDuration(2000);
aa.setInterpolator(new DecelerateInterpolator(3.0f));
aa.setInterpolator(new DecelerateInterpolator(4.0f));
aa.setAnimationListener(new AnimationListener() {
@Override
public void onAnimationEnd(Animation arg0) {
+1 -1
View File
@@ -61,7 +61,7 @@ public class GalleryInfo implements Parcelable {
public static final String[] S_LANG_PATTERNS = {
"[(\\[]eng(?:lish)?[)\\]]",
"[((\\[]chinese[))\\]]|[汉漢]化|中[国國][语語]|[(\\[]CN[)\\]]",
"[((\\[]chinese[))\\]]|[汉漢]化|中[国國][语語]|中文|[(\\[]CN[)\\]]",
"[(\\[]spanish[)\\]]|[(\\[]Español[)\\]]",
"[(\\[]korean?[)\\]]",
"[(\\[]rus(?:sian)?[)\\]]",
@@ -38,6 +38,8 @@ public class FreeMaterialDrawable extends Drawable {
private static final int SPRITE_SHAPE_ROUND = 1;
private static final int SPRITE_SHAPE_MAX = 2;
private boolean mKeepTop;
private int mBgIndex;
private int mBgColor;
private final Paint mPaint;
private int mSpriteNum;
@@ -55,6 +57,16 @@ public class FreeMaterialDrawable extends Drawable {
mPaint.setShadowLayer(Ui.dp2pix(3), 0, 0, 0x8a000000);
}
public FreeMaterialDrawable setBgIndex(int bgIndex) {
mBgIndex = bgIndex;
return this;
}
public FreeMaterialDrawable setKeepTop(boolean keepTop) {
mKeepTop = keepTop;
return this;
}
private int getColor(int[] copyOfColorArray) {
int index = MathUtils.random(0, copyOfColorArray.length);
int color = copyOfColorArray[index];
@@ -70,7 +82,12 @@ public class FreeMaterialDrawable extends Drawable {
int h = bounds.height();
Sprite s;
int[] copyOfColorArray = Arrays.copyOf(sColorArray, sColorArray.length);
mBgColor = getColor(copyOfColorArray);
if (mBgIndex >= 0) {
mBgColor = copyOfColorArray[mBgIndex];
copyOfColorArray[mBgIndex] = -1;
} else {
mBgColor = getColor(copyOfColorArray);
}
mSpriteNum = MathUtils.random(4, MAX_SPRITE_NUM + 1);
for (int i = 0; i < mSpriteNum; i++) {
switch (SPRITE_SHAPE_ROUND) {//MathUtils.random(0, SPRITE_SHAPE_MAX)) {
@@ -156,10 +173,10 @@ public class FreeMaterialDrawable extends Drawable {
public Round(int w, int h, int color) {
super(w, h, color);
mX = MathUtils.random(w);
mY = MathUtils.random(h);
int t = (w + h) / 2;
mRadius = MathUtils.random(t / 8, t / 4);
mX = MathUtils.random(w);
mY = MathUtils.random(mKeepTop ? mRadius + 10 : 0, h);
}
@Override
@@ -179,6 +179,7 @@ public class GalleryListActivity extends AbsTranslucentActivity implements View.
private Button mLogoutButton;
private View mWaitLogView;
private View mRightDrawerBg;
private TagListView mQuickSearchList;
private View mQuickSearchTip;
@@ -1037,10 +1038,10 @@ public class GalleryListActivity extends AbsTranslucentActivity implements View.
mLogoutButton = (Button) mUserPanel.findViewById(R.id.logout);
mWaitLogView = mUserPanel.findViewById(R.id.wait);
mRightDrawerBg = mRightMenu.findViewById(R.id.background);
mQuickSearchList = (TagListView) mRightMenu.findViewById(R.id.list_menu_tag_list);
mQuickSearchTip = mRightMenu.findViewById(R.id.tip_text);
mLoginButton.setOnClickListener(this);
mRegisterButton.setOnClickListener(this);
mLogoutButton.setOnClickListener(this);
@@ -1136,8 +1137,10 @@ public class GalleryListActivity extends AbsTranslucentActivity implements View.
}
});
List<String> keys = mData.getAllTagNames();
mRightDrawerBg.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
mRightDrawerBg.setBackgroundDrawable(new FreeMaterialDrawable().setBgIndex(2).setKeepTop(true));
List<String> keys = mData.getAllTagNames();
for (int i = 0; i < keys.size(); i++)
listMenuTag.add(keys.get(i));
tagsAdapter = new TagsAdapter(this, R.layout.menu_tag, listMenuTag);
@@ -1154,6 +1157,7 @@ public class GalleryListActivity extends AbsTranslucentActivity implements View.
mQuickSearchTip.setVisibility(View.VISIBLE);
else
mQuickSearchTip.setVisibility(View.GONE);
mQuickSearchList.setClipToPadding(false);
mQuickSearchList.setAdapter(tagsAdapter);
mQuickSearchList.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
@@ -1218,7 +1222,7 @@ public class GalleryListActivity extends AbsTranslucentActivity implements View.
mThemeColor = Config.getRandomThemeColor() ? Theme.getRandomDarkColor() : Config.getThemeColor();
mActionBar.setBackgroundDrawable(new ColorDrawable(mThemeColor));
//mLeftMenu.setBackgroundColor(mThemeColor);
mRightMenu.setBackgroundColor(mThemeColor);
//mRightMenu.setBackgroundColor(mThemeColor);
Ui.colorStatusBarL(this, mThemeColor);
// Update user panel