Commit ae0ed21d authored by Alan McNatty's avatar Alan McNatty
Browse files

Commit that includes the bulk of the work towards a new theme as per the default online style

parent d93a3071
......@@ -4,10 +4,10 @@
android:versionCode="7"
android:versionName="1.7">
<application android:icon="@drawable/icon" android:label="@string/app_name"
android:debuggable="false" >
android:debuggable="true" >
<activity android:name=".ui.ArtefactExpandableListAdapterActivity"
android:label="@string/app_name" >
android:theme="@style/MaharaTheme">
<!--
<activity android:name=".ui.ArtefactExpandableListAdapterActivity"
android:label="@string/options_menu_viewsaved" /> -->
......@@ -31,7 +31,8 @@
</intent-filter>
</activity>
<activity android:name=".ui.ArtifactSettingsActivity" android:label="@string/artifactsettings">
<activity android:name=".ui.ArtifactSettingsActivity"
android:theme="@style/MaharaTheme">
<intent-filter>
<action android:name="nz.net.catalyst.MaharaDroid.ARTEFACTSETTINGS" />
<category android:name="android.intent.category.DEFAULT" />
......@@ -45,7 +46,8 @@
</intent-filter>
</activity>
<activity android:name=".upload.ArtifactSenderActivity" android:icon="@drawable/icon" android:label="@string/app_name"
<activity android:name=".upload.ArtifactSenderActivity"
android:icon="@drawable/icon" android:label="@string/app_name"
android:enabled="true" android:exported="true">
<intent-filter>
<action android:name="android.intent.action.SEND" />
......@@ -61,7 +63,8 @@
<data android:mimeType="text/xml" />
</intent-filter>
</activity>
<activity android:name=".ui.EditPreferences"
<activity
android:name=".ui.EditPreferences"
android:label="@string/options_menu_prefs" />
<service android:name=".upload.TransferService" android:label="@string/filetransfers"/>
......
res/drawable/banner.png

11.4 KB | W: | H:

res/drawable/banner.png

16.3 KB | W: | H:

res/drawable/banner.png
res/drawable/banner.png
res/drawable/banner.png
res/drawable/banner.png
  • 2-up
  • Swipe
  • Onion skin
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_expanded="true" android:drawable="@drawable/arrow_down" />
<item android:drawable="@drawable/arrow_right" />
</selector>
\ No newline at end of file
......@@ -3,6 +3,7 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:paddingLeft="40dp"
......
<?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="wrap_content"
android:orientation="vertical">
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
style="@style/itemBackground"
>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ArtifactTitleLayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="horizontal">
android:orientation="horizontal"
android:visibility="gone">
<TextView android:text="@string/upload_title_label"
android:layout_width="50dip"
android:layout_width="50dp"
android:singleLine="false"
android:layout_height="wrap_content"
android:textStyle="bold"
......@@ -38,7 +40,7 @@
android:orientation="horizontal">
<TextView android:text="@string/upload_description_label"
android:layout_width="50dip"
android:layout_width="50dp"
android:singleLine="false"
android:layout_height="wrap_content"
android:textStyle="bold"
......@@ -59,7 +61,7 @@
android:orientation="horizontal">
<TextView android:text="@string/upload_tags_label"
android:layout_width="50dip"
android:layout_width="50dp"
android:singleLine="false"
android:layout_height="wrap_content"
android:textStyle="bold"
......@@ -81,7 +83,7 @@
android:orientation="horizontal">
<TextView android:text="@string/upload_time_label"
android:layout_width="50dip"
android:layout_width="50dp"
android:singleLine="false"
android:layout_height="wrap_content"
android:textStyle="bold"
......@@ -94,6 +96,42 @@
style="@android:style/TextAppearance.Small">
</TextView>
</LinearLayout>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ArtifactSettingsButtonLayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:gravity="center_horizontal"
android:orientation="horizontal">
<Button android:text="@string/btnupload"
android:id="@+id/btnUpload"
android:layout_weight="1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
style="@style/MaharaButton"
>
</Button>
<Button android:text="@string/btnview"
android:id="@+id/btnView"
android:layout_weight="1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
style="@style/MaharaButton"
>
</Button>
<Button android:text="@string/btndelete"
android:id="@+id/btnDelete"
android:layout_weight="1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
style="@style/MaharaButton"
>
</Button>
</LinearLayout>
<TextView android:id="@+id/txtArtifactFilename"
android:singleLine="true"
android:layout_width="fill_parent"
......
......@@ -6,92 +6,113 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#fff"
android:id="@+id/top"
android:layout_gravity="left"
android:padding="10dp"
>
<ImageView
android:id="@+id/banner"
android:layout_width="fill_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="2dp"
android:src="@drawable/banner"
android:layout_gravity="left"
android:scaleType="fitStart"
/>
</RelativeLayout>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/middle"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingBottom="10dp"
android:layout_below="@+id/top"
>
<TextView android:id="@+id/banner_text"
android:text="@string/artefacts_banner_text"
android:layout_width="wrap_content"
android:singleLine="false"
android:layout_height="wrap_content"
android:textStyle="bold"
android:layout_margin="5dp"
style="@android:style/TextAppearance.Large"
android:layout_below="@+id/banner"
/>
<TextView android:id="@+id/banner_text2"
android:text="@string/artefacts_banner_text2"
android:layout_margin="5dp"
android:layout_width="fill_parent"
android:singleLine="false"
android:layout_height="wrap_content"
style="@android:style/TextAppearance.Small"
android:layout_below="@+id/banner_text"
/>
</RelativeLayout>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/bottom_heading"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#333"
android:layout_below="@+id/middle"
>
<TextView android:id="@+id/saved_artefacts_header"
android:text="@string/options_menu_viewsaved"
android:layout_margin="5dp"
android:layout_width="fill_parent"
android:singleLine="true"
android:layout_height="wrap_content"
style="@android:style/TextAppearance.Medium"
android:layout_below="@+id/banner_text2"
/>
</RelativeLayout>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/bottom"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#000"
android:layout_below="@+id/bottom_heading"
>
<ExpandableListView android:id="@+id/listView"
android:scrollbars="none"
android:choiceMode="multipleChoice"
android:fastScrollEnabled="true"
android:layout_below="@+id/saved_artefacts_header"
android:layout_weight="1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:visibility="gone"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/gradient"
android:layout_below="@+id/top"
android:background="@drawable/gradient"
>
</RelativeLayout>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/middle"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/gradient"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="10dp"
android:layout_marginTop="0dp"
>
<TextView android:id="@+id/banner_text"
android:text="@string/artefacts_banner_text"
android:layout_width="wrap_content"
android:singleLine="false"
android:layout_height="wrap_content"
android:textStyle="bold"
style="@android:style/TextAppearance.Large"
android:layout_below="@+id/banner"
/>
<TextView android:id="@+id/no_saved_artefacts"
android:text="@string/artefacts_no_saved_artefacts"
android:layout_margin="0dp"
android:layout_width="fill_parent"
android:singleLine="true"
android:layout_height="wrap_content"
style="@android:style/TextAppearance.Small"
android:layout_below="@+id/listView"
android:visibility="gone"
/>
</RelativeLayout>
<TextView android:id="@+id/banner_text2"
android:text="@string/artefacts_banner_text2"
android:layout_width="fill_parent"
android:singleLine="false"
android:layout_height="wrap_content"
style="@android:style/TextAppearance.Small"
android:layout_below="@+id/banner_text"
/>
</RelativeLayout>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/bottom_heading"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
style="@style/headerBackground"
android:layout_below="@+id/middle"
>
<ImageView
android:id="@+id/saved"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/saved"
android:layout_gravity="left"
android:layout_marginLeft="10dp"
/>
<TextView android:id="@+id/saved_artefacts_header"
android:text="@string/options_menu_viewsaved"
android:layout_width="fill_parent"
android:singleLine="true"
android:layout_height="wrap_content"
style="@style/headerText"
android:layout_below="@+id/banner_text2"
android:layout_marginLeft="10dp"
android:gravity="left|bottom"
android:layout_toRightOf="@id/saved"
android:layout_centerInParent="true"
/>
</RelativeLayout>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/bottom"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/bottom_heading"
android:layout_margin="5dp"
>
<ExpandableListView android:id="@+id/listView"
android:scrollbars="none"
android:choiceMode="multipleChoice"
android:fastScrollEnabled="true"
android:layout_below="@+id/saved_artefacts_header"
android:layout_weight="1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:visibility="gone"
android:headerDividersEnabled="true"
android:footerDividersEnabled="true"
android:groupIndicator="@drawable/expander_group"
/>
<!-- -->
<TextView android:id="@+id/no_saved_artefacts"
android:text="@string/artefacts_no_saved_artefacts"
android:layout_margin="0dp"
android:layout_width="fill_parent"
android:singleLine="true"
android:layout_height="wrap_content"
style="@android:style/TextAppearance.Small"
android:layout_below="@+id/listView"
android:visibility="gone"
/>
</RelativeLayout>
</RelativeLayout>
\ No newline at end of file
......@@ -16,7 +16,6 @@
android:id="@+id/ArtifactConfirmLayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="horizontal">
<CheckBox android:text="@string/upload_confirm_label"
......@@ -127,24 +126,28 @@
<Button android:text="@string/btnupload"
android:id="@+id/btnUpload"
android:layout_weight="1"
android:layout_width="wrap_content"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:enabled="false"
style="@style/MaharaButton"
>
</Button>
<Button android:text="@string/btnsave"
android:id="@+id/btnSave"
android:layout_weight="1"
android:layout_width="wrap_content"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:enabled="false"
style="@style/MaharaButton"
>
</Button>
<Button android:text="@string/btncancellabel"
android:id="@+id/btnCancel"
android:layout_weight="1"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
android:layout_width="fill_parent"
android:layout_height="wrap_content"
style="@style/MaharaButton"
>
</Button>
</LinearLayout>
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
>
<ImageView
android:id="@+id/windowtitle_icon"
android:src="@drawable/windowtitle_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_weight="0"
android:padding="0dp"
android:layout_margin="0dp"
android:scaleType="fitStart"
/>
<TextView
android:id="@+id/windowtitle_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="0dp"
android:layout_margin="0dp"
android:layout_weight="1"
android:text="Holding Text"
android:layout_gravity="left|center_vertical"
style="@style/MaharaWindowTitleText"
/>
</LinearLayout>
\ No newline at end of file
......@@ -2,7 +2,7 @@
<resources>
<string name="app_name">MaharaDroid</string>
<string name="artefacts_banner_text">Open source eportfolios</string>
<string name="artefacts_banner_text">Open source e-portfolios</string>
<string name="artefacts_banner_text2">[mah-har-rah;verb]: to think, thinking, thought</string>
<string name="artefacts_no_saved_artefacts">No saved artefacts</string>
......@@ -65,7 +65,9 @@
<string name="btnok">OK</string>
<string name="btnupload">Upload</string>
<string name="btnsave">Save</string>
<string name="btndelete">Delete</string>
<string name="btnsendlabel">Send</string>
<string name="btnview">View</string>
<string name="btncancellabel">Cancel</string>
<string name="lbluploadoptions">Upload Settings</string>
......
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!--
Title Background: #EFD3F6
Font-Color: #3986C3
Details Background: #F9FBFC
Details top border-top: #D0E4F3
Active text field border: #6398C1
-->
<style name="MaharaTheme" parent="@android:style/Theme.Light">
<item name="android:typeface">sans</item>
<item name="android:listDivider">@android:drawable/divider_horizontal_bright</item>
<item name="android:windowTitleSize">38dp</item>
<item name="android:windowTitleStyle">@style/MaharaWindowTitle</item>
<item name="android:windowTitleBackgroundStyle">@style/MaharaWindowTitleBackground</item>
</style>
<style name="headerText" parent="android:TextAppearance.Medium">
<item name="android:textColor">#3786c1</item>
</style>
<style name="headerBackground">
<item name="android:background">#fff</item>
</style>
<style name="itemBackground">
<item name="android:background">#fff</item>
<item name="android:layout_marginTop">5dp</item>
<item name="android:layout_marginLeft">5dp</item>
<item name="android:layout_marginRight">5dp</item>
<item name="android:paddingTop">5dp</item>
<item name="android:paddingLeft">5dp</item>
<item name="android:paddingRight">5dp</item>
</style>
<style name="MaharaButton">
<item name="android:background">@drawable/button</item>
<item name="android:textColor">#fff</item>
<item name="android:padding">2dp</item>
<item name="android:layout_margin">2dp</item>
</style>
<style name="MaharaWindowTitleText" parent="android:TextAppearance.WindowTitle">
<item name="android:textSize">16dip</item>
<!--
<item name="android:textColor">#FFF</item>
<item name="android:textStyle">normal</item>
-->
</style>
<style name="MaharaWindowTitleBackground">
<item name="android:background">@drawable/windowtitle_background</item>
</style>
<!-- Set the theme for the window title -->
<!-- NOTE: setting android:textAppearence to style defined above -->
<style name="MaharaWindowTitle" parent="android:WindowTitle">
<item name="android:textAppearance">@style/MaharaWindowTitleText</item>
</style>
</resources>
\ No newline at end of file
......@@ -30,6 +30,7 @@ import nz.net.catalyst.MaharaDroid.data.Artefact;
import nz.net.catalyst.MaharaDroid.data.ArtefactDataSQLHelper;
import nz.net.catalyst.MaharaDroid.ui.about.AboutActivity;
import android.app.Activity;
import android.app.ExpandableListActivity;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
......@@ -46,15 +47,20 @@ import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.ContextMenu.ContextMenuInfo;
import android.view.View.OnClickListener;
import android.view.View.OnCreateContextMenuListener;
import android.widget.BaseExpandableListAdapter;
import android.widget.Button;
import android.widget.ExpandableListView;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.ExpandableListView.ExpandableListContextMenuInfo;
import android.widget.ExpandableListView.OnChildClickListener;
public class ArtefactExpandableListAdapterActivity extends Activity implements OnChildClickListener, OnCreateContextMenuListener {
public class ArtefactExpandableListAdapterActivity extends Activity implements OnCreateContextMenuListener {
static final String TAG = LogConfig.getLogTag(ArtefactExpandableListAdapterActivity.class);
// whether DEBUG level logging is enabled (whether globally, or explicitly
// for this log tag)
......@@ -73,10 +79,16 @@ public class ArtefactExpandableListAdapterActivity extends Activity implements O
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
setContentView(R.layout.artefacts);
getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.windowtitle);
((TextView) findViewById(R.id.windowtitle_text)).setText(getString(R.string.app_name));
((ImageView) findViewById(R.id.windowtitle_icon)).setImageResource(R.drawable.windowtitle_icon);
listview = (ExpandableListView) findViewById(R.id.listView);
listview.setOnChildClickListener(this);
// listview.setOnChildClickListener(this);
registerForContextMenu(listview);
loadSavedArtefacts();
......@@ -232,7 +244,7 @@ public class ArtefactExpandableListAdapterActivity extends Activity implements O
}
public class ExpandableListAdapter extends BaseExpandableListAdapter implements OnChildClickListener, OnCreateContextMenuListener {
public class ExpandableListAdapter extends BaseExpandableListAdapter implements OnClickListener, OnCreateContextMenuListener {
@Override
public boolean areAllItemsEnabled()
......@@ -302,6 +314,12 @@ public class ArtefactExpandableListAdapterActivity extends Activity implements O
tv = (TextView) convertView.findViewById(R.id.txtArtifactTags);
tv.setText(art.getTags());
((Button) convertView.findViewById(R.id.btnUpload)).setOnClickListener(this);
((Button) convertView.findViewById(R.id.btnUpload)).setTag(art);
((Button) convertView.findViewById(R.id.btnView)).setOnClickListener(this);
((Button) convertView.findViewById(R.id.btnView)).setTag(art);
((Button) convertView.findViewById(R.id.btnDelete)).setOnClickListener(this);
((Button) convertView.findViewById(R.id.btnDelete)).setTag(art);
return convertView;
}
......@@ -351,62 +369,69 @@ public class ArtefactExpandableListAdapterActivity extends Activity implements O
}
@Override
public boolean onChildClick(ExpandableListView parent, View v,
int groupPosition, int childPosition, long id) {
// TODO make this do the right thing
public void onClick(View v) {
Artefact a = (Artefact) getChild(groupPosition, childPosition);
uploadArtefact(a, false);
return true;
}
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.context, menu);
v.getTag();
if ( DEBUG )
Log.d(TAG, "onChildClick detected");
Artefact a = (Artefact) v.getTag();;
switch (v.getId()) {
case R.id.btnUpload:
uploadArtefact(a, false);
break;
case R.id.btnView:
viewArtefact(a);
break;
case R.id.btnDelete:
deleteSavedArtefact(a.getId());
loadSavedArtefacts();
break;
}
}