Fixed some stuff.
This commit is contained in:
parent
fe1379d66f
commit
4bb48870df
18 changed files with 497 additions and 30 deletions
Binary file not shown.
15
CHANGELOG.md
Normal file
15
CHANGELOG.md
Normal file
|
@ -0,0 +1,15 @@
|
|||
## CHANNGELOG
|
||||
|
||||
|
||||
## 0.0.1
|
||||
|
||||
* if you now click on a link outside the disroot domain it opens in a external browser.
|
||||
* menu background changed to dark
|
||||
* Added all icons
|
||||
|
||||
## 0.0.2
|
||||
|
||||
* Non disroor.org domains open in external browser
|
||||
* Fixed blank page on board.disroot.org
|
||||
* Long press on mail icon shows info
|
||||
*
|
|
@ -1,5 +0,0 @@
|
|||
#### changes
|
||||
|
||||
- if you now click on a link outside the disroot domain it opens in a external browser.
|
||||
- menu background changed to dark
|
||||
- Added all icons
|
|
@ -24,6 +24,10 @@
|
|||
android:configChanges="orientation|screenSize"
|
||||
android:hardwareAccelerated="true"
|
||||
android:label="@string/app_name" />
|
||||
<activity
|
||||
android:name="org.disroot.disrootapp.AboutActivity"
|
||||
android:label="@string/title_activity_about"
|
||||
android:theme="@style/DisTheme"></activity>
|
||||
</application>
|
||||
|
||||
</manifest>
|
153
app/src/main/java/org/disroot/disrootapp/AboutActivity.java
Normal file
153
app/src/main/java/org/disroot/disrootapp/AboutActivity.java
Normal file
|
@ -0,0 +1,153 @@
|
|||
package org.disroot.disrootapp;
|
||||
|
||||
import android.support.design.widget.TabLayout;
|
||||
import android.support.design.widget.FloatingActionButton;
|
||||
import android.support.design.widget.Snackbar;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.support.v4.app.FragmentManager;
|
||||
import android.support.v4.app.FragmentPagerAdapter;
|
||||
import android.support.v4.view.ViewPager;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.example.webview.R;
|
||||
|
||||
public class AboutActivity extends AppCompatActivity {
|
||||
|
||||
/**
|
||||
* The {@link android.support.v4.view.PagerAdapter} that will provide
|
||||
* fragments for each of the sections. We use a
|
||||
* {@link FragmentPagerAdapter} derivative, which will keep every
|
||||
* loaded fragment in memory. If this becomes too memory intensive, it
|
||||
* may be best to switch to a
|
||||
* {@link android.support.v4.app.FragmentStatePagerAdapter}.
|
||||
*/
|
||||
private SectionsPagerAdapter mSectionsPagerAdapter;
|
||||
|
||||
/**
|
||||
* The {@link ViewPager} that will host the section contents.
|
||||
*/
|
||||
private ViewPager mViewPager;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_about);
|
||||
|
||||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||
setSupportActionBar(toolbar);
|
||||
// Create the adapter that will return a fragment for each of the three
|
||||
// primary sections of the activity.
|
||||
mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager());
|
||||
|
||||
// Set up the ViewPager with the sections adapter.
|
||||
mViewPager = (ViewPager) findViewById(R.id.container);
|
||||
mViewPager.setAdapter(mSectionsPagerAdapter);
|
||||
|
||||
TabLayout tabLayout = (TabLayout) findViewById(R.id.tabs);
|
||||
|
||||
mViewPager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(tabLayout));
|
||||
tabLayout.addOnTabSelectedListener(new TabLayout.ViewPagerOnTabSelectedListener(mViewPager));
|
||||
|
||||
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
|
||||
fab.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
|
||||
.setAction("Action", null).show();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
// Inflate the menu; this adds items to the action bar if it is present.
|
||||
getMenuInflater().inflate(R.menu.menu_about, menu);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
// Handle action bar item clicks here. The action bar will
|
||||
// automatically handle clicks on the Home/Up button, so long
|
||||
// as you specify a parent activity in AndroidManifest.xml.
|
||||
int id = item.getItemId();
|
||||
|
||||
//noinspection SimplifiableIfStatement
|
||||
if (id == R.id.action_settings) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
/**
|
||||
* A placeholder fragment containing a simple view.
|
||||
*/
|
||||
public static class PlaceholderFragment extends Fragment {
|
||||
/**
|
||||
* The fragment argument representing the section number for this
|
||||
* fragment.
|
||||
*/
|
||||
private static final String ARG_SECTION_NUMBER = "section_number";
|
||||
|
||||
public PlaceholderFragment() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new instance of this fragment for the given section
|
||||
* number.
|
||||
*/
|
||||
public static PlaceholderFragment newInstance(int sectionNumber) {
|
||||
PlaceholderFragment fragment = new PlaceholderFragment();
|
||||
Bundle args = new Bundle();
|
||||
args.putInt(ARG_SECTION_NUMBER, sectionNumber);
|
||||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
View rootView = inflater.inflate(R.layout.fragment_about, container, false);
|
||||
TextView textView = (TextView) rootView.findViewById(R.id.section_label);
|
||||
textView.setText(getString(R.string.section_format, getArguments().getInt(ARG_SECTION_NUMBER)));
|
||||
return rootView;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A {@link FragmentPagerAdapter} that returns a fragment corresponding to
|
||||
* one of the sections/tabs/pages.
|
||||
*/
|
||||
public class SectionsPagerAdapter extends FragmentPagerAdapter {
|
||||
|
||||
public SectionsPagerAdapter(FragmentManager fm) {
|
||||
super(fm);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Fragment getItem(int position) {
|
||||
// getItem is called to instantiate the fragment for the given page.
|
||||
// Return a PlaceholderFragment (defined as a static inner class below).
|
||||
return PlaceholderFragment.newInstance(position + 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
// Show 3 total pages.
|
||||
return 3;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -3,11 +3,13 @@ package org.disroot.disrootapp.ui;
|
|||
import android.app.AlertDialog;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.graphics.drawable.BitmapDrawable;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.app.ActionBar;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.util.Log;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.Menu;
|
||||
|
@ -16,12 +18,15 @@ import android.view.MenuItem;
|
|||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.webkit.WebView;
|
||||
import android.widget.Button;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.example.webview.R;
|
||||
|
||||
import org.disroot.disrootapp.AboutActivity;
|
||||
import org.disroot.disrootapp.utils.Constants;
|
||||
import org.disroot.disrootapp.utils.DeviceProvider;
|
||||
import org.disroot.disrootapp.webviews.DisWebChromeClient;
|
||||
|
@ -34,6 +39,7 @@ public class MainActivity extends AppCompatActivity implements View.OnLongClickL
|
|||
private static final String TAG = MainActivity.class.getSimpleName();
|
||||
private WebView webView;
|
||||
private DisWebChromeClient disWebChromeClient;
|
||||
Button button;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
|
@ -45,7 +51,79 @@ public class MainActivity extends AppCompatActivity implements View.OnLongClickL
|
|||
setupWebView(savedInstanceState, frameLayoutContainer, viewLoading);
|
||||
// enables the activity icon as a 'home' button. required if "android:targetSdkVersion" > 14
|
||||
//getActionBar().setHomeButtonEnabled(true);
|
||||
final RelativeLayout dashboard = (RelativeLayout)findViewById(R.id.dashboard);
|
||||
|
||||
|
||||
|
||||
//Set buttons
|
||||
// Locate the button in activity_main.xml
|
||||
button = (Button) findViewById(R.id.MailBtn);
|
||||
|
||||
button.setOnLongClickListener(new View.OnLongClickListener() {
|
||||
|
||||
@Override
|
||||
public boolean onLongClick(View v) {
|
||||
showMailInfo();
|
||||
return true;
|
||||
}
|
||||
});
|
||||
// Capture button clicks
|
||||
button.setOnClickListener(new View.OnClickListener() {
|
||||
public void onClick(View arg0) {
|
||||
|
||||
// Start NewActivity.class
|
||||
String k9 = "com.fsck.k9";
|
||||
Intent mail = getPackageManager().getLaunchIntentForPackage(k9);
|
||||
if(mail == null) {
|
||||
mail = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id="+k9));
|
||||
}
|
||||
startActivity(mail);
|
||||
}
|
||||
|
||||
});
|
||||
// Locate the button in activity_main.xml
|
||||
button = (Button) findViewById(R.id.DiasporaBtn);
|
||||
// Capture button clicks
|
||||
button.setOnClickListener(new View.OnClickListener() {
|
||||
public void onClick(View arg0) {
|
||||
|
||||
// Start NewActivity.class
|
||||
String Diaspora = "com.github.dfa.diaspora_android";
|
||||
Intent pod = getPackageManager().getLaunchIntentForPackage(Diaspora);
|
||||
if(pod == null) {
|
||||
pod = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id="+Diaspora));
|
||||
}
|
||||
startActivity(pod);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
// Locate the button in activity_main.xml
|
||||
button = (Button) findViewById(R.id.PadBtn);
|
||||
// Capture button clicks
|
||||
button.setOnClickListener(new View.OnClickListener() {
|
||||
public void onClick(View arg0) {
|
||||
|
||||
// Start NewActivity.class
|
||||
webView.loadUrl(Constants.URL_DisApp_PAD);
|
||||
webView.setVisibility(View.VISIBLE);
|
||||
dashboard.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
// Locate the button in activity_main.xml
|
||||
button = (Button) findViewById(R.id.AboudBtn);
|
||||
// Capture button clicks
|
||||
button.setOnClickListener(new View.OnClickListener() {
|
||||
public void onClick(View arg0) {
|
||||
|
||||
// Start NewActivity.class
|
||||
Intent goAbout = new Intent(MainActivity.this, AboutActivity.class);
|
||||
MainActivity.this.startActivity(goAbout);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -64,11 +142,13 @@ public class MainActivity extends AppCompatActivity implements View.OnLongClickL
|
|||
protected void onPause() {
|
||||
super.onPause();
|
||||
webView.onPause();
|
||||
webView.pauseTimers();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
webView.resumeTimers();
|
||||
webView.onResume();
|
||||
}
|
||||
|
||||
|
@ -121,12 +201,15 @@ public class MainActivity extends AppCompatActivity implements View.OnLongClickL
|
|||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
RelativeLayout dashboard = (RelativeLayout)findViewById(R.id.dashboard);
|
||||
switch (item.getItemId()) {
|
||||
case R.id.action_share:
|
||||
shareCurrentPage();
|
||||
return true;
|
||||
case R.id.action_home:
|
||||
webView.loadUrl(Constants.URL_DisApp_MAIN_PAGE);
|
||||
webView.loadUrl(null);
|
||||
webView.setVisibility(View.GONE);
|
||||
dashboard.setVisibility(View.VISIBLE);
|
||||
return true;
|
||||
case R.id.action_mail:
|
||||
String k9 = "com.fsck.k9";
|
||||
|
@ -154,6 +237,8 @@ public class MainActivity extends AppCompatActivity implements View.OnLongClickL
|
|||
return true;
|
||||
case R.id.action_forum:
|
||||
webView.loadUrl(Constants.URL_DisApp_FORUM);
|
||||
webView.setVisibility(View.VISIBLE);
|
||||
dashboard.setVisibility(View.GONE);
|
||||
return true;
|
||||
case R.id.action_chat:
|
||||
String Conversations = "eu.siacs.conversations";
|
||||
|
@ -165,30 +250,47 @@ public class MainActivity extends AppCompatActivity implements View.OnLongClickL
|
|||
return true;
|
||||
case R.id.action_pad:
|
||||
webView.loadUrl(Constants.URL_DisApp_PAD);
|
||||
webView.setVisibility(View.VISIBLE);
|
||||
dashboard.setVisibility(View.GONE);
|
||||
return true;
|
||||
case R.id.action_calc:
|
||||
webView.loadUrl(Constants.URL_DisApp_CALC);
|
||||
webView.setVisibility(View.VISIBLE);
|
||||
dashboard.setVisibility(View.GONE);
|
||||
return true;
|
||||
case R.id.action_bin:
|
||||
webView.loadUrl(Constants.URL_DisApp_BIN);
|
||||
webView.setVisibility(View.VISIBLE);
|
||||
dashboard.setVisibility(View.GONE);
|
||||
return true;
|
||||
case R.id.action_upload:
|
||||
webView.loadUrl(Constants.URL_DisApp_UPLOAD);
|
||||
webView.setVisibility(View.VISIBLE);
|
||||
dashboard.setVisibility(View.GONE);
|
||||
return true;
|
||||
case R.id.action_searx:
|
||||
webView.loadUrl(Constants.URL_DisApp_SEARX);
|
||||
webView.setVisibility(View.VISIBLE);
|
||||
dashboard.setVisibility(View.GONE);
|
||||
return true;
|
||||
case R.id.action_poll:
|
||||
webView.loadUrl(Constants.URL_DisApp_POLL);
|
||||
webView.setVisibility(View.VISIBLE);
|
||||
dashboard.setVisibility(View.GONE);
|
||||
return true;
|
||||
case R.id.action_board:
|
||||
webView.loadUrl(Constants.URL_DisApp_BOARD);
|
||||
webView.setVisibility(View.VISIBLE);
|
||||
dashboard.setVisibility(View.GONE);
|
||||
return true;
|
||||
case R.id.action_user:
|
||||
webView.loadUrl(Constants.URL_DisApp_USER);
|
||||
webView.setVisibility(View.VISIBLE);
|
||||
dashboard.setVisibility(View.GONE);
|
||||
return true;
|
||||
case R.id.action_about:
|
||||
showAppInfo();
|
||||
Intent goAbout = new Intent(MainActivity.this, AboutActivity.class);
|
||||
MainActivity.this.startActivity(goAbout);
|
||||
return true;
|
||||
default:
|
||||
return super.onOptionsItemSelected(item);
|
||||
|
@ -203,19 +305,20 @@ public class MainActivity extends AppCompatActivity implements View.OnLongClickL
|
|||
if (actionBar != null)
|
||||
actionBar.setTitle("");
|
||||
}
|
||||
|
||||
private void setupWebView(Bundle savedInstanceState, FrameLayout customViewContainer, ViewGroup viewLoading) {
|
||||
disWebChromeClient = new DisWebChromeClient(this, webView, customViewContainer);
|
||||
webView = (WebView) findViewById(R.id.webView_content);
|
||||
webView.setWebViewClient(new DisWebViewClient(savedInstanceState, viewLoading));
|
||||
webView.setWebChromeClient(disWebChromeClient);
|
||||
webView.getSettings().setJavaScriptEnabled(true);
|
||||
webView.getSettings().setDomStorageEnabled(true);//solves taiga board \o/
|
||||
webView.setVerticalScrollBarEnabled(false);
|
||||
webView.getSettings().setAppCacheEnabled(true);
|
||||
webView.getSettings().setBuiltInZoomControls(true);
|
||||
webView.getSettings().setSaveFormData(true);
|
||||
webView.loadUrl(Constants.URL_DisApp_MAIN_PAGE);
|
||||
// webView.loadUrl(Constants.URL_DisApp_MAIN_PAGE);
|
||||
webView.setOnLongClickListener(this);
|
||||
webView.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
public void shareCurrentPage() {
|
||||
|
@ -226,10 +329,11 @@ public class MainActivity extends AppCompatActivity implements View.OnLongClickL
|
|||
startActivity(intent);
|
||||
}
|
||||
|
||||
private void showAppInfo() {
|
||||
private void showMailInfo() {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
|
||||
builder.setTitle(R.string.app_name);
|
||||
builder.setMessage(getString(R.string.activity_main_manteiners, DeviceProvider.getAppVersion(this)));
|
||||
builder.setTitle(R.string.MailInfoTitle);
|
||||
//builder.setMessage(getString(R.string.activity_main_manteiners, DeviceProvider.getAppVersion(this)));
|
||||
builder.setMessage(getString(R.string.MailInfo));
|
||||
builder.setPositiveButton(R.string.global_ok, null);
|
||||
builder.show();
|
||||
}
|
||||
|
|
|
@ -12,13 +12,13 @@ public class Constants {
|
|||
public static final String URL_DisApp_CLOUD = "https://cloud.disroot.org";
|
||||
public static final String URL_DisApp_DIASPORA = "https://pod.disroot.org/";
|
||||
public static final String URL_DisApp_FORUM = "https://forum.disroot.org/";
|
||||
public static final String URL_DisApp_CHAT = "http://chat.disroot.org";
|
||||
public static final String URL_DisApp_PAD = "http://pad.disroot.org";
|
||||
public static final String URL_DisApp_CALC = "http://calc.disroot.org";
|
||||
public static final String URL_DisApp_BIN = "http://bin.disroot.org";
|
||||
public static final String URL_DisApp_UPLOAD = "http://upload.disroot.org";
|
||||
public static final String URL_DisApp_SEARX = "http://search.disroot.org";
|
||||
public static final String URL_DisApp_POLL = "http://poll.disroot.org";
|
||||
public static final String URL_DisApp_BOARD = "http://board.disroot.org";
|
||||
public static final String URL_DisApp_USER = "http://user.disroot.org";
|
||||
public static final String URL_DisApp_CHAT = "https://chat.disroot.org";
|
||||
public static final String URL_DisApp_PAD = "https://pad.disroot.org";
|
||||
public static final String URL_DisApp_CALC = "https://calc.disroot.org";
|
||||
public static final String URL_DisApp_BIN = "https://bin.disroot.org";
|
||||
public static final String URL_DisApp_UPLOAD = "https://upload.disroot.org";
|
||||
public static final String URL_DisApp_SEARX = "https://search.disroot.org";
|
||||
public static final String URL_DisApp_POLL = "https://poll.disroot.org";
|
||||
public static final String URL_DisApp_BOARD = "https://board.disroot.org";
|
||||
public static final String URL_DisApp_USER = "https://user.disroot.org";
|
||||
}
|
||||
|
|
BIN
app/src/main/res/drawable/bgimage.jpg
Normal file
BIN
app/src/main/res/drawable/bgimage.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 144 KiB |
70
app/src/main/res/layout/activity_about.xml
Normal file
70
app/src/main/res/layout/activity_about.xml
Normal file
|
@ -0,0 +1,70 @@
|
|||
<?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:id="@+id/main_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="true"
|
||||
tools:context=".AboutActivity">
|
||||
|
||||
<android.support.design.widget.AppBarLayout
|
||||
android:id="@+id/appbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="@dimen/appbar_padding_top"
|
||||
android:theme="@style/DisTheme.AppBarOverlay">
|
||||
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:layout_weight="1"
|
||||
android:background="?attr/colorPrimary"
|
||||
app:layout_scrollFlags="scroll|enterAlways"
|
||||
app:popupTheme="@style/DisTheme.PopupOverlay"
|
||||
app:title="@string/app_name">
|
||||
|
||||
</android.support.v7.widget.Toolbar>
|
||||
|
||||
<android.support.design.widget.TabLayout
|
||||
android:id="@+id/tabs"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<android.support.design.widget.TabItem
|
||||
android:id="@+id/tabItem"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/tab_text_1" />
|
||||
|
||||
<android.support.design.widget.TabItem
|
||||
android:id="@+id/tabItem2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/tab_text_2" />
|
||||
|
||||
<android.support.design.widget.TabItem
|
||||
android:id="@+id/tabItem3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/tab_text_3" />
|
||||
|
||||
</android.support.design.widget.TabLayout>
|
||||
</android.support.design.widget.AppBarLayout>
|
||||
|
||||
<android.support.v4.view.ViewPager
|
||||
android:id="@+id/container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
|
||||
|
||||
<android.support.design.widget.FloatingActionButton
|
||||
android:id="@+id/fab"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="end|bottom"
|
||||
android:layout_margin="@dimen/fab_margin"
|
||||
app:srcCompat="@android:drawable/ic_dialog_email" />
|
||||
|
||||
</android.support.design.widget.CoordinatorLayout>
|
|
@ -21,6 +21,65 @@
|
|||
|
||||
<include layout="@layout/view_loading"/>
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/dashboard"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#203140"
|
||||
android:visibility="visible"
|
||||
android:gravity="center_horizontal"
|
||||
>
|
||||
|
||||
<Button
|
||||
style="?android:attr/borderlessButtonStyle"
|
||||
android:id="@+id/MailBtn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#ffffff"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/action_mail"
|
||||
android:layout_marginTop="50dp"
|
||||
android:drawableTop="@drawable/ic_mail"
|
||||
/>
|
||||
|
||||
<Button
|
||||
style="?android:attr/borderlessButtonStyle"
|
||||
android:id="@+id/PadBtn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#ffffff"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/action_pad"
|
||||
android:layout_marginTop="50dp"
|
||||
android:drawableTop="@drawable/ic_pad"
|
||||
android:layout_toRightOf="@+id/DiasporaBtn"/>
|
||||
|
||||
<Button
|
||||
style="?android:attr/borderlessButtonStyle"
|
||||
android:id="@+id/DiasporaBtn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#ffffff"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/action_diaspora"
|
||||
android:layout_marginTop="50dp"
|
||||
android:drawableTop="@drawable/ic_diaspora"
|
||||
android:layout_toRightOf="@+id/MailBtn"/>
|
||||
<Button
|
||||
style="?android:attr/borderlessButtonStyle"
|
||||
android:id="@+id/AboudBtn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#ffffff"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/action_about"
|
||||
android:layout_marginTop="50dp"
|
||||
android:drawableTop="@drawable/ic_about"
|
||||
android:layout_toRightOf="@+id/PadBtn"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
</LinearLayout>
|
23
app/src/main/res/layout/fragment_about.xml
Normal file
23
app/src/main/res/layout/fragment_about.xml
Normal file
|
@ -0,0 +1,23 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.constraint.ConstraintLayout 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:id="@+id/constraintLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".AboutActivity$PlaceholderFragment">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/section_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/activity_vertical_margin"
|
||||
android:layout_marginEnd="@dimen/activity_horizontal_margin"
|
||||
android:layout_marginStart="@dimen/activity_horizontal_margin"
|
||||
android:layout_marginTop="@dimen/activity_vertical_margin"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/constraintLayout"
|
||||
tools:layout_constraintLeft_creator="1"
|
||||
tools:layout_constraintTop_creator="1" />
|
||||
|
||||
</android.support.constraint.ConstraintLayout>
|
|
@ -13,6 +13,6 @@
|
|||
android:id="@+id/textview_toolbar_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="20sp" />
|
||||
android:textColor="@android:color/white"/>
|
||||
<!--android:textSize="20sp" />-->
|
||||
</android.support.v7.widget.Toolbar>
|
|
@ -3,13 +3,18 @@
|
|||
android:id="@+id/linearlayout_view_loading_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
android:gravity="top"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone">
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progressbar_loading"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
style="@android:style/Widget.ProgressBar.Horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:indeterminate="true"
|
||||
android:indeterminateTintMode="src_atop"
|
||||
android:indeterminateTint="@color/bg_primary_blue_dark"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textview_loading_description"
|
||||
|
@ -20,4 +25,5 @@
|
|||
android:text="@string/view_loading_description"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:visibility="gone" />
|
||||
|
||||
</LinearLayout>
|
10
app/src/main/res/menu/menu_about.xml
Normal file
10
app/src/main/res/menu/menu_about.xml
Normal file
|
@ -0,0 +1,10 @@
|
|||
<menu 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"
|
||||
tools:context="org.disroot.disrootapp.AboutActivity">
|
||||
<item
|
||||
android:id="@+id/action_settings"
|
||||
android:orderInCategory="100"
|
||||
android:title="@string/action_settings"
|
||||
app:showAsAction="never" />
|
||||
</menu>
|
6
app/src/main/res/values-w820dp/dimens.xml
Normal file
6
app/src/main/res/values-w820dp/dimens.xml
Normal file
|
@ -0,0 +1,6 @@
|
|||
<resources>
|
||||
<!-- Example customization of dimensions originally defined in res/values/dimens.xml
|
||||
(such as screen margins) for screens with more than 820dp of available width. This
|
||||
would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). -->
|
||||
<dimen name="activity_horizontal_margin">64dp</dimen>
|
||||
</resources>
|
7
app/src/main/res/values/dimens.xml
Normal file
7
app/src/main/res/values/dimens.xml
Normal file
|
@ -0,0 +1,7 @@
|
|||
<resources>
|
||||
<!-- Default screen margins, per the Android Design guidelines. -->
|
||||
<dimen name="activity_horizontal_margin">16dp</dimen>
|
||||
<dimen name="activity_vertical_margin">16dp</dimen>
|
||||
<dimen name="fab_margin">16dp</dimen>
|
||||
<dimen name="appbar_padding_top">8dp</dimen>
|
||||
</resources>
|
|
@ -23,5 +23,14 @@
|
|||
<string name="activity_main_manteiners">%s\n\nDeveloper: Massimiliano\n\ncontact us:\n<EMAIL mailto="contact@disroot.org">support@disroot.org</EMAIL></string>
|
||||
<string name="view_loading_description">Loading...</string>
|
||||
<string name="global_ok">ok</string>
|
||||
<string name="title_activity_about">AboutActivity</string>
|
||||
|
||||
</resources>
|
||||
<string name="MailInfoTitle">Mail settings.</string>
|
||||
<string name="MailInfo">Information about mail settings.\nLike imap port settings etc...\nAnd other stuff like:\nA button to how to page.</string>
|
||||
|
||||
<string name="tab_text_1">Help</string>
|
||||
<string name="tab_text_2">About</string>
|
||||
<string name="tab_text_3">License</string>
|
||||
<string name="action_settings">Settings</string>
|
||||
<string name="section_format">Hello World from section: %1$d</string>
|
||||
</resources>
|
||||
|
|
|
@ -8,17 +8,23 @@
|
|||
<item name="windowActionBar">false</item>
|
||||
<item name="windowActionModeOverlay">true</item>
|
||||
<item name="toolbarStyle">@style/Widget.MyApp.ActionBar</item>
|
||||
<item name="android:textAllCaps">false</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.MyApp.ActionBar" parent="Widget.AppCompat.ActionBar">
|
||||
<item name="theme">@style/ThemeOverlay.MyApp.ActionBar</item>
|
||||
<item name="popupTheme">@style/ThemeOverlay.AppCompat.Dark</item> <!--change theme for actionbar poupmenu-->
|
||||
<item name="popupTheme">@style/ThemeOverlay.AppCompat.Dark
|
||||
</item> <!--change theme for actionbar poupmenu-->
|
||||
</style>
|
||||
|
||||
<style name="ThemeOverlay.MyApp.ActionBar" parent="ThemeOverlay.AppCompat.Dark.ActionBar">
|
||||
<item name="android:textColorPrimary">@android:color/white</item>
|
||||
<item name="android:actionMenuTextColor">@android:color/white</item>
|
||||
<item name="android:textSize">18sp</item>
|
||||
<!--<item name="android:textSize">18sp</item>-->
|
||||
</style>
|
||||
|
||||
<style name="DisTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
|
||||
|
||||
<style name="DisTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
|
||||
|
||||
</resources>
|
||||
|
|
Loading…
Reference in a new issue