Skip to content

Commit 26bdb07

Browse files
committed
Added Upload Activity for publishing activity application
1 parent 73c721f commit 26bdb07

5 files changed

Lines changed: 112 additions & 27 deletions

File tree

Lines changed: 34 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,92 +1,99 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<manifest package="org.buildmlearn.toolkit"
3-
xmlns:android="http://schemas.android.com/apk/res/android">
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="org.buildmlearn.toolkit" >
44

5-
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
6-
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
7-
<uses-permission android:name="android.permission.INTERNET"/>
5+
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
6+
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
7+
<uses-permission android:name="android.permission.INTERNET" />
88

99
<uses-feature
1010
android:name="android.hardware.camera"
11-
android:required="true"/>
11+
android:required="true" />
1212

1313
<application
1414
android:name=".ToolkitApplication"
1515
android:allowBackup="true"
1616
android:icon="@mipmap/ic_launcher"
1717
android:label="@string/app_name"
18-
android:theme="@style/AppTheme">
18+
android:theme="@style/AppTheme" >
1919
<activity
2020
android:name=".activity.HomeActivity"
2121
android:label="@string/app_name"
22-
android:theme="@style/AppTheme.NoActionBar">
22+
android:theme="@style/AppTheme.NoActionBar" >
2323
</activity>
2424
<activity
2525
android:name=".simulator.Simulator"
2626
android:label="@string/title_activity_simulator"
2727
android:screenOrientation="portrait"
28-
android:theme="@style/Buildmlearn.FullScreen"/>
28+
android:theme="@style/Buildmlearn.FullScreen" />
2929
<activity
3030
android:name=".activity.TemplateActivity"
3131
android:label="@string/title_activity_template"
3232
android:parentActivityName=".activity.HomeActivity"
33-
android:theme="@style/AppTheme.NoActionBar">
33+
android:theme="@style/AppTheme.NoActionBar" >
3434
<meta-data
3535
android:name="android.support.PARENT_ACTIVITY"
36-
android:value="org.buildmlearn.toolkit.activity.HomeActivity"/>
36+
android:value="org.buildmlearn.toolkit.activity.HomeActivity" />
3737
</activity>
3838
<activity
3939
android:name=".activity.TemplateEditor"
4040
android:label="@string/title_activity_template_editor"
41-
android:theme="@style/AppTheme.NoActionBar">
42-
41+
android:theme="@style/AppTheme.NoActionBar" >
4342
</activity>
4443

4544
<meta-data
4645
android:name="io.fabric.ApiKey"
47-
android:value="c1d33469d628f14f5b248cb6d6dcf6de726ef5e3"/>
46+
android:value="c1d33469d628f14f5b248cb6d6dcf6de726ef5e3" />
4847

4948
<activity
5049
android:name=".activity.FirstRunActivity"
5150
android:label="@string/app_name"
5251
android:theme="@style/Buildmlearn.FullScreen"
53-
android:windowSoftInputMode="adjustPan">
52+
android:windowSoftInputMode="adjustPan" >
5453
<intent-filter>
55-
<action android:name="android.intent.action.MAIN"/>
54+
<action android:name="android.intent.action.MAIN" />
5655

57-
<category android:name="android.intent.category.LAUNCHER"/>
56+
<category android:name="android.intent.category.LAUNCHER" />
5857
</intent-filter>
5958
</activity>
6059
<activity
6160
android:name=".activity.TutorialActivity"
6261
android:label="@string/title_activity_tutorial"
63-
android:theme="@style/Buildmlearn.FullScreen">
62+
android:theme="@style/Buildmlearn.FullScreen" >
6463
</activity>
6564
<activity
6665
android:name=".activity.AboutBuildmLearn"
6766
android:label="@string/title_activity_about_buildm_learn"
6867
android:parentActivityName=".activity.HomeActivity"
69-
android:theme="@style/AppTheme.NoActionBar">
68+
android:theme="@style/AppTheme.NoActionBar" >
7069
<meta-data
7170
android:name="android.support.PARENT_ACTIVITY"
72-
android:value="org.buildmlearn.toolkit.activity.HomeActivity"/>
71+
android:value="org.buildmlearn.toolkit.activity.HomeActivity" />
7372
</activity>
7473
<activity
7574
android:name=".activity.DeepLinkerActivity"
76-
android:label="@string/title_activity_deep_linker">
75+
android:label="@string/title_activity_deep_linker" >
7776
<intent-filter
7877
android:icon="@mipmap/ic_launcher"
7978
android:label="@string/app_name"
80-
android:priority="1">
81-
<action android:name="android.intent.action.VIEW"/>
79+
android:priority="1" >
80+
<action android:name="android.intent.action.VIEW" />
8281

83-
<category android:name="android.intent.category.DEFAULT"/>
82+
<category android:name="android.intent.category.DEFAULT" />
8483

85-
<data android:scheme="file"/>
86-
<data android:host="*"/>
87-
<data android:pathPattern=".*\\.buildmlearn"/>
84+
<data android:scheme="file" />
85+
<data android:host="*" />
86+
<data android:pathPattern=".*\\.buildmlearn" />
8887
</intent-filter>
8988
</activity>
89+
<activity
90+
android:name=".activity.UploadActivity"
91+
android:label="@string/title_activity_upload"
92+
android:parentActivityName=".activity.TemplateEditor" >
93+
<meta-data
94+
android:name="android.support.PARENT_ACTIVITY"
95+
android:value="org.buildmlearn.toolkit.activity.TemplateEditor" />
96+
</activity>
9097
</application>
9198

9299
</manifest>
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
package org.buildmlearn.toolkit.activity;
2+
3+
import android.support.v7.app.AppCompatActivity;
4+
import android.os.Bundle;
5+
import android.view.Menu;
6+
import android.view.MenuItem;
7+
8+
import org.buildmlearn.toolkit.R;
9+
10+
public class UploadActivity extends AppCompatActivity {
11+
12+
@Override
13+
protected void onCreate(Bundle savedInstanceState) {
14+
super.onCreate(savedInstanceState);
15+
setContentView(R.layout.activity_upload);
16+
}
17+
18+
@Override
19+
public boolean onCreateOptionsMenu(Menu menu) {
20+
// Inflate the menu; this adds items to the action bar if it is present.
21+
getMenuInflater().inflate(R.menu.menu_upload, menu);
22+
return true;
23+
}
24+
25+
@Override
26+
public boolean onOptionsItemSelected(MenuItem item) {
27+
// Handle action bar item clicks here. The action bar will
28+
// automatically handle clicks on the Home/Up button, so long
29+
// as you specify a parent activity in AndroidManifest.xml.
30+
int id = item.getItemId();
31+
32+
//noinspection SimplifiableIfStatement
33+
if (id == R.id.action_settings) {
34+
return true;
35+
}
36+
37+
return super.onOptionsItemSelected(item);
38+
}
39+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
2+
xmlns:tools="http://schemas.android.com/tools"
3+
android:layout_width="match_parent"
4+
android:layout_height="match_parent"
5+
android:orientation="vertical"
6+
tools:context="$activity">
7+
8+
<android.support.v7.widget.Toolbar
9+
android:id="@+id/toolbar"
10+
style="@style/Toolbar.Buildmlearn"
11+
android:layout_width="match_parent"
12+
android:layout_height="?attr/actionBarSize"/>
13+
14+
<RelativeLayout
15+
android:layout_width="match_parent"
16+
android:layout_height="match_parent"
17+
android:paddingBottom="@dimen/activity_vertical_margin"
18+
android:paddingLeft="@dimen/activity_horizontal_margin"
19+
android:paddingRight="@dimen/activity_horizontal_margin"
20+
android:paddingTop="@dimen/activity_vertical_margin">
21+
22+
<TextView
23+
android:layout_width="wrap_content"
24+
android:layout_height="wrap_content"
25+
android:text="@string/hello_world"/>
26+
</RelativeLayout>
27+
28+
29+
</LinearLayout>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<menu xmlns:android="http://schemas.android.com/apk/res/android"
2+
xmlns:app="http://schemas.android.com/apk/res-auto"
3+
xmlns:tools="http://schemas.android.com/tools"
4+
tools:context="org.buildmlearn.toolkit.activity.UploadActivity">
5+
<item android:id="@+id/action_settings"
6+
android:title="@string/action_settings"
7+
android:orderInCategory="100"
8+
app:showAsAction="never"/>
9+
</menu>

source-code/app/src/main/res/values/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,4 +410,5 @@
410410
<item>History</item>
411411
<item>Chemistry</item>
412412
</string-array>
413+
<string name="title_activity_upload">Upload Application</string>
413414
</resources>

0 commit comments

Comments
 (0)