Translucent Theme for Actionbar

Conflicts:

	src/org/wikimedia/commons/CommonsApplication.java
This commit is contained in:
Isaac John Wesley 2012-10-07 14:58:00 +05:30 committed by YuviPanda
parent 650095c64f
commit 297d7226d6
8 changed files with 98 additions and 10 deletions

View file

@ -13,7 +13,7 @@
android:name=".CommonsApplication"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
android:theme="@style/Theme.Commons" >
<activity
android:name=".LoginActivity"
android:label="@string/title_activity_login"

View file

@ -11,4 +11,4 @@
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
# Project target.
target=android-15
target=android-14

View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient android:angle="90" android:startColor="#60ffffff" android:endColor="#40ffffff"/>
</shape>

View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:startColor="#70000000"
android:endColor="#00000000"
android:angle="270"
>
</gradient>
</shape>

View file

@ -1,16 +1,28 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<ImageView
android:id="@+id/backgroundImage"
android:layout_width="fill_parent"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:scaleType="centerCrop" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="12dp"
android:layout_marginTop="48dp"
android:background="@drawable/actionbar_top_shadow"
android:orientation="vertical" >
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -27,6 +39,7 @@
android:background="@drawable/share_overlay_background_gradient" >
<TextView
android:textColor="#818181"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/upload_overlay_title"
@ -34,6 +47,7 @@
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:textColor="#818181"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Title"
@ -46,9 +60,11 @@
android:layout_height="wrap_content"
android:singleLine="true"
android:scrollHorizontally="false"
android:textColor="#363636"
/>
<TextView
android:textColor="#818181"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Description"
@ -60,6 +76,7 @@
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:inputType="textMultiLine"
android:textColor="#363636"
/>
<Button
@ -72,3 +89,5 @@
</LinearLayout>
</RelativeLayout>
</FrameLayout>

38
res/layout/login.xml Normal file
View file

@ -0,0 +1,38 @@
<?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" >
<ListView
android:id="@+id/listView1"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</ListView>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/commonsLogo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="20dp"
android:src="@drawable/commons_logo_large" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="150dp"
android:layout_below="@+id/commonsLogo"
android:layout_centerHorizontal="true"
android:layout_marginTop="20dp"
android:orientation="vertical" >
</LinearLayout>
</RelativeLayout>
</FrameLayout>

12
res/values/theme.xml Normal file
View file

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.Commons" parent="android:style/Theme.Holo">
<item name="android:actionBarStyle">@style/ActionBar</item>
</style>
<style name="ActionBar" parent="android:style/Widget.Holo.ActionBar">
<item name="android:background">@drawable/action_bar_translucent</item>
</style>
</resources>

View file

@ -95,7 +95,12 @@ public class ShareActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//Actionbar overlay on top of imageview (should be called before .setcontentview)
getWindow().requestFeature(Window.FEATURE_ACTION_BAR_OVERLAY);
getActionBar().setDisplayShowTitleEnabled(false);
setContentView(R.layout.activity_share);
app = (CommonsApplication)this.getApplicationContext();
backgroundImageView = (ImageView)findViewById(R.id.backgroundImage);