Drawer, Toolbar and minor UI optimizations (#145)
* initial add of toolbar and hamburger menu to main activity * toolbar added to preferences and accounts screens * fixed original string (name) * Layout fix for content * initial add of toolbar and hamburger menu to main activity * remove unnecessary padding bottom * fix styling and paint login activity in blue * toolbar added to preferences and accounts screens * Layout fix for content * remove unnecessary padding bottom * fix styling and paint login activity in blue * fixes after rebase * consolidate style since minVersion=16, make drawer to be behind the systembar * optimize drawer header * add back navigation to login activity, fix spinner background * add back navigation * more launcher icon to mipmap folders * fix identation * fix license header * revert code style deletion, change identation * proper notification icon * proper resolution for login logo * fix large notification icon * removed unused Eclair switch since support is v16+ * only use small notification icon * spaces->tabs * fix toolbar style for Android 4.x
51
notification_icon.svg
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
enable-background="new 0 0 595.275 311.111"
|
||||||
|
xml:space="preserve"
|
||||||
|
height="546.13336"
|
||||||
|
width="546.13336"
|
||||||
|
version="1.1"
|
||||||
|
y="0px"
|
||||||
|
x="0px"
|
||||||
|
id="svg2"
|
||||||
|
viewBox="0 0 512 512"
|
||||||
|
inkscape:version="0.92.1 r15371"
|
||||||
|
sodipodi:docname="notification_icon.svg"
|
||||||
|
inkscape:export-filename="C:\DEV\src\Android\Nextcloud\ownCloud-SMS-App\src\main\res\drawable-xxxhdpi\notification_icon.png"
|
||||||
|
inkscape:export-xdpi="16.879999"
|
||||||
|
inkscape:export-ydpi="16.879999"><metadata
|
||||||
|
id="metadata10"><rdf:RDF><cc:Work
|
||||||
|
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
|
||||||
|
id="defs8" /><sodipodi:namedview
|
||||||
|
pagecolor="#ffffff"
|
||||||
|
bordercolor="#666666"
|
||||||
|
borderopacity="1"
|
||||||
|
objecttolerance="10"
|
||||||
|
gridtolerance="10"
|
||||||
|
guidetolerance="10"
|
||||||
|
inkscape:pageopacity="0"
|
||||||
|
inkscape:pageshadow="2"
|
||||||
|
inkscape:window-width="1920"
|
||||||
|
inkscape:window-height="1005"
|
||||||
|
id="namedview6"
|
||||||
|
showgrid="false"
|
||||||
|
inkscape:zoom="1.4739747"
|
||||||
|
inkscape:cx="140.31712"
|
||||||
|
inkscape:cy="253.09893"
|
||||||
|
inkscape:window-x="-9"
|
||||||
|
inkscape:window-y="-9"
|
||||||
|
inkscape:window-maximized="1"
|
||||||
|
inkscape:current-layer="svg2" /><path
|
||||||
|
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.30745259;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0"
|
||||||
|
d="m 76.647972,90.431718 c -24.788364,0 -44.743887,15.887432 -44.743887,35.621852 v 161.78969 c 0,19.73444 19.955523,35.62188 44.743887,35.62188 H 128.01232 L 332.84234,465.77569 266.5124,323.46514 h 168.83961 c 24.7884,0 44.7439,-15.88744 44.7439,-35.62188 V 126.05357 c 0,-19.73442 -19.9555,-35.621852 -44.7439,-35.621852 z M 88.80753,121.0557 h 334.38495 c 12.20514,0 22.03089,6.58929 22.03089,14.77376 v 9.61145 c 0,8.1845 -9.82575,14.77187 -22.03089,14.77187 H 88.80753 c -12.205149,0 -22.030913,-6.58737 -22.030913,-14.77187 v -9.61145 c 0,-8.18447 9.825764,-14.77376 22.030913,-14.77376 z m 0,68.10616 h 334.38495 c 12.20514,0 22.03089,6.5893 22.03089,14.77378 v 9.60954 c 0,8.18448 -9.82575,14.77377 -22.03089,14.77377 H 88.80753 c -12.205149,0 -22.030913,-6.58929 -22.030913,-14.77377 v -9.60954 c 0,-8.18448 9.825764,-14.77378 22.030913,-14.77378 z m 0,67.54597 h 120.79949 c 12.20514,0 22.03088,8.99072 22.03088,17.17521 v 7.20812 c 0,8.18446 -9.82574,14.77376 -22.03088,14.77376 H 88.80753 c -12.205149,0 -22.030913,-6.5893 -22.030913,-14.77376 v -7.20812 c 0,-8.18449 9.825764,-17.17521 22.030913,-17.17521 z"
|
||||||
|
id="rect3350"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
sodipodi:nodetypes="sssscccssssssssssssssssssssssssssssssss" /></svg>
|
After Width: | Height: | Size: 3.1 KiB |
@ -124,7 +124,8 @@
|
|||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.LoginActivity"
|
android:name=".activities.LoginActivity"
|
||||||
android:label="@string/title_activity_login">
|
android:label="@string/title_activity_login"
|
||||||
|
android:theme="@style/OcSmsTheme.Login">
|
||||||
</activity>
|
</activity>
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.remote_account.AccountListActivity"
|
android:name=".activities.remote_account.AccountListActivity"
|
||||||
@ -136,7 +137,8 @@
|
|||||||
</activity>
|
</activity>
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.MainActivity"
|
android:name=".activities.MainActivity"
|
||||||
android:label="@string/app_name">
|
android:label="@string/app_name"
|
||||||
|
android:theme="@style/OcSmsTheme.Drawer">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN"/>
|
<action android:name="android.intent.action.MAIN"/>
|
||||||
|
|
||||||
|
@ -29,10 +29,12 @@ import android.os.AsyncTask;
|
|||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
|
import android.support.v7.app.ActionBar;
|
||||||
import android.support.v7.app.AppCompatActivity;
|
import android.support.v7.app.AppCompatActivity;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.View.OnClickListener;
|
import android.view.View.OnClickListener;
|
||||||
import android.view.inputmethod.EditorInfo;
|
import android.view.inputmethod.EditorInfo;
|
||||||
@ -74,6 +76,9 @@ public class LoginActivity extends AppCompatActivity {
|
|||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_login);
|
setContentView(R.layout.activity_login);
|
||||||
|
|
||||||
|
ActionBar actionBar = getSupportActionBar();
|
||||||
|
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||||
|
|
||||||
// Set up the login form.
|
// Set up the login form.
|
||||||
_protocolView = (Spinner) findViewById(R.id.oc_protocol);
|
_protocolView = (Spinner) findViewById(R.id.oc_protocol);
|
||||||
_serverView = (EditText) findViewById(R.id.oc_server);
|
_serverView = (EditText) findViewById(R.id.oc_server);
|
||||||
@ -105,6 +110,19 @@ public class LoginActivity extends AppCompatActivity {
|
|||||||
mProgressView = findViewById(R.id.login_progress);
|
mProgressView = findViewById(R.id.login_progress);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
boolean retval = true;
|
||||||
|
switch (item.getItemId()) {
|
||||||
|
case android.R.id.home:
|
||||||
|
finish();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
retval = super.onOptionsItemSelected(item);
|
||||||
|
}
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Attempts to sign in or register the account specified by the login form.
|
* Attempts to sign in or register the account specified by the login form.
|
||||||
* If there are form errors (invalid email, missing fields, etc.), the
|
* If there are form errors (invalid email, missing fields, etc.), the
|
||||||
|
@ -38,6 +38,7 @@ import android.support.v4.view.GravityCompat;
|
|||||||
import android.support.v4.widget.DrawerLayout;
|
import android.support.v4.widget.DrawerLayout;
|
||||||
import android.support.v7.app.ActionBarDrawerToggle;
|
import android.support.v7.app.ActionBarDrawerToggle;
|
||||||
import android.support.v7.app.AppCompatActivity;
|
import android.support.v7.app.AppCompatActivity;
|
||||||
|
import android.support.v7.widget.Toolbar;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.Window;
|
import android.view.Window;
|
||||||
@ -59,9 +60,12 @@ import static fr.unix_experience.owncloud_sms.enums.PermissionID.REQUEST_MAX;
|
|||||||
import static fr.unix_experience.owncloud_sms.enums.PermissionID.REQUEST_SMS;
|
import static fr.unix_experience.owncloud_sms.enums.PermissionID.REQUEST_SMS;
|
||||||
|
|
||||||
public class MainActivity extends AppCompatActivity
|
public class MainActivity extends AppCompatActivity
|
||||||
implements NavigationView.OnNavigationItemSelectedListener{
|
implements NavigationView.OnNavigationItemSelectedListener {
|
||||||
|
|
||||||
private ConnectivityMonitor _ConnectivityMonitor = null;
|
private ConnectivityMonitor _ConnectivityMonitor = null;
|
||||||
|
|
||||||
|
private DrawerLayout drawer;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
if (_ConnectivityMonitor == null) {
|
if (_ConnectivityMonitor == null) {
|
||||||
@ -72,61 +76,127 @@ public class MainActivity extends AppCompatActivity
|
|||||||
|
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_main);
|
setContentView(R.layout.activity_main);
|
||||||
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
|
|
||||||
|
setupToolbar();
|
||||||
|
getSupportActionBar().setHomeButtonEnabled(true);
|
||||||
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
|
||||||
|
drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
|
||||||
|
setupDrawer();
|
||||||
|
drawer.openDrawer(GravityCompat.START);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void setupToolbar() {
|
||||||
|
setSupportActionBar((Toolbar) findViewById(R.id.toolbar));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setupDrawer() {
|
||||||
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
|
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
|
||||||
this, drawer, null, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
|
this, drawer, null, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
|
||||||
assert drawer != null;
|
assert drawer != null;
|
||||||
drawer.addDrawerListener(toggle);
|
drawer.addDrawerListener(toggle);
|
||||||
toggle.syncState();
|
toggle.syncState();
|
||||||
|
toggle.setDrawerIndicatorEnabled(true);
|
||||||
|
|
||||||
NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
|
NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
|
||||||
assert navigationView != null;
|
assert navigationView != null;
|
||||||
navigationView.setNavigationItemSelectedListener(this);
|
navigationView.setNavigationItemSelectedListener(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* checks if the drawer exists and is opened.
|
||||||
|
*
|
||||||
|
* @return <code>true</code> if the drawer is open, else <code>false</code>
|
||||||
|
*/
|
||||||
|
public boolean isDrawerOpen() {
|
||||||
|
return drawer != null && drawer.isDrawerOpen(GravityCompat.START);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* closes the drawer.
|
||||||
|
*/
|
||||||
|
public void closeDrawer() {
|
||||||
|
if (drawer != null) {
|
||||||
|
drawer.closeDrawer(GravityCompat.START);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* opens the drawer.
|
||||||
|
*/
|
||||||
|
public void openDrawer() {
|
||||||
|
if (drawer != null) {
|
||||||
drawer.openDrawer(GravityCompat.START);
|
drawer.openDrawer(GravityCompat.START);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBackPressed() {
|
public void onBackPressed() {
|
||||||
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
|
if (isDrawerOpen()) {
|
||||||
assert drawer != null;
|
closeDrawer();
|
||||||
if (drawer.isDrawerOpen(GravityCompat.START)) {
|
|
||||||
drawer.closeDrawer(GravityCompat.START);
|
|
||||||
} else {
|
} else {
|
||||||
super.onBackPressed();
|
super.onBackPressed();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
boolean retval = true;
|
||||||
|
switch (item.getItemId()) {
|
||||||
|
case android.R.id.home: {
|
||||||
|
if (isDrawerOpen()) {
|
||||||
|
closeDrawer();
|
||||||
|
} else {
|
||||||
|
openDrawer();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
retval = super.onOptionsItemSelected(item);
|
||||||
|
}
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onNavigationItemSelected(MenuItem item) {
|
public boolean onNavigationItemSelected(MenuItem item) {
|
||||||
int id = item.getItemId();
|
int id = item.getItemId();
|
||||||
boolean res = true;
|
boolean res = true;
|
||||||
|
|
||||||
switch (id) {
|
switch (id) {
|
||||||
case R.id.nav_sync: syncAllMessages(); break;
|
case R.id.nav_sync:
|
||||||
case R.id.nav_manage: res = openAppSettings(); break;
|
syncAllMessages();
|
||||||
case R.id.nav_rateus: res = openGooglePlayStore(); break;
|
break;
|
||||||
case R.id.nav_add_account: res = openAddAccount(); break;
|
case R.id.nav_manage:
|
||||||
case R.id.nav_my_accounts: res = openMyAccounts(); break;
|
res = openAppSettings();
|
||||||
case R.id.nav_appinfo_perms: res = openAppInfos(); break;
|
break;
|
||||||
|
case R.id.nav_rateus:
|
||||||
|
res = openGooglePlayStore();
|
||||||
|
break;
|
||||||
|
case R.id.nav_add_account:
|
||||||
|
res = openAddAccount();
|
||||||
|
break;
|
||||||
|
case R.id.nav_my_accounts:
|
||||||
|
res = openMyAccounts();
|
||||||
|
break;
|
||||||
|
case R.id.nav_appinfo_perms:
|
||||||
|
res = openAppInfos();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
|
closeDrawer();
|
||||||
assert drawer != null;
|
|
||||||
drawer.closeDrawer(GravityCompat.START);
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean openAppSettings () {
|
private boolean openAppSettings() {
|
||||||
startActivity(new Intent(this, OCSMSSettingsActivity.class));
|
startActivity(new Intent(this, OCSMSSettingsActivity.class));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean openAddAccount () {
|
private boolean openAddAccount() {
|
||||||
startActivity(new Intent(Settings.ACTION_ADD_ACCOUNT));
|
startActivity(new Intent(Settings.ACTION_ADD_ACCOUNT));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void syncAllMessages () {
|
public void syncAllMessages() {
|
||||||
Log.v(MainActivity.TAG, "Launch syncAllMessages()");
|
Log.v(MainActivity.TAG, "Launch syncAllMessages()");
|
||||||
if (!PermissionChecker.checkPermission(this, Manifest.permission.READ_SMS,
|
if (!PermissionChecker.checkPermission(this, Manifest.permission.READ_SMS,
|
||||||
REQUEST_SMS)) {
|
REQUEST_SMS)) {
|
||||||
@ -143,23 +213,21 @@ public class MainActivity extends AppCompatActivity
|
|||||||
OCSMSNotificationUI.notify(ctx, ctx.getString(R.string.sync_title),
|
OCSMSNotificationUI.notify(ctx, ctx.getString(R.string.sync_title),
|
||||||
ctx.getString(R.string.sync_inprogress), OCSMSNotificationType.SYNC.ordinal());
|
ctx.getString(R.string.sync_inprogress), OCSMSNotificationType.SYNC.ordinal());
|
||||||
new SyncTask(getApplicationContext(), smsList).execute();
|
new SyncTask(getApplicationContext(), smsList).execute();
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
Toast.makeText(ctx, ctx.getString(R.string.nothing_to_sync), Toast.LENGTH_SHORT).show();
|
Toast.makeText(ctx, ctx.getString(R.string.nothing_to_sync), Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
Toast.makeText(ctx, ctx.getString(R.string.err_sync_no_connection_available), Toast.LENGTH_SHORT).show();
|
Toast.makeText(ctx, ctx.getString(R.string.err_sync_no_connection_available), Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
Log.v(MainActivity.TAG, "Finish syncAllMessages()");
|
Log.v(MainActivity.TAG, "Finish syncAllMessages()");
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean openMyAccounts () {
|
private boolean openMyAccounts() {
|
||||||
startActivity(new Intent(this, AccountListActivity.class));
|
startActivity(new Intent(this, AccountListActivity.class));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean openGooglePlayStore () {
|
private boolean openGooglePlayStore() {
|
||||||
Intent intent;
|
Intent intent;
|
||||||
try {
|
try {
|
||||||
intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + getPackageName()));
|
intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + getPackageName()));
|
||||||
@ -171,7 +239,7 @@ public class MainActivity extends AppCompatActivity
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean openAppInfos () {
|
private boolean openAppInfos() {
|
||||||
Intent intent = new Intent();
|
Intent intent = new Intent();
|
||||||
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||||||
Uri uri = Uri.fromParts("package", getPackageName(), null);
|
Uri uri = Uri.fromParts("package", getPackageName(), null);
|
||||||
|
@ -24,7 +24,10 @@ import android.content.ContentResolver;
|
|||||||
import android.content.PeriodicSync;
|
import android.content.PeriodicSync;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.preference.ListPreference;
|
import android.preference.ListPreference;
|
||||||
|
import android.support.v7.app.ActionBar;
|
||||||
|
import android.support.v7.app.AppCompatDelegate;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -43,6 +46,28 @@ public class OCSMSSettingsActivity extends VirtualSettingsActivity {
|
|||||||
private static String _accountAuthority;
|
private static String _accountAuthority;
|
||||||
private static String _accountType;
|
private static String _accountType;
|
||||||
|
|
||||||
|
private AppCompatDelegate mDelegate;
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
|
@Override
|
||||||
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
|
ActionBar actionBar = getSupportActionBar();
|
||||||
|
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
private AppCompatDelegate getDelegate() {
|
||||||
|
if (mDelegate == null) {
|
||||||
|
mDelegate = AppCompatDelegate.create(this, null);
|
||||||
|
}
|
||||||
|
return mDelegate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ActionBar getSupportActionBar() {
|
||||||
|
return getDelegate().getSupportActionBar();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPostCreate(Bundle savedInstanceState) {
|
protected void onPostCreate(Bundle savedInstanceState) {
|
||||||
OCSMSSettingsActivity._accountMgr = AccountManager.get(getBaseContext());
|
OCSMSSettingsActivity._accountMgr = AccountManager.get(getBaseContext());
|
||||||
@ -107,12 +132,12 @@ public class OCSMSSettingsActivity extends VirtualSettingsActivity {
|
|||||||
long syncFreq = Long.parseLong(value);
|
long syncFreq = Long.parseLong(value);
|
||||||
|
|
||||||
// Get ownCloud SMS account list
|
// Get ownCloud SMS account list
|
||||||
for (Account acct: myAccountList) {
|
for (Account acct : myAccountList) {
|
||||||
// And get all authorities for this account
|
// And get all authorities for this account
|
||||||
List<PeriodicSync> syncList = ContentResolver.getPeriodicSyncs(acct, OCSMSSettingsActivity._accountAuthority);
|
List<PeriodicSync> syncList = ContentResolver.getPeriodicSyncs(acct, OCSMSSettingsActivity._accountAuthority);
|
||||||
|
|
||||||
boolean foundSameSyncCycle = false;
|
boolean foundSameSyncCycle = false;
|
||||||
for (PeriodicSync ps: syncList) {
|
for (PeriodicSync ps : syncList) {
|
||||||
if ((ps.period == syncFreq) && (ps.extras.getInt("synctype") == 1)) {
|
if ((ps.period == syncFreq) && (ps.extras.getInt("synctype") == 1)) {
|
||||||
foundSameSyncCycle = true;
|
foundSameSyncCycle = true;
|
||||||
}
|
}
|
||||||
@ -130,9 +155,22 @@ public class OCSMSSettingsActivity extends VirtualSettingsActivity {
|
|||||||
|
|
||||||
prefs.putLong(key, syncFreq);
|
prefs.putLong(key, syncFreq);
|
||||||
}
|
}
|
||||||
}
|
} else if ("sync_bulk_messages".equals(key) || "minimum_sync_chars".equals(key)) {
|
||||||
else if ("sync_bulk_messages".equals(key) || "minimum_sync_chars".equals(key)) {
|
|
||||||
prefs.putInteger(key, Integer.parseInt(value));
|
prefs.putInteger(key, Integer.parseInt(value));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onMenuItemSelected(int featureId, MenuItem item) {
|
||||||
|
super.onMenuItemSelected(featureId, item);
|
||||||
|
|
||||||
|
switch (item.getItemId()) {
|
||||||
|
case android.R.id.home:
|
||||||
|
onBackPressed();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,9 @@ package fr.unix_experience.owncloud_sms.activities.remote_account;
|
|||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.support.v7.app.ActionBar;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.ArrayAdapter;
|
import android.widget.ArrayAdapter;
|
||||||
import android.widget.ListView;
|
import android.widget.ListView;
|
||||||
@ -19,6 +21,9 @@ public class AccountActionsActivity extends AppCompatListActivity {
|
|||||||
|
|
||||||
setContentView(R.layout.activity_account_actions);
|
setContentView(R.layout.activity_account_actions);
|
||||||
|
|
||||||
|
ActionBar actionBar = getSupportActionBar();
|
||||||
|
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||||
|
|
||||||
ArrayList<String> itemList = new ArrayList<>();
|
ArrayList<String> itemList = new ArrayList<>();
|
||||||
ArrayAdapter<String> adp = new ArrayAdapter<>(getBaseContext(),
|
ArrayAdapter<String> adp = new ArrayAdapter<>(getBaseContext(),
|
||||||
android.R.layout.simple_dropdown_item_1line, itemList);
|
android.R.layout.simple_dropdown_item_1line, itemList);
|
||||||
@ -33,6 +38,19 @@ public class AccountActionsActivity extends AppCompatListActivity {
|
|||||||
_accountName = getIntent().getStringExtra("account");
|
_accountName = getIntent().getStringExtra("account");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
boolean retval = true;
|
||||||
|
switch (item.getItemId()) {
|
||||||
|
case android.R.id.home:
|
||||||
|
finish();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
retval = super.onOptionsItemSelected(item);
|
||||||
|
}
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onListItemClick(ListView l, View v, int position, long id) {
|
protected void onListItemClick(ListView l, View v, int position, long id) {
|
||||||
switch (position) {
|
switch (position) {
|
||||||
@ -41,12 +59,12 @@ public class AccountActionsActivity extends AppCompatListActivity {
|
|||||||
intent.putExtra("account", _accountName);
|
intent.putExtra("account", _accountName);
|
||||||
try {
|
try {
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
}
|
} catch (IllegalStateException e) {
|
||||||
catch (IllegalStateException e) {
|
|
||||||
Log.e(AccountActionsActivity.TAG, e.getMessage());
|
Log.e(AccountActionsActivity.TAG, e.getMessage());
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default: break; // Unhandled
|
default:
|
||||||
|
break; // Unhandled
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,13 +3,14 @@ package fr.unix_experience.owncloud_sms.activities.remote_account;
|
|||||||
import android.accounts.Account;
|
import android.accounts.Account;
|
||||||
import android.accounts.AccountManager;
|
import android.accounts.AccountManager;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
|
||||||
import fr.unix_experience.owncloud_sms.adapters.AndroidAccountAdapter;
|
|
||||||
import fr.unix_experience.android_lib.AppCompatListActivity;
|
import fr.unix_experience.android_lib.AppCompatListActivity;
|
||||||
import fr.unix_experience.owncloud_sms.R;
|
import fr.unix_experience.owncloud_sms.R;
|
||||||
|
import fr.unix_experience.owncloud_sms.adapters.AndroidAccountAdapter;
|
||||||
|
|
||||||
public class AccountListActivity extends AppCompatListActivity {
|
public class AccountListActivity extends AppCompatListActivity {
|
||||||
|
|
||||||
@ -21,6 +22,9 @@ public class AccountListActivity extends AppCompatListActivity {
|
|||||||
|
|
||||||
setContentView(R.layout.restore_activity_accountlist);
|
setContentView(R.layout.restore_activity_accountlist);
|
||||||
|
|
||||||
|
getSupportActionBar().setHomeButtonEnabled(true);
|
||||||
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
|
||||||
ArrayList<Account> itemList = new ArrayList<>();
|
ArrayList<Account> itemList = new ArrayList<>();
|
||||||
|
|
||||||
AndroidAccountAdapter adapter = new AndroidAccountAdapter(this,
|
AndroidAccountAdapter adapter = new AndroidAccountAdapter(this,
|
||||||
@ -35,7 +39,18 @@ public class AccountListActivity extends AppCompatListActivity {
|
|||||||
Collections.addAll(itemList, accountList);
|
Collections.addAll(itemList, accountList);
|
||||||
|
|
||||||
adapter.notifyDataSetChanged();
|
adapter.notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
switch (item.getItemId()) {
|
||||||
|
case android.R.id.home:
|
||||||
|
onBackPressed();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return super.onOptionsItemSelected(item);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,8 +26,10 @@ import android.content.pm.PackageManager;
|
|||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.provider.Telephony;
|
import android.provider.Telephony;
|
||||||
import android.support.v4.app.ActivityCompat;
|
import android.support.v4.app.ActivityCompat;
|
||||||
|
import android.support.v7.app.ActionBar;
|
||||||
import android.support.v7.app.AppCompatActivity;
|
import android.support.v7.app.AppCompatActivity;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.ProgressBar;
|
import android.widget.ProgressBar;
|
||||||
@ -49,6 +51,9 @@ public class RestoreMessagesActivity extends AppCompatActivity {
|
|||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_restore_messages);
|
setContentView(R.layout.activity_restore_messages);
|
||||||
|
|
||||||
|
ActionBar actionBar = getSupportActionBar();
|
||||||
|
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||||
|
|
||||||
assert getIntent().getExtras() != null;
|
assert getIntent().getExtras() != null;
|
||||||
|
|
||||||
String accountName = getIntent().getExtras().getString("account");
|
String accountName = getIntent().getExtras().getString("account");
|
||||||
@ -111,6 +116,19 @@ public class RestoreMessagesActivity extends AppCompatActivity {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
boolean retval = true;
|
||||||
|
switch (item.getItemId()) {
|
||||||
|
case android.R.id.home:
|
||||||
|
finish();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
retval = super.onOptionsItemSelected(item);
|
||||||
|
}
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
private void initInterface() {
|
private void initInterface() {
|
||||||
TextView tv_error = (TextView) findViewById(R.id.tv_error_default_smsapp);
|
TextView tv_error = (TextView) findViewById(R.id.tv_error_default_smsapp);
|
||||||
tv_error.setText(R.string.error_make_default_sms_app);
|
tv_error.setText(R.string.error_make_default_sms_app);
|
||||||
@ -132,8 +150,7 @@ public class RestoreMessagesActivity extends AppCompatActivity {
|
|||||||
tv_error.setVisibility(View.VISIBLE);
|
tv_error.setVisibility(View.VISIBLE);
|
||||||
fix_button.setVisibility(View.VISIBLE);
|
fix_button.setVisibility(View.VISIBLE);
|
||||||
launch_restore.setVisibility(View.INVISIBLE);
|
launch_restore.setVisibility(View.INVISIBLE);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
tv_error.setVisibility(View.INVISIBLE);
|
tv_error.setVisibility(View.INVISIBLE);
|
||||||
fix_button.setVisibility(View.INVISIBLE);
|
fix_button.setVisibility(View.INVISIBLE);
|
||||||
launch_restore.setVisibility(View.VISIBLE);
|
launch_restore.setVisibility(View.VISIBLE);
|
||||||
|
@ -3,13 +3,10 @@ package fr.unix_experience.owncloud_sms.notifications;
|
|||||||
import android.annotation.TargetApi;
|
import android.annotation.TargetApi;
|
||||||
import android.app.Notification;
|
import android.app.Notification;
|
||||||
import android.app.NotificationManager;
|
import android.app.NotificationManager;
|
||||||
import android.app.PendingIntent;
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.graphics.BitmapFactory;
|
import android.graphics.BitmapFactory;
|
||||||
import android.net.Uri;
|
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.support.v4.app.NotificationCompat;
|
import android.support.v4.app.NotificationCompat;
|
||||||
|
|
||||||
@ -40,7 +37,7 @@ public class OCSMSNotificationUI {
|
|||||||
|
|
||||||
// This image is used as the notification's large icon (thumbnail).
|
// This image is used as the notification's large icon (thumbnail).
|
||||||
// TODO: Remove this if your notification has no relevant thumbnail.
|
// TODO: Remove this if your notification has no relevant thumbnail.
|
||||||
Bitmap picture = BitmapFactory.decodeResource(res, R.drawable.ic_launcher);
|
Bitmap picture = BitmapFactory.decodeResource(res, R.mipmap.ic_launcher);
|
||||||
|
|
||||||
|
|
||||||
String ticker = (titleString.length() > 20) ? titleString.substring(0, 20) : titleString;
|
String ticker = (titleString.length() > 20) ? titleString.substring(0, 20) : titleString;
|
||||||
@ -50,7 +47,7 @@ public class OCSMSNotificationUI {
|
|||||||
|
|
||||||
// Set appropriate defaults for the notification light, sound,
|
// Set appropriate defaults for the notification light, sound,
|
||||||
// and vibration.
|
// and vibration.
|
||||||
.setSmallIcon(R.drawable.ic_launcher)
|
.setSmallIcon(R.drawable.notification_icon)
|
||||||
.setContentTitle(title)
|
.setContentTitle(title)
|
||||||
.setContentText(contentString)
|
.setContentText(contentString)
|
||||||
|
|
||||||
@ -60,10 +57,6 @@ public class OCSMSNotificationUI {
|
|||||||
// 4.1 or later)
|
// 4.1 or later)
|
||||||
.setPriority(NotificationCompat.PRIORITY_DEFAULT)
|
.setPriority(NotificationCompat.PRIORITY_DEFAULT)
|
||||||
|
|
||||||
// Provide a large icon, shown with the notification in the
|
|
||||||
// notification drawer on devices running Android 3.0 or later.
|
|
||||||
.setLargeIcon(picture)
|
|
||||||
|
|
||||||
// Set ticker text (preview) information for this notification.
|
// Set ticker text (preview) information for this notification.
|
||||||
//.setTicker(ticker)
|
//.setTicker(ticker)
|
||||||
|
|
||||||
@ -74,7 +67,8 @@ public class OCSMSNotificationUI {
|
|||||||
.bigText(contentString)
|
.bigText(contentString)
|
||||||
.setBigContentTitle(title)
|
.setBigContentTitle(title)
|
||||||
.setSummaryText(titleString))
|
.setSummaryText(titleString))
|
||||||
.setAutoCancel(true);
|
.setAutoCancel(true)
|
||||||
|
.setColor(context.getResources().getColor(R.color.oc_primary));
|
||||||
|
|
||||||
OCSMSNotificationUI.notify(context, builder.build());
|
OCSMSNotificationUI.notify(context, builder.build());
|
||||||
}
|
}
|
||||||
@ -83,25 +77,17 @@ public class OCSMSNotificationUI {
|
|||||||
private static void notify(Context context, Notification notification) {
|
private static void notify(Context context, Notification notification) {
|
||||||
NotificationManager nm = (NotificationManager) context
|
NotificationManager nm = (NotificationManager) context
|
||||||
.getSystemService(Context.NOTIFICATION_SERVICE);
|
.getSystemService(Context.NOTIFICATION_SERVICE);
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ECLAIR) {
|
|
||||||
nm.notify(OCSMSNotificationUI.NOTIFICATION_TAG, 0, notification);
|
nm.notify(OCSMSNotificationUI.NOTIFICATION_TAG, 0, notification);
|
||||||
} else {
|
|
||||||
nm.notify(OCSMSNotificationUI.NOTIFICATION_TAG.hashCode(), notification);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cancels any notifications of this type previously shown using
|
* Cancels any notifications of this type previously shown using
|
||||||
* {@link #notify(Context, String, int)}.
|
* {@link #notify(Context, String, String, int)}.
|
||||||
*/
|
*/
|
||||||
@TargetApi(Build.VERSION_CODES.ECLAIR)
|
@TargetApi(Build.VERSION_CODES.ECLAIR)
|
||||||
public static void cancel(Context context) {
|
public static void cancel(Context context) {
|
||||||
NotificationManager nm = (NotificationManager) context
|
NotificationManager nm = (NotificationManager) context
|
||||||
.getSystemService(Context.NOTIFICATION_SERVICE);
|
.getSystemService(Context.NOTIFICATION_SERVICE);
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ECLAIR) {
|
|
||||||
nm.cancel(OCSMSNotificationUI.NOTIFICATION_TAG, 0);
|
nm.cancel(OCSMSNotificationUI.NOTIFICATION_TAG, 0);
|
||||||
} else {
|
|
||||||
nm.cancel(OCSMSNotificationUI.NOTIFICATION_TAG.hashCode());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
BIN
src/main/res/drawable-hdpi/logo.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
src/main/res/drawable-hdpi/notification_icon.png
Normal file
After Width: | Height: | Size: 586 B |
BIN
src/main/res/drawable-mdpi/logo.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
src/main/res/drawable-mdpi/notification_icon.png
Normal file
After Width: | Height: | Size: 446 B |
BIN
src/main/res/drawable-xhdpi/logo.png
Normal file
After Width: | Height: | Size: 2.8 KiB |
BIN
src/main/res/drawable-xhdpi/notification_icon.png
Normal file
After Width: | Height: | Size: 701 B |
BIN
src/main/res/drawable-xxhdpi/logo.png
Normal file
After Width: | Height: | Size: 4.4 KiB |
BIN
src/main/res/drawable-xxhdpi/notification_icon.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
src/main/res/drawable-xxxhdpi/logo.png
Normal file
After Width: | Height: | Size: 6.1 KiB |
BIN
src/main/res/drawable-xxxhdpi/notification_icon.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
@ -61,7 +61,9 @@
|
|||||||
android:id="@+id/ocsms_logo"
|
android:id="@+id/ocsms_logo"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:src="@drawable/login_logo"
|
android:paddingTop="24dp"
|
||||||
|
android:paddingBottom="36dp"
|
||||||
|
android:src="@drawable/logo"
|
||||||
android:contentDescription="@string/login_logo" />
|
android:contentDescription="@string/login_logo" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
@ -73,8 +75,9 @@
|
|||||||
android:id="@+id/oc_protocol"
|
android:id="@+id/oc_protocol"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:entries="@array/protocol_array">
|
android:layout_gravity="center_vertical"
|
||||||
</Spinner>
|
android:popupBackground="@color/oc_primary"
|
||||||
|
android:entries="@array/protocol_array" />
|
||||||
|
|
||||||
<android.support.design.widget.TextInputLayout
|
<android.support.design.widget.TextInputLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@ -84,6 +87,7 @@
|
|||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:hint="@string/prompt_serverURI"
|
android:hint="@string/prompt_serverURI"
|
||||||
|
android:textColor="@color/oc_white"
|
||||||
android:inputType="textUri" >
|
android:inputType="textUri" >
|
||||||
<requestFocus />
|
<requestFocus />
|
||||||
</EditText>
|
</EditText>
|
||||||
@ -99,9 +103,9 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:hint="@string/prompt_login"
|
android:hint="@string/prompt_login"
|
||||||
|
android:textColor="@color/oc_white"
|
||||||
android:inputType="textEmailAddress"
|
android:inputType="textEmailAddress"
|
||||||
android:maxLines="1"
|
android:maxLines="1" />
|
||||||
android:singleLine="true" />
|
|
||||||
</android.support.design.widget.TextInputLayout>
|
</android.support.design.widget.TextInputLayout>
|
||||||
|
|
||||||
<android.support.design.widget.TextInputLayout
|
<android.support.design.widget.TextInputLayout
|
||||||
@ -117,7 +121,7 @@
|
|||||||
android:imeOptions="actionUnspecified"
|
android:imeOptions="actionUnspecified"
|
||||||
android:inputType="textPassword"
|
android:inputType="textPassword"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:singleLine="true" />
|
android:textColor="@color/oc_white" />
|
||||||
</android.support.design.widget.TextInputLayout>
|
</android.support.design.widget.TextInputLayout>
|
||||||
|
|
||||||
<com.dd.processbutton.iml.ActionProcessButton
|
<com.dd.processbutton.iml.ActionProcessButton
|
||||||
|
@ -34,9 +34,14 @@
|
|||||||
android:fitsSystemWindows="true"
|
android:fitsSystemWindows="true"
|
||||||
tools:openDrawer="start"
|
tools:openDrawer="start"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
<RelativeLayout
|
|
||||||
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<include
|
||||||
|
layout="@layout/toolbar" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/main_title_welcome"
|
android:id="@+id/main_title_welcome"
|
||||||
@ -44,7 +49,6 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/ma_title_welcome"
|
android:text="@string/ma_title_welcome"
|
||||||
android:gravity="top"
|
|
||||||
android:textAppearance="?android:attr/textAppearanceLarge" />
|
android:textAppearance="?android:attr/textAppearanceLarge" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@ -53,26 +57,9 @@
|
|||||||
android:paddingRight="16dp"
|
android:paddingRight="16dp"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="top"
|
|
||||||
android:layout_alignParentRight="true"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_below="@+id/main_title_welcome"
|
|
||||||
android:text="@string/ma_content_welcome"
|
android:text="@string/ma_content_welcome"
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium" />
|
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||||
|
</LinearLayout>
|
||||||
<TextView
|
|
||||||
android:id="@+id/main_tv_swipe"
|
|
||||||
android:paddingLeft="16dp"
|
|
||||||
android:paddingRight="16dp"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="top"
|
|
||||||
android:layout_alignParentRight="true"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_below="@+id/main_tv_welcome"
|
|
||||||
android:text="@string/ma_content_swipeaction"
|
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium" />
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
<android.support.design.widget.NavigationView
|
<android.support.design.widget.NavigationView
|
||||||
android:id="@+id/nav_view"
|
android:id="@+id/nav_view"
|
||||||
@ -81,5 +68,5 @@
|
|||||||
android:layout_gravity="start"
|
android:layout_gravity="start"
|
||||||
app:headerLayout="@layout/nav_header_main"
|
app:headerLayout="@layout/nav_header_main"
|
||||||
app:menu="@menu/activity_main_drawer"
|
app:menu="@menu/activity_main_drawer"
|
||||||
android:fitsSystemWindows="false"/>
|
android:fitsSystemWindows="true"/>
|
||||||
</android.support.v4.widget.DrawerLayout>
|
</android.support.v4.widget.DrawerLayout>
|
@ -3,24 +3,21 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="@dimen/nav_header_height"
|
android:layout_height="@dimen/nav_header_height"
|
||||||
android:background="@drawable/side_nav_bar"
|
android:background="@drawable/side_nav_bar"
|
||||||
android:gravity="top"
|
android:gravity="bottom"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:paddingBottom="@dimen/activity_vertical_margin"
|
android:padding="@dimen/activity_horizontal_margin"
|
||||||
android:paddingLeft="@dimen/activity_horizontal_margin"
|
|
||||||
android:paddingRight="@dimen/activity_horizontal_margin"
|
|
||||||
android:theme="@style/ThemeOverlay.AppCompat.Dark">
|
android:theme="@style/ThemeOverlay.AppCompat.Dark">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/imageView"
|
android:id="@+id/imageView"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingTop="@dimen/nav_header_vertical_spacing"
|
|
||||||
android:src="@drawable/ic_launcher"/>
|
android:src="@drawable/ic_launcher"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingTop="@dimen/nav_header_vertical_spacing"
|
android:paddingTop="@dimen/standard_half_padding"
|
||||||
android:text="@string/app_name"
|
android:text="@string/app_name"
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Body1"/>
|
android:textAppearance="@style/TextAppearance.AppCompat.Body1"/>
|
||||||
|
|
||||||
|
@ -6,6 +6,6 @@
|
|||||||
android:id="@+id/recovery_phone"
|
android:id="@+id/recovery_phone"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:padding="20dp"
|
android:padding="@dimen/activity_vertical_margin"
|
||||||
android:textSize="18sp" />
|
android:textSize="18sp"/>
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
@ -1,5 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!--
|
<!--
|
||||||
/*
|
/*
|
||||||
|
* Copyright (c) 2017, Andy Scherzinger
|
||||||
* Copyright (c) 2014-2015, Loic Blot <loic.blot@unix-experience.fr>
|
* Copyright (c) 2014-2015, Loic Blot <loic.blot@unix-experience.fr>
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -24,11 +26,28 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
-->
|
-->
|
||||||
|
<android.support.design.widget.AppBarLayout
|
||||||
|
android:id="@+id/appbar"
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
|
||||||
|
|
||||||
<resources>
|
<android.support.v7.widget.Toolbar
|
||||||
|
android:id="@+id/toolbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="?attr/actionBarSize"
|
||||||
|
android:background="?attr/colorPrimary"
|
||||||
|
app:layout_scrollFlags="scroll|enterAlways|snap"
|
||||||
|
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"/>
|
||||||
|
|
||||||
<style name="OcSmsTheme" parent="Theme.AppCompat.Light.DarkActionBar">
|
<ProgressBar
|
||||||
<item name="colorPrimary">@color/oc_primary</item>
|
android:id="@+id/login_progress"
|
||||||
<item name="colorPrimaryDark">@color/oc_primary_dark</item>
|
style="?android:attr/progressBarStyleLarge"
|
||||||
</style>
|
android:layout_width="wrap_content"
|
||||||
</resources>
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
</android.support.design.widget.AppBarLayout>
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
BIN
src/main/res/mipmap-xxxhdpi/ic_launcher.png
Normal file
After Width: | Height: | Size: 4.1 KiB |
@ -97,7 +97,7 @@
|
|||||||
<string name="ma_title_rate_us">Rate us !</string>
|
<string name="ma_title_rate_us">Rate us !</string>
|
||||||
<string name="ma_title_add_account">Add an account</string>
|
<string name="ma_title_add_account">Add an account</string>
|
||||||
<string name="ma_title_welcome">Welcome</string>
|
<string name="ma_title_welcome">Welcome</string>
|
||||||
<string name="ma_content_welcome">Welcome to ownCloud SMS application. This application let you synchronize your SMS to your ownCloud instance using SMS app.</string>
|
<string name="ma_content_welcome">Welcome to Nextcloud SMS application. This application let you synchronize your SMS to your Nextcloud instance using SMS app.</string>
|
||||||
|
|
||||||
<!-- Notifications -->
|
<!-- Notifications -->
|
||||||
<string name="sync_title">Sync process</string>
|
<string name="sync_title">Sync process</string>
|
||||||
|
@ -1,23 +1,23 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
|
|
||||||
<style name="AppBaseTheme" parent="Theme.AppCompat.Light.DarkActionBar">
|
|
||||||
<item name="android:navigationBarColor">@color/oc_primary</item>
|
|
||||||
<item name="colorPrimaryDark">@color/oc_primary_dark</item>
|
|
||||||
<item name="colorPrimary">@color/oc_primary</item>
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<style name="OcSmsTheme" parent="Theme.AppCompat.Light.DarkActionBar">
|
<style name="OcSmsTheme" parent="Theme.AppCompat.Light.DarkActionBar">
|
||||||
<item name="colorPrimary">@color/oc_primary</item>
|
<item name="colorPrimary">@color/oc_primary</item>
|
||||||
<item name="colorPrimaryDark">@color/oc_primary_dark</item>
|
<item name="colorPrimaryDark">@color/oc_primary_dark</item>
|
||||||
|
<item name="colorAccent">@color/oc_accent</item>
|
||||||
<item name="android:navigationBarColor">@color/oc_primary</item>
|
<item name="android:navigationBarColor">@color/oc_primary</item>
|
||||||
</style>
|
</style>
|
||||||
>
|
|
||||||
|
|
||||||
<style name="OcSmsTheme.NoActionBar">
|
<style name="OcSmsTheme.Drawer" parent="OcSmsTheme.NoActionBar">
|
||||||
<item name="windowActionBar">false</item>
|
|
||||||
<item name="windowNoTitle">true</item>
|
|
||||||
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
|
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
|
||||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<style name="OcSmsTheme.NoActionBar">
|
||||||
|
<item name="colorPrimaryDark">@color/oc_primary_dark</item>
|
||||||
|
<item name="colorPrimary">@color/oc_primary</item>
|
||||||
|
<item name="colorAccent">@color/oc_accent</item>
|
||||||
|
<item name="windowActionBar">false</item>
|
||||||
|
<item name="windowNoTitle">true</item>
|
||||||
|
<item name="windowActionModeOverlay">true</item>
|
||||||
|
</style>
|
||||||
</resources>
|
</resources>
|
@ -6,5 +6,5 @@
|
|||||||
would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively).
|
would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively).
|
||||||
-->
|
-->
|
||||||
<dimen name="activity_horizontal_margin">64dp</dimen>
|
<dimen name="activity_horizontal_margin">64dp</dimen>
|
||||||
|
<dimen name="nav_drawer_header_height">164dp</dimen>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -2,4 +2,7 @@
|
|||||||
<resources>
|
<resources>
|
||||||
<color name="oc_primary">#0082C9</color>
|
<color name="oc_primary">#0082C9</color>
|
||||||
<color name="oc_primary_dark">#006AA3</color>
|
<color name="oc_primary_dark">#006AA3</color>
|
||||||
|
<color name="oc_accent">#007CC2</color>
|
||||||
|
<color name="oc_login_hint">#7fC0E3</color>
|
||||||
|
<color name="oc_white">#ffffff</color>
|
||||||
</resources>
|
</resources>
|
@ -6,7 +6,8 @@
|
|||||||
<dimen name="arrow_max_height">22dp</dimen>
|
<dimen name="arrow_max_height">22dp</dimen>
|
||||||
<!-- Default screen margins, per the Android Design guidelines. -->
|
<!-- Default screen margins, per the Android Design guidelines. -->
|
||||||
<dimen name="nav_header_vertical_spacing">16dp</dimen>
|
<dimen name="nav_header_vertical_spacing">16dp</dimen>
|
||||||
<dimen name="nav_header_height">120dp</dimen>
|
<dimen name="standard_half_padding">8dp</dimen>
|
||||||
|
<dimen name="nav_header_height">140dp</dimen>
|
||||||
<dimen name="fab_margin">16dp</dimen>
|
<dimen name="fab_margin">16dp</dimen>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -27,15 +27,39 @@
|
|||||||
|
|
||||||
<resources>
|
<resources>
|
||||||
|
|
||||||
<style name="AppBaseTheme" parent="Theme.AppCompat.Light.DarkActionBar">
|
<style name="OcSmsTheme" parent="Theme.AppCompat.Light.DarkActionBar">
|
||||||
<item name="colorPrimaryDark">@color/oc_primary_dark</item>
|
|
||||||
<item name="colorPrimary">@color/oc_primary</item>
|
<item name="colorPrimary">@color/oc_primary</item>
|
||||||
</style>
|
<item name="colorPrimaryDark">@color/oc_primary_dark</item>
|
||||||
<!-- Application theme. -->
|
<item name="colorAccent">@color/oc_accent</item>
|
||||||
<style name="AppTheme" parent="AppBaseTheme">
|
|
||||||
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<!-- separate style for Drawer activities needed for v21+ theming -->
|
||||||
|
<style name="OcSmsTheme.Drawer" parent="OcSmsTheme.NoActionBar">
|
||||||
|
<item name="colorPrimaryDark">@color/oc_primary_dark</item>
|
||||||
|
<item name="colorPrimary">@color/oc_primary</item>
|
||||||
|
<item name="colorAccent">@color/oc_accent</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="OcSmsTheme.NoActionbar" parent="Theme.AppCompat.Light.NoActionBar">
|
||||||
|
<item name="colorPrimaryDark">@color/oc_primary_dark</item>
|
||||||
|
<item name="colorPrimary">@color/oc_primary</item>
|
||||||
|
<item name="colorAccent">@color/oc_accent</item>
|
||||||
|
<item name="windowActionBar">false</item>
|
||||||
|
<item name="windowNoTitle">true</item>
|
||||||
|
<item name="windowActionModeOverlay">true</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="OcSmsTheme.Login" parent="OcSmsTheme">
|
||||||
|
<item name="android:windowBackground">@color/oc_primary</item>
|
||||||
|
<item name="colorControlNormal">@color/oc_login_hint</item>
|
||||||
|
<item name="colorControlActivated">@color/oc_white</item>
|
||||||
|
<item name="colorControlHighlight">@color/oc_login_hint</item>
|
||||||
|
<item name="colorAccent">@color/oc_login_hint</item>
|
||||||
|
<item name="android:textColorHint">@color/oc_login_hint</item>
|
||||||
|
<item name="android:textColor">@color/oc_white</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<!-- Application theme. -->
|
||||||
<style name="StandardButton">
|
<style name="StandardButton">
|
||||||
<item name="android:background">@color/oc_primary</item>
|
<item name="android:background">@color/oc_primary</item>
|
||||||
<item name="android:layout_marginTop">15dp</item>
|
<item name="android:layout_marginTop">15dp</item>
|
||||||
@ -52,7 +76,7 @@
|
|||||||
<item name="android:textAppearance">?android:attr/textAppearanceLarge</item>
|
<item name="android:textAppearance">?android:attr/textAppearanceLarge</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="OcSmsTheme.NoActionBar">
|
<style name="OcSmsTheme.NoActionBar" parent="Theme.AppCompat.Light.NoActionBar">
|
||||||
<item name="windowActionBar">false</item>
|
<item name="windowActionBar">false</item>
|
||||||
<item name="windowNoTitle">true</item>
|
<item name="windowNoTitle">true</item>
|
||||||
</style>
|
</style>
|
||||||
|