mirror of
https://github.com/gsantner/dandelion
synced 2024-12-22 19:08:03 +01:00
added titles on top toolbar
This commit is contained in:
parent
14d5f04e2f
commit
b5cf37108e
15 changed files with 47 additions and 59 deletions
|
@ -6,12 +6,10 @@ import android.os.Build;
|
|||
import android.support.annotation.Nullable;
|
||||
import android.webkit.CookieManager;
|
||||
import android.webkit.CookieSyncManager;
|
||||
import android.webkit.WebSettings;
|
||||
import android.webkit.WebView;
|
||||
|
||||
import com.github.dfa.diaspora_android.data.AppSettings;
|
||||
import com.github.dfa.diaspora_android.data.PodUserProfile;
|
||||
import com.github.dfa.diaspora_android.ui.CustomWebViewClient;
|
||||
import com.github.dfa.diaspora_android.util.AvatarImageLoader;
|
||||
|
||||
/**
|
||||
|
|
|
@ -188,6 +188,7 @@ public class MainActivity extends AppCompatActivity
|
|||
return MainActivity.this.onOptionsItemSelected(item);
|
||||
}
|
||||
});
|
||||
setTitle(R.string.app_name);
|
||||
|
||||
// Load app settings
|
||||
setupNavigationSlider();
|
||||
|
@ -479,6 +480,7 @@ public class MainActivity extends AppCompatActivity
|
|||
case R.id.action_notifications: {
|
||||
if (Helpers.isOnline(MainActivity.this)) {
|
||||
webView.loadUrl("https://" + podDomain + "/notifications");
|
||||
setTitle(R.string.title_notifications);
|
||||
return true;
|
||||
} else {
|
||||
Snackbar.make(swipeRefreshLayout, R.string.no_internet, Snackbar.LENGTH_LONG).show();
|
||||
|
@ -489,6 +491,7 @@ public class MainActivity extends AppCompatActivity
|
|||
case R.id.action_conversations: {
|
||||
if (Helpers.isOnline(MainActivity.this)) {
|
||||
webView.loadUrl("https://" + podDomain + "/conversations");
|
||||
setTitle(R.string.title_conversations);
|
||||
return true;
|
||||
} else {
|
||||
Snackbar.make(swipeRefreshLayout, R.string.no_internet, Snackbar.LENGTH_LONG).show();
|
||||
|
@ -504,6 +507,7 @@ public class MainActivity extends AppCompatActivity
|
|||
case R.id.action_compose: {
|
||||
if (Helpers.isOnline(MainActivity.this)) {
|
||||
webView.loadUrl("https://" + podDomain + "/status_messages/new");
|
||||
setTitle(R.string.new_post);
|
||||
} else {
|
||||
Snackbar.make(swipeRefreshLayout, R.string.no_internet, Snackbar.LENGTH_LONG).show();
|
||||
}
|
||||
|
@ -725,9 +729,11 @@ public class MainActivity extends AppCompatActivity
|
|||
|
||||
if (Helpers.isOnline(MainActivity.this)) {
|
||||
webView.loadUrl(webView.getUrl());
|
||||
setTitle(R.string.app_name);
|
||||
} else {
|
||||
Snackbar.make(swipeRefreshLayout, R.string.no_internet, Snackbar.LENGTH_LONG).show();
|
||||
}
|
||||
|
||||
}
|
||||
}).show();
|
||||
}
|
||||
|
@ -777,6 +783,7 @@ public class MainActivity extends AppCompatActivity
|
|||
public void onClick(View view) {
|
||||
if (Helpers.isOnline(MainActivity.this)) {
|
||||
webView.loadUrl("https://" + podDomain + "/notifications");
|
||||
setTitle(R.string.title_notifications);
|
||||
} else {
|
||||
Snackbar.make(swipeRefreshLayout, R.string.no_internet, Snackbar.LENGTH_LONG).show();
|
||||
}
|
||||
|
@ -822,6 +829,7 @@ public class MainActivity extends AppCompatActivity
|
|||
public void onClick(View view) {
|
||||
if (Helpers.isOnline(MainActivity.this)) {
|
||||
webView.loadUrl("https://" + podDomain + "/conversations");
|
||||
setTitle(R.string.title_conversations);
|
||||
} else {
|
||||
Snackbar.make(swipeRefreshLayout, R.string.no_internet, Snackbar.LENGTH_LONG).show();
|
||||
}
|
||||
|
@ -847,6 +855,7 @@ public class MainActivity extends AppCompatActivity
|
|||
case R.id.nav_stream: {
|
||||
if (Helpers.isOnline(MainActivity.this)) {
|
||||
webView.loadUrl("https://" + podDomain + "/stream");
|
||||
setTitle(R.string.title_stream);
|
||||
} else {
|
||||
Snackbar.make(swipeRefreshLayout, R.string.no_internet, Snackbar.LENGTH_LONG).show();
|
||||
}
|
||||
|
@ -856,6 +865,7 @@ public class MainActivity extends AppCompatActivity
|
|||
case R.id.nav_profile: {
|
||||
if (Helpers.isOnline(MainActivity.this)) {
|
||||
webView.loadUrl("https://" + podDomain + "/people/" + appSettings.getProfileId());
|
||||
setTitle(R.string.title_profil);
|
||||
} else {
|
||||
Snackbar.make(swipeRefreshLayout, R.string.no_internet, Snackbar.LENGTH_LONG).show();
|
||||
}
|
||||
|
@ -866,6 +876,7 @@ public class MainActivity extends AppCompatActivity
|
|||
case R.id.nav_followed_tags: {
|
||||
if (Helpers.isOnline(MainActivity.this)) {
|
||||
webView.loadUrl("https://" + podDomain + "/followed_tags");
|
||||
setTitle(R.string.jb_followed_tags);
|
||||
} else {
|
||||
Snackbar.make(swipeRefreshLayout, R.string.no_internet, Snackbar.LENGTH_LONG).show();
|
||||
}
|
||||
|
@ -876,6 +887,7 @@ public class MainActivity extends AppCompatActivity
|
|||
if (Helpers.isOnline(MainActivity.this)) {
|
||||
// webView.loadUrl("https://" + podDomain + "/aspects");
|
||||
Helpers.showAspectList(webView, app);
|
||||
setTitle(R.string.title_aspects);
|
||||
} else {
|
||||
Snackbar.make(swipeRefreshLayout, R.string.no_internet, Snackbar.LENGTH_LONG).show();
|
||||
}
|
||||
|
@ -885,6 +897,7 @@ public class MainActivity extends AppCompatActivity
|
|||
case R.id.nav_activities: {
|
||||
if (Helpers.isOnline(MainActivity.this)) {
|
||||
webView.loadUrl("https://" + podDomain + "/activity");
|
||||
setTitle(R.string.title_activities);
|
||||
} else {
|
||||
Snackbar.make(swipeRefreshLayout, R.string.no_internet, Snackbar.LENGTH_LONG).show();
|
||||
}
|
||||
|
@ -894,6 +907,7 @@ public class MainActivity extends AppCompatActivity
|
|||
case R.id.nav_liked: {
|
||||
if (Helpers.isOnline(MainActivity.this)) {
|
||||
webView.loadUrl("https://" + podDomain + "/liked");
|
||||
setTitle(R.string.title_liked);
|
||||
} else {
|
||||
Snackbar.make(swipeRefreshLayout, R.string.no_internet, Snackbar.LENGTH_LONG).show();
|
||||
}
|
||||
|
@ -903,6 +917,7 @@ public class MainActivity extends AppCompatActivity
|
|||
case R.id.nav_commented: {
|
||||
if (Helpers.isOnline(MainActivity.this)) {
|
||||
webView.loadUrl("https://" + podDomain + "/commented");
|
||||
setTitle(R.string.title_commented);
|
||||
} else {
|
||||
Snackbar.make(swipeRefreshLayout, R.string.no_internet, Snackbar.LENGTH_LONG).show();
|
||||
}
|
||||
|
@ -912,6 +927,7 @@ public class MainActivity extends AppCompatActivity
|
|||
case R.id.nav_mentions: {
|
||||
if (Helpers.isOnline(MainActivity.this)) {
|
||||
webView.loadUrl("https://" + podDomain + "/mentions");
|
||||
setTitle(R.string.title_mentions);
|
||||
} else {
|
||||
Snackbar.make(swipeRefreshLayout, R.string.no_internet, Snackbar.LENGTH_LONG).show();
|
||||
}
|
||||
|
@ -921,6 +937,7 @@ public class MainActivity extends AppCompatActivity
|
|||
case R.id.nav_public: {
|
||||
if (Helpers.isOnline(MainActivity.this)) {
|
||||
webView.loadUrl("https://" + podDomain + "/public");
|
||||
setTitle(R.string.title_public);
|
||||
} else {
|
||||
Snackbar.make(swipeRefreshLayout, R.string.no_internet, Snackbar.LENGTH_LONG).show();
|
||||
}
|
||||
|
|
|
@ -80,6 +80,7 @@ public class ShareActivity extends MainActivity {
|
|||
}
|
||||
});
|
||||
}
|
||||
setTitle(R.string.new_post);
|
||||
|
||||
progressBar = (ProgressBar) findViewById(R.id.progressBar);
|
||||
|
||||
|
|
|
@ -1,12 +1,8 @@
|
|||
package com.github.dfa.diaspora_android.data;
|
||||
|
||||
import android.animation.ObjectAnimator;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
|
||||
/**
|
||||
* Created by gsantner on 20.03.16. Part of Diaspora for Android.
|
||||
*/
|
||||
|
|
|
@ -1,11 +1,7 @@
|
|||
package com.github.dfa.diaspora_android.data;
|
||||
|
||||
import android.support.v4.content.ContextCompat;
|
||||
|
||||
import com.github.dfa.diaspora_android.App;
|
||||
import com.github.dfa.diaspora_android.R;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
|
|
|
@ -15,7 +15,6 @@ import android.os.Environment;
|
|||
import android.util.AttributeSet;
|
||||
import android.view.ContextMenu;
|
||||
import android.view.MenuItem;
|
||||
import android.webkit.WebView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.github.dfa.diaspora_android.R;
|
||||
|
|
|
@ -4,7 +4,6 @@ import android.content.Intent;
|
|||
import android.graphics.Bitmap;
|
||||
import android.net.Uri;
|
||||
import android.support.v4.widget.SwipeRefreshLayout;
|
||||
import android.util.Log;
|
||||
import android.webkit.CookieManager;
|
||||
import android.webkit.WebView;
|
||||
import android.webkit.WebViewClient;
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="@color/label_background" />
|
||||
<padding
|
||||
android:bottom="4dp"
|
||||
android:left="16dp"
|
||||
android:right="16dp"
|
||||
android:top="4dp" />
|
||||
<corners android:radius="2dp" />
|
||||
</shape>
|
|
@ -33,7 +33,6 @@
|
|||
android:layout_width="fill_parent"
|
||||
android:indeterminate="false"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxHeight="4dip"
|
||||
android:minHeight="4dip" />
|
||||
android:layout_marginTop="-7dp" />
|
||||
|
||||
</RelativeLayout>
|
|
@ -7,7 +7,6 @@
|
|||
android:theme="@style/ThemeOverlay.AppCompat.Dark">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/navheader_background_image"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop"
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
</android.support.design.widget.AppBarLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/podsLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingBottom="@dimen/activity_vertical_margin"
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
<string name="podlist_source_note">Anmerkung: Die Podliste wird aus den sicheren Pods, die bei https://podupti.me gelistet sind generiert.</string>
|
||||
<string name="valid_pod">Bitte einen gültigen Domain-Namen (URL) eingeben</string>
|
||||
<string name="podlist_error">Fehler: Konnte die Podliste nicht abfragen!</string>
|
||||
<string name="loading_podlist">Podliste wird geladen…</string>
|
||||
<string name="no_internet">Entschuldigung, du musst mit dem Internet verbunden sein um fortzufahren.</string>
|
||||
<string name="confirmation">Bestätigung</string>
|
||||
<string name="confirm_pod">Möchtest du wirklich \nhttps://%1$s\nals deinen Diaspora Pod auswählen?</string>
|
||||
|
@ -28,12 +27,23 @@
|
|||
<string name="permission_denied">Berechtigung verweigert.</string>
|
||||
<string name="permission_granted_try_again">Berechtigung erteilt. Bitte versuche es erneut.</string>
|
||||
|
||||
//Titles
|
||||
|
||||
<string name="title_notifications">D* Benachrichtigungen</string>
|
||||
<string name="title_conversations">D* Unterhaltungen</string>
|
||||
<string name="title_stream">D* Stream</string>
|
||||
<string name="title_profil">D* Profil</string>
|
||||
<string name="title_aspects">D* Aspekte</string>
|
||||
<string name="title_activities">D* Aktivitäten</string>
|
||||
<string name="title_liked">D* Gelikte Beiträge</string>
|
||||
<string name="title_commented">D* Kommentiert</string>
|
||||
<string name="title_mentions">D* Erwähnungen</string>
|
||||
<string name="title_public">D* Öffentliche Aktivitäten</string>
|
||||
|
||||
// Drawer and App
|
||||
|
||||
<string name="jb_menu_1">Einstellungen</string>
|
||||
<string name="jb_stream">Stream</string>
|
||||
<string name="jb_notifications">Benachrichtigungen</string>
|
||||
<string name="jb_conversations">Unterhaltungen</string>
|
||||
<string name="jb_liked">Gelikte Beiträge</string>
|
||||
<string name="jb_commented">Kommentierte Beiträge</string>
|
||||
<string name="jb_contacts">Kontakte</string>
|
||||
|
@ -56,7 +66,6 @@
|
|||
<string name="search_alert_tag">nach Tags</string>
|
||||
<string name="search_alert_people">nach Personen</string>
|
||||
<string name="search_alert_bypeople_validate_needsomedata">Füge einen Namen ein.</string>
|
||||
<string name="search_alert_bytags_validate_needsomedata">Versuche einen Tag wie: #neuhier oder #kunst</string>
|
||||
|
||||
//Dialog
|
||||
|
||||
|
@ -147,15 +156,11 @@ along with this program. If not, see http://www.gnu.org/licenses.<br> <br
|
|||
<i>Die Bilder des Startbildschirms können auf Flickr gefunden werden:
|
||||
https://www.flickr.com/photos/129581906@N06/sets/72157651933980136/with/16594947123.
|
||||
Sie wurden von \"Lydia\" veröffentlicht und stehen unter der cc by-nc-sa Lizenz.</i></string>
|
||||
<string name="search_by_person">Suche nach Personen …</string>
|
||||
<string name="search_by_tag">Suche nach Tags …</string>
|
||||
<string name="splash_screen_description">Startbildschirm</string>
|
||||
<string name="new_conversations">Ungelesene Unterhaltung. Öffnen?</string>
|
||||
<string name="new_notifications">Ungelesene Benachrichtigung. Lesen?</string>
|
||||
<string name="help_about">Changelog</string>
|
||||
<string name="new_post2">D* Titel und Text</string>
|
||||
<string name="jb_profile">Profil</string>
|
||||
<string name="new_post1">D* nur Text</string>
|
||||
<string name="shared_by_diaspora_android">*[geteilt durch #DiasporaForAndroid]*</string>
|
||||
<string name="settings_images_switch_off">Bilder nicht laden</string>
|
||||
<string name="settings_images_switch_on">Bilder laden</string>
|
||||
|
|
|
@ -7,22 +7,10 @@
|
|||
<!-- Colors from Palette -->
|
||||
<color name="primary">#607d8b</color>
|
||||
<color name="primary_dark">#607d8b</color>
|
||||
<color name="primary_light">#CFD8DC</color>
|
||||
<color name="accent">#4CAF50</color>
|
||||
<color name="primary_text">#212121</color>
|
||||
<color name="secondary_text">#727272</color>
|
||||
<color name="icons">#FFFFFF</color>
|
||||
<color name="divider">#B6B6B6</color>
|
||||
<!-- End colors from Palette -->
|
||||
|
||||
<color name="fab_big">@color/accent</color>
|
||||
<color name="fab_big_pressed">#388E3C</color>
|
||||
|
||||
<color name="fab_small">#607d8b</color>
|
||||
<color name="fab_small_pressed">#90a4ae</color>
|
||||
|
||||
<color name="label_background">#BC212121</color>
|
||||
<color name="label_text">#ffffff</color>
|
||||
|
||||
<color name="white">#ffffff</color>
|
||||
</resources>
|
||||
|
|
|
@ -19,6 +19,21 @@
|
|||
<string name="permission_denied">Permission denied.</string>
|
||||
<string name="permission_granted_try_again">Permission granted. Please try again.</string>
|
||||
|
||||
|
||||
//Titles
|
||||
|
||||
<string name="title_notifications">D* Notifications</string>
|
||||
<string name="title_conversations">D* Conversations</string>
|
||||
<string name="title_stream">D* Stream</string>
|
||||
<string name="title_profil">D* Profil</string>
|
||||
<string name="title_aspects">D* Aspects</string>
|
||||
<string name="title_activities">D* Activities</string>
|
||||
<string name="title_liked">D* Liked</string>
|
||||
<string name="title_commented">D* Commented</string>
|
||||
<string name="title_mentions">D* Mentions</string>
|
||||
<string name="title_public">D* Public</string>
|
||||
|
||||
|
||||
//Pod Activity
|
||||
|
||||
<string name="title_activity_pods">Select Pod</string>
|
||||
|
@ -27,7 +42,6 @@
|
|||
<string name="podlist_source_note">Note: The podlist is populated by secure pods listed on https://podupti.me. You can enter in the edit field any pod not listed.</string>
|
||||
<string name="valid_pod">Please enter a valid domain name</string>
|
||||
<string name="podlist_error">Error: Could not retrieve list of pods!</string>
|
||||
<string name="loading_podlist">Loading pod list …</string>
|
||||
|
||||
|
||||
<string name="no_internet">Sorry, you must be connected to the Internet to proceed</string>
|
||||
|
@ -36,8 +50,6 @@
|
|||
<string name="confirm_exit">Do you want to exit?</string>
|
||||
<string name="change_pod_warning">This will erase all cookies and session data. Do you really want to change pods?</string>
|
||||
<string name="new_post">D* New message</string>
|
||||
<string name="new_post1">D* Text only</string>
|
||||
<string name="new_post2">D* Title and text</string>
|
||||
<string name="notifications">Notifications</string>
|
||||
<string name="messages">Conversations</string>
|
||||
|
||||
|
@ -47,8 +59,6 @@
|
|||
<string name="jb_menu_1">Settings</string>
|
||||
<string name="jb_help_license">About the app | Help</string>
|
||||
<string name="jb_stream">Stream</string>
|
||||
<string name="jb_notifications">Notifications</string>
|
||||
<string name="jb_conversations">Conversations</string>
|
||||
<string name="jb_liked">Liked</string>
|
||||
<string name="jb_commented">Commented</string>
|
||||
<string name="jb_contacts">Contacts</string>
|
||||
|
@ -83,8 +93,6 @@
|
|||
|
||||
<string name="go_to_top">Go to top</string>
|
||||
<string name="search_by_tags_or_persons">Search by tags or persons</string>
|
||||
<string name="search_by_tag">Search for tag …</string>
|
||||
<string name="search_by_person">Search for person …</string>
|
||||
<string name="compose">New message</string>
|
||||
|
||||
|
||||
|
@ -92,7 +100,6 @@
|
|||
<string name="search_alert_tag">by tags</string>
|
||||
<string name="search_alert_people">by people</string>
|
||||
<string name="search_alert_bypeople_validate_needsomedata">Please add a name</string>
|
||||
<string name="search_alert_bytags_validate_needsomedata">Try to add a tag like: #newhere or #art</string>
|
||||
|
||||
//Dialog //License
|
||||
|
||||
|
|
|
@ -17,9 +17,4 @@
|
|||
|
||||
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
|
||||
|
||||
<style name="menu_labels_style">
|
||||
<item name="android:background">@drawable/fab_label_background</item>
|
||||
<item name="android:textColor">@color/label_text</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
|
|
Loading…
Reference in a new issue