Browse Source

Material design

History is the launch activity
FloatingButton for ask upload in historyActivity
tags/release-v2
Schoumi 4 years ago
parent
commit
74d51dcaa7
19 changed files with 505 additions and 277 deletions
  1. +9
    -7
      app/build.gradle
  2. +14
    -7
      app/src/main/AndroidManifest.xml
  3. +16
    -2
      app/src/main/java/fr/mobdev/goblim/activity/HistoryActivity.java
  4. +6
    -1
      app/src/main/java/fr/mobdev/goblim/activity/LinkActivity.java
  5. +6
    -2
      app/src/main/java/fr/mobdev/goblim/activity/ServersActivity.java
  6. +15
    -12
      app/src/main/java/fr/mobdev/goblim/activity/UploadActivity.java
  7. +0
    -84
      app/src/main/res/layout-land/main.xml
  8. +122
    -0
      app/src/main/res/layout-land/upload.xml
  9. +52
    -11
      app/src/main/res/layout/history.xml
  10. +74
    -48
      app/src/main/res/layout/link.xml
  11. +0
    -77
      app/src/main/res/layout/main.xml
  12. +48
    -20
      app/src/main/res/layout/servers.xml
  13. +104
    -0
      app/src/main/res/layout/upload.xml
  14. +0
    -5
      app/src/main/res/menu/menu_upload.xml
  15. +8
    -0
      app/src/main/res/values-v21/styles.xml
  16. +9
    -0
      app/src/main/res/values-v23/styles.xml
  17. +6
    -0
      app/src/main/res/values/colors.xml
  18. +11
    -0
      app/src/main/res/values/styles.xml
  19. +5
    -1
      build.gradle

+ 9
- 7
app/build.gradle View File

@@ -1,16 +1,17 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 22
buildToolsVersion "21.1.2"
compileSdkVersion 23
buildToolsVersion "23.0.2"

defaultConfig {
applicationId "fr.mobdev.goblim"
minSdkVersion 11
targetSdkVersion 22
versionCode 2
versionName "1.0"
minSdkVersion 15
targetSdkVersion 23
versionCode 3
versionName "2.0"
}

buildTypes {
release {
minifyEnabled false
@@ -21,5 +22,6 @@ android {

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
}

+ 14
- 7
app/src/main/AndroidManifest.xml View File

@@ -12,14 +12,13 @@
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name="fr.mobdev.goblim.activity.MainActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
android:name="fr.mobdev.goblim.activity.UploadActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar"
>
<intent-filter>
<action android:name="android.intent.action.SEND"/>
<category android:name="android.intent.category.DEFAULT"/>
@@ -28,16 +27,24 @@
</activity>
<activity
android:name="fr.mobdev.goblim.activity.HistoryActivity"
android:label="@string/title_activity_history">
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="fr.mobdev.goblim.activity.LinkActivity"
android:label="@string/title_activity_link"
android:theme="@style/AppTheme.NoActionBar"
>
</activity>
<activity
android:name="fr.mobdev.goblim.activity.ServersActivity"
android:label="@string/title_activity_servers"
android:theme="@style/AppTheme.NoActionBar"
>
</activity>
</application>


+ 16
- 2
app/src/main/java/fr/mobdev/goblim/activity/HistoryActivity.java View File

@@ -20,8 +20,10 @@ package fr.mobdev.goblim.activity;

import android.content.Context;
import android.content.Intent;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@@ -45,7 +47,7 @@ import fr.mobdev.goblim.R;
/*
* This Activity help user to find old shared pictures and re-share it if he wanted to
*/
public class HistoryActivity extends ActionBarActivity {
public class HistoryActivity extends AppCompatActivity {

private List<Img> images;

@@ -54,6 +56,18 @@ public class HistoryActivity extends ActionBarActivity {
super.onCreate(savedInstanceState);
setContentView(R.layout.history);

Toolbar toolbar = (Toolbar) findViewById(R.id.history_toolbar);
setSupportActionBar(toolbar);

FloatingActionButton new_image_button = (FloatingActionButton) findViewById(R.id.new_image_button);
new_image_button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent newIntent = new Intent(HistoryActivity.this,UploadActivity.class);
startActivity(newIntent);
}
});

ListView historyList = (ListView) findViewById(R.id.history_list);

updateHistory();


+ 6
- 1
app/src/main/java/fr/mobdev/goblim/activity/LinkActivity.java View File

@@ -23,6 +23,8 @@ import android.content.DialogInterface;
import android.content.Intent;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.ImageButton;
import android.widget.ImageView;
@@ -45,13 +47,16 @@ import fr.mobdev.goblim.objects.Img;
* Activity display the link of the uploaded picture and allow user to share it with other app
* or copy it to cleapboard
*/
public class LinkActivity extends ActionBarActivity {
public class LinkActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.link);

Toolbar toolbar = (Toolbar) findViewById(R.id.link_toolbar);
setSupportActionBar(toolbar);

//get url information
Intent receiveIntent = getIntent();
Long imageId = receiveIntent.getLongExtra("imageId", -1);


+ 6
- 2
app/src/main/java/fr/mobdev/goblim/activity/ServersActivity.java View File

@@ -22,8 +22,9 @@ import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.graphics.Typeface;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
@@ -47,7 +48,7 @@ import fr.mobdev.goblim.R;
/*
* Activity that allow user to manage the server where he want to upload his images. Server must be lutim instance to work with the app
*/
public class ServersActivity extends ActionBarActivity {
public class ServersActivity extends AppCompatActivity {

private List<Server> dbServers;
private View.OnClickListener listener;
@@ -57,6 +58,9 @@ public class ServersActivity extends ActionBarActivity {
super.onCreate(savedInstanceState);
setContentView(R.layout.servers);

Toolbar toolbar = (Toolbar) findViewById(R.id.servers_toolbar);
setSupportActionBar(toolbar);

ListView serverList = (ListView) findViewById(R.id.servers_list);
serverList.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
@Override


app/src/main/java/fr/mobdev/goblim/activity/MainActivity.java → app/src/main/java/fr/mobdev/goblim/activity/UploadActivity.java View File

@@ -25,8 +25,9 @@ import android.content.pm.ActivityInfo;
import android.graphics.Bitmap;
import android.net.Uri;
import android.provider.MediaStore;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
@@ -56,7 +57,7 @@ import fr.mobdev.goblim.R;
* This Activity let user access to the others activities in order to manage history, servers and after an upload
* the shared options of the given link
*/
public class MainActivity extends ActionBarActivity {
public class UploadActivity extends AppCompatActivity {

private NetworkAdapter listener;
private Uri imageUri;
@@ -74,7 +75,12 @@ public class MainActivity extends ActionBarActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
setContentView(R.layout.upload);

Toolbar toolbar = (Toolbar) findViewById(R.id.upload_toolbar);
setSupportActionBar(toolbar);

setTitle(R.string.upload_pict);

//prepare data used for upload
imageUri = null;
@@ -120,7 +126,7 @@ public class MainActivity extends ActionBarActivity {
progressDialog.dismiss();
resetImage();
//launch LinkActivity
Intent linkIntent = new Intent(MainActivity.this,LinkActivity.class);
Intent linkIntent = new Intent(UploadActivity.this,LinkActivity.class);
linkIntent.putExtra("imageId", id);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR);
startActivity(linkIntent);
@@ -134,7 +140,7 @@ public class MainActivity extends ActionBarActivity {
@Override
public void run() {
//display toast error
Toast.makeText(MainActivity.this, error, Toast.LENGTH_SHORT).show();
Toast.makeText(UploadActivity.this, error, Toast.LENGTH_SHORT).show();
if(progressDialog != null) {
progressDialog.dismiss();
progressDialog = null;
@@ -247,7 +253,7 @@ public class MainActivity extends ActionBarActivity {
runOnUiThread(new Runnable() {
@Override
public void run() {
Toast.makeText(MainActivity.this, getString(R.string.server_list_error), Toast.LENGTH_LONG).show();
Toast.makeText(UploadActivity.this, getString(R.string.server_list_error), Toast.LENGTH_LONG).show();
}
});
return;
@@ -293,7 +299,7 @@ public class MainActivity extends ActionBarActivity {
runOnUiThread(new Runnable() {
@Override
public void run() {
progressDialog = new ProgressDialog(MainActivity.this);
progressDialog = new ProgressDialog(UploadActivity.this);
progressDialog.setMessage(getString(R.string.upload_progress));
progressDialog.setCancelable(false);
progressDialog.show();
@@ -346,7 +352,7 @@ public class MainActivity extends ActionBarActivity {

@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu_main, menu);
getMenuInflater().inflate(R.menu.menu_upload, menu);
return true;
}

@@ -357,9 +363,6 @@ public class MainActivity extends ActionBarActivity {
if (id == R.id.action_manage_server) {
newIntent = new Intent(this,ServersActivity.class);
}
else if (id == R.id.action_show_history){
newIntent = new Intent(this,HistoryActivity.class);
}
if(newIntent != null)
{
startActivity(newIntent);
@@ -368,4 +371,4 @@ public class MainActivity extends ActionBarActivity {

return super.onOptionsItemSelected(item);
}
}
}

+ 0
- 84
app/src/main/res/layout-land/main.xml View File

@@ -1,84 +0,0 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".MainActivity">

<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/upload_pict"
android:id="@+id/upload_button"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="25dp"
/>

<Button
android:layout_above="@+id/upload_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/select_pict"
android:id="@+id/select_button"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="25dp"
/>
<LinearLayout
android:id="@+id/spinners_layout"
android:orientation="horizontal"
android:layout_above="@+id/select_button"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<Spinner
android:layout_weight="50"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/servers_spinner"
android:layout_marginLeft="25dp"
/>
<LinearLayout
android:layout_weight="50"
android:orientation="horizontal"
android:id="@+id/layout_days"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="25dp"
android:gravity="center_vertical"
>
<TextView
android:text="@string/duration"
android:singleLine="false"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"/>
<Spinner
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/delete_day_spinner"
android:entries="@array/deleted_days"
/>
</LinearLayout>
</LinearLayout>

<ImageView
android:layout_above="@+id/spinners_layout"
android:layout_below="@+id/reset_button"
android:id="@+id/thumbnail_main"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
/>

<ImageButton
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginBottom="10dp"
android:src="@android:drawable/ic_delete"
android:id="@+id/reset_button"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
/>

</RelativeLayout>

+ 122
- 0
app/src/main/res/layout-land/upload.xml View File

@@ -0,0 +1,122 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:fitsSystemWindows="true"
android:layout_height="match_parent"
android:layout_width="match_parent"
tools:context="fr.mobdev.goblim.activity.HistoryActivity"
>

<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.PopupOverlay">

<android.support.v7.widget.Toolbar
android:id="@+id/upload_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay"
/>
</android.support.design.widget.AppBarLayout>

<RelativeLayout
app:layout_behavior="@string/appbar_scrolling_view_behavior"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/upload_pict"
android:id="@+id/upload_button"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="25dp"
/>

<Button
android:layout_above="@+id/upload_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/select_pict"
android:id="@+id/select_button"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="25dp"
/>
<LinearLayout
android:id="@+id/spinners_layout"
android:orientation="horizontal"
android:layout_above="@+id/select_button"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<Spinner
android:layout_weight="50"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/servers_spinner"
android:layout_marginLeft="25dp"
/>
<LinearLayout
android:layout_weight="50"
android:orientation="horizontal"
android:id="@+id/layout_days"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="25dp"
android:gravity="center_vertical"
>
<TextView
android:text="@string/duration"
android:singleLine="false"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"/>
<Spinner
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/delete_day_spinner"
android:entries="@array/deleted_days"
/>
</LinearLayout>
</LinearLayout>

<ImageView
android:layout_above="@+id/spinners_layout"
android:layout_below="@+id/reset_button"
android:id="@+id/thumbnail_main"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
/>

<ImageButton
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginBottom="10dp"
android:src="@android:drawable/ic_delete"
android:id="@+id/reset_button"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
/>

</RelativeLayout>

<android.support.design.widget.FloatingActionButton
android:id="@+id/new_image_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="16dp"
android:src="@android:drawable/stat_sys_upload_done"
/>

</android.support.design.widget.CoordinatorLayout>

+ 52
- 11
app/src/main/res/layout/history.xml View File

@@ -1,13 +1,54 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin" tools:context="fr.mobdev.goblim.activity.HistoryActivity">

<ListView
android:id="@+id/history_list"
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:fitsSystemWindows="true"
android:layout_height="match_parent"
android:layout_width="match_parent"
tools:context="fr.mobdev.goblim.activity.HistoryActivity"
>

<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.PopupOverlay">

<android.support.v7.widget.Toolbar
android:id="@+id/history_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay"
/>
</android.support.design.widget.AppBarLayout>

<RelativeLayout
app:layout_behavior="@string/appbar_scrolling_view_behavior"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
android:layout_height="match_parent"
>

<ListView
android:id="@+id/history_list"
android:layout_width="match_parent"
android:layout_height="match_parent"/>

</RelativeLayout>

<android.support.design.widget.FloatingActionButton
android:id="@+id/new_image_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="16dp"
android:src="@android:drawable/stat_sys_upload"
app:borderWidth="0dp"
app:elevation="0dp"
/>

</RelativeLayout>
</android.support.design.widget.CoordinatorLayout>

+ 74
- 48
app/src/main/res/layout/link.xml View File

@@ -1,61 +1,87 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:fitsSystemWindows="true"
android:layout_height="match_parent"
android:layout_width="match_parent"
tools:context="fr.mobdev.goblim.activity.LinkActivity"
>

<ImageView
android:layout_above="@+id/link"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.PopupOverlay">

<android.support.v7.widget.Toolbar
android:id="@+id/link_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay"
/>
</android.support.design.widget.AppBarLayout>

<RelativeLayout
app:layout_behavior="@string/appbar_scrolling_view_behavior"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/thumbnail_link"
android:layout_gravity="center_horizontal"/>
>
<ImageView
android:layout_above="@+id/link"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/thumbnail_link"
android:layout_gravity="center_horizontal"
/>

<TextView
android:layout_above="@+id/buttons_layout"
android:layout_centerHorizontal="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:gravity="center_vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:autoLink="web"
android:id="@+id/link"
android:layout_marginBottom="30dp"
<TextView
android:layout_above="@+id/buttons_layout"
android:layout_centerHorizontal="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:gravity="center_vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:autoLink="web"
android:id="@+id/link"
android:layout_marginBottom="30dp"
/>

<LinearLayout
android:layout_alignParentBottom="true"
android:gravity="center"
android:id="@+id/buttons_layout"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
<LinearLayout
android:layout_alignParentBottom="true"
android:gravity="center"
android:id="@+id/buttons_layout"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<ImageButton
android:id="@+id/copy_clipboard_button"
android:src="@drawable/abc_ic_menu_copy_mtrl_am_alpha"
android:layout_width="60dp"
android:layout_height="60dp"
<ImageButton
android:id="@+id/copy_clipboard_button"
android:src="@drawable/abc_ic_menu_copy_mtrl_am_alpha"
android:layout_width="60dp"
android:layout_height="60dp"
/>

<ImageButton
android:src="@android:drawable/ic_menu_share"
android:id="@+id/share_button"
android:layout_width="60dp"
android:layout_height="60dp"
<ImageButton
android:src="@android:drawable/ic_menu_share"
android:id="@+id/share_button"
android:layout_width="60dp"
android:layout_height="60dp"
/>

<ImageButton
android:src="@android:drawable/ic_menu_delete"
android:layout_width="60dp"
android:layout_height="60dp"
android:id="@+id/delete_button" />
</LinearLayout>
</RelativeLayout>
<ImageButton
android:src="@android:drawable/ic_menu_delete"
android:layout_width="60dp"
android:layout_height="60dp"
android:id="@+id/delete_button"
/>
</LinearLayout>
</RelativeLayout>
</android.support.design.widget.CoordinatorLayout>

+ 0
- 77
app/src/main/res/layout/main.xml View File

@@ -1,77 +0,0 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".MainActivity">

<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/upload_pict"
android:id="@+id/upload_button"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="25dp"
/>

<Button
android:layout_above="@+id/upload_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/select_pict"
android:id="@+id/select_button"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="25dp"
/>
<LinearLayout
android:orientation="horizontal"
android:layout_above="@+id/select_button"
android:id="@+id/layout_days"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="25dp"
android:gravity="center_vertical"
>
<TextView
android:text="@string/duration"
android:singleLine="false"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"/>
<Spinner
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/delete_day_spinner"
android:entries="@array/deleted_days"
/>
</LinearLayout>
<Spinner
android:layout_above="@+id/layout_days"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/servers_spinner"
android:layout_marginTop="25dp"
/>

<ImageView
android:layout_above="@+id/servers_spinner"
android:layout_below="@+id/reset_button"
android:id="@+id/thumbnail_main"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
/>

<ImageButton
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginBottom="10dp"
android:src="@android:drawable/ic_delete"
android:id="@+id/reset_button"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
/>

</RelativeLayout>

+ 48
- 20
app/src/main/res/layout/servers.xml View File

@@ -1,25 +1,53 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context="fr.mobdev.goblim.activity.ServersActivity">
<TextView
android:gravity="center"
android:text="@string/default_server"
android:layout_alignParentTop="true"
android:id="@+id/default_indications"
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:fitsSystemWindows="true"
android:layout_height="match_parent"
android:layout_width="match_parent"
tools:context="fr.mobdev.goblim.activity.ServersActivity"
>
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
/>
<ListView
android:layout_below="@+id/default_indications"
android:id="@+id/servers_list"
android:theme="@style/AppTheme.PopupOverlay">

<android.support.v7.widget.Toolbar
android:id="@+id/servers_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay"
/>
</android.support.design.widget.AppBarLayout>

<RelativeLayout
app:layout_behavior="@string/appbar_scrolling_view_behavior"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:choiceMode="singleChoice"
/>
>
<TextView
android:gravity="center"
android:text="@string/default_server"
android:layout_alignParentTop="true"
android:id="@+id/default_indications"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
/>

</RelativeLayout>
<ListView
android:layout_below="@+id/default_indications"
android:id="@+id/servers_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:choiceMode="singleChoice"
/>
</RelativeLayout>
</android.support.design.widget.CoordinatorLayout>

+ 104
- 0
app/src/main/res/layout/upload.xml View File

@@ -0,0 +1,104 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:fitsSystemWindows="true"
android:layout_height="match_parent"
android:layout_width="match_parent"
tools:context="fr.mobdev.goblim.activity.UploadActivity"
>

<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.PopupOverlay">

<android.support.v7.widget.Toolbar
android:id="@+id/upload_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay"
/>
</android.support.design.widget.AppBarLayout>

<RelativeLayout
app:layout_behavior="@string/appbar_scrolling_view_behavior"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/upload_pict"
android:id="@+id/upload_button"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="25dp"
/>

<Button
android:layout_above="@+id/upload_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/select_pict"
android:id="@+id/select_button"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="25dp"
/>
<LinearLayout
android:orientation="horizontal"
android:layout_above="@+id/select_button"
android:id="@+id/layout_days"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="25dp"
android:gravity="center_vertical"
>
<TextView
android:text="@string/duration"
android:singleLine="false"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"/>
<Spinner
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/delete_day_spinner"
android:entries="@array/deleted_days"
/>
</LinearLayout>
<Spinner
android:layout_above="@+id/layout_days"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/servers_spinner"
android:layout_marginTop="25dp"
/>

<ImageView
android:layout_above="@+id/servers_spinner"
android:layout_below="@+id/reset_button"
android:id="@+id/thumbnail_main"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
/>

<ImageButton
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginBottom="10dp"
android:src="@android:drawable/ic_delete"
android:id="@+id/reset_button"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
/>
</RelativeLayout>
</android.support.design.widget.CoordinatorLayout>

app/src/main/res/menu/menu_main.xml → app/src/main/res/menu/menu_upload.xml View File

@@ -6,9 +6,4 @@
android:id="@+id/action_manage_server"
android:title="@string/manage_server"
app:showAsAction="ifRoom" />
<item
android:icon="@android:drawable/ic_menu_recent_history"
android:id="@+id/action_show_history"
android:title="@string/show_history"
app:showAsAction="ifRoom" />
</menu>

+ 8
- 0
app/src/main/res/values-v21/styles.xml View File

@@ -0,0 +1,8 @@
<resources>
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="android:statusBarColor">@android:color/transparent</item>
</style>
</resources>

+ 9
- 0
app/src/main/res/values-v23/styles.xml View File

@@ -0,0 +1,9 @@
<resources>
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:titleTextColor">@android:color/black</item>
</style>
</resources>

+ 6
- 0
app/src/main/res/values/colors.xml View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimaryDark">#c41b66</color>
<color name="colorPrimary">#ea619e</color>
<color name="colorAccent">#a0c41b66</color>
</resources>

+ 11
- 0
app/src/main/res/values/styles.xml View File

@@ -3,6 +3,17 @@
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>

<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>

<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar"/>
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Dark"/>

</resources>

+ 5
- 1
build.gradle View File

@@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
classpath 'com.android.tools.build:gradle:1.5.0'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
@@ -17,3 +17,7 @@ allprojects {
jcenter()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

Loading…
Cancel
Save