Merge pull request #3 from de-live-gdev/master
gitignore;Link to profile; Move menu actions; Refactoring part1; #1 ; bump libs
57
.gitignore
vendored
|
@ -1,8 +1,53 @@
|
||||||
*.iml
|
*~
|
||||||
|
|
||||||
|
# Gradle
|
||||||
|
.gradle/
|
||||||
.gradle
|
.gradle
|
||||||
/local.properties
|
build/
|
||||||
/.idea/workspace.xml
|
/*/build/
|
||||||
/.idea/libraries
|
|
||||||
|
# User-specific configurations
|
||||||
|
local.properties
|
||||||
|
|
||||||
|
.idea
|
||||||
|
.idea/libraries/
|
||||||
|
.idea/runConfigurations.xml
|
||||||
|
.idea/gradle.xml
|
||||||
|
.idea/workspace.xml
|
||||||
|
.idea/tasks.xml
|
||||||
|
.idea/.name
|
||||||
|
.idea/compiler.xml
|
||||||
|
.idea/copyright/profiles_settings.xml
|
||||||
|
.idea/encodings.xml
|
||||||
|
.idea/misc.xml
|
||||||
|
.idea/modules.xml
|
||||||
|
.idea/scopes/scope_settings.xml
|
||||||
|
.idea/vcs.xml
|
||||||
|
*.iml
|
||||||
|
|
||||||
|
# OS-specific files
|
||||||
.DS_Store
|
.DS_Store
|
||||||
/build
|
.DS_Store?
|
||||||
/captures
|
._*
|
||||||
|
.Trashes
|
||||||
|
ehthumbs.db
|
||||||
|
Thumbs.db
|
||||||
|
|
||||||
|
# Built application files
|
||||||
|
*.apk
|
||||||
|
*.ap_
|
||||||
|
|
||||||
|
# Files for the Dalvik VM
|
||||||
|
*.dex
|
||||||
|
|
||||||
|
# Java class files
|
||||||
|
*.class
|
||||||
|
|
||||||
|
# Generated files
|
||||||
|
bin/
|
||||||
|
gen/
|
||||||
|
|
||||||
|
local.properties
|
||||||
|
proguard/
|
||||||
|
*.log
|
||||||
|
.navigation/
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
Diaspora
|
|
|
@ -1,22 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="CompilerConfiguration">
|
|
||||||
<resourceExtensions />
|
|
||||||
<wildcardResourcePatterns>
|
|
||||||
<entry name="!?*.java" />
|
|
||||||
<entry name="!?*.form" />
|
|
||||||
<entry name="!?*.class" />
|
|
||||||
<entry name="!?*.groovy" />
|
|
||||||
<entry name="!?*.scala" />
|
|
||||||
<entry name="!?*.flex" />
|
|
||||||
<entry name="!?*.kt" />
|
|
||||||
<entry name="!?*.clj" />
|
|
||||||
<entry name="!?*.aj" />
|
|
||||||
</wildcardResourcePatterns>
|
|
||||||
<annotationProcessing>
|
|
||||||
<profile default="true" name="Default" enabled="false">
|
|
||||||
<processorPath useClasspath="true" />
|
|
||||||
</profile>
|
|
||||||
</annotationProcessing>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
|
@ -1,3 +0,0 @@
|
||||||
<component name="CopyrightManager">
|
|
||||||
<settings default="" />
|
|
||||||
</component>
|
|
|
@ -1,19 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="GradleSettings">
|
|
||||||
<option name="linkedExternalProjectsSettings">
|
|
||||||
<GradleProjectSettings>
|
|
||||||
<option name="distributionType" value="LOCAL" />
|
|
||||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
|
||||||
<option name="gradleHome" value="$APPLICATION_HOME_DIR$/gradle/gradle-2.8" />
|
|
||||||
<option name="gradleJvm" value="1.8" />
|
|
||||||
<option name="modules">
|
|
||||||
<set>
|
|
||||||
<option value="$PROJECT_DIR$" />
|
|
||||||
<option value="$PROJECT_DIR$/app" />
|
|
||||||
</set>
|
|
||||||
</option>
|
|
||||||
</GradleProjectSettings>
|
|
||||||
</option>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
|
@ -1,46 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="EntryPointsManager">
|
|
||||||
<entry_points version="2.0" />
|
|
||||||
</component>
|
|
||||||
<component name="NullableNotNullManager">
|
|
||||||
<option name="myDefaultNullable" value="android.support.annotation.Nullable" />
|
|
||||||
<option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
|
|
||||||
<option name="myNullables">
|
|
||||||
<value>
|
|
||||||
<list size="4">
|
|
||||||
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
|
|
||||||
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
|
|
||||||
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
|
|
||||||
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
|
|
||||||
</list>
|
|
||||||
</value>
|
|
||||||
</option>
|
|
||||||
<option name="myNotNulls">
|
|
||||||
<value>
|
|
||||||
<list size="4">
|
|
||||||
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
|
|
||||||
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
|
|
||||||
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
|
|
||||||
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
|
|
||||||
</list>
|
|
||||||
</value>
|
|
||||||
</option>
|
|
||||||
</component>
|
|
||||||
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
|
|
||||||
<OptionsSetting value="true" id="Add" />
|
|
||||||
<OptionsSetting value="true" id="Remove" />
|
|
||||||
<OptionsSetting value="true" id="Checkout" />
|
|
||||||
<OptionsSetting value="true" id="Update" />
|
|
||||||
<OptionsSetting value="true" id="Status" />
|
|
||||||
<OptionsSetting value="true" id="Edit" />
|
|
||||||
<ConfirmationsSetting value="0" id="Add" />
|
|
||||||
<ConfirmationsSetting value="0" id="Remove" />
|
|
||||||
</component>
|
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
|
||||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
|
||||||
</component>
|
|
||||||
<component name="ProjectType">
|
|
||||||
<option name="id" value="Android" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
|
@ -1,9 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="ProjectModuleManager">
|
|
||||||
<modules>
|
|
||||||
<module fileurl="file://$PROJECT_DIR$/Diaspora.iml" filepath="$PROJECT_DIR$/Diaspora.iml" />
|
|
||||||
<module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
|
|
||||||
</modules>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
|
@ -1,12 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="RunConfigurationProducerService">
|
|
||||||
<option name="ignoredProducers">
|
|
||||||
<set>
|
|
||||||
<option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
|
|
||||||
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
|
|
||||||
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
|
|
||||||
</set>
|
|
||||||
</option>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
|
@ -1,6 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="VcsDirectoryMappings">
|
|
||||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
|
@ -27,7 +27,7 @@ android {
|
||||||
dependencies {
|
dependencies {
|
||||||
compile fileTree(dir: 'libs', include: ['*.jar'])
|
compile fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
testCompile 'junit:junit:4.12'
|
testCompile 'junit:junit:4.12'
|
||||||
compile 'com.android.support:appcompat-v7:23.1.1'
|
compile 'com.android.support:appcompat-v7:23.2.1'
|
||||||
compile 'com.android.support:design:23.1.1'
|
compile 'com.android.support:design:23.2.1'
|
||||||
compile 'com.getbase:floatingactionbutton:1.9.1'
|
compile 'com.getbase:floatingactionbutton:1.9.1'
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
package de.baumann.diaspora;
|
|
||||||
|
|
||||||
import android.app.Application;
|
|
||||||
import android.test.ApplicationTestCase;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
|
|
||||||
*/
|
|
||||||
public class ApplicationTest extends ApplicationTestCase<Application> {
|
|
||||||
public ApplicationTest() {
|
|
||||||
super(Application.class);
|
|
||||||
}
|
|
||||||
}
|
|
32
app/src/main/java/de/baumann/diaspora/AppSettings.java
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
package de.baumann.diaspora;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by de-live-gdev on 20.03.16.
|
||||||
|
*/
|
||||||
|
public class AppSettings {
|
||||||
|
private Context context;
|
||||||
|
private SharedPreferences pref;
|
||||||
|
|
||||||
|
public AppSettings(Context context){
|
||||||
|
this.context = context.getApplicationContext();
|
||||||
|
pref = this.context.getSharedPreferences("app", Context.MODE_PRIVATE);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setString(String key, String value){
|
||||||
|
pref.edit().putString(key,value).apply();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
// Setters & Getters
|
||||||
|
*/
|
||||||
|
private static final String PREF_PROFILE_ID = "profileID";
|
||||||
|
public String getProfileId(){
|
||||||
|
return pref.getString(PREF_PROFILE_ID, "");
|
||||||
|
}
|
||||||
|
public void setProfileId(String profileId){
|
||||||
|
setString(PREF_PROFILE_ID, profileId);
|
||||||
|
}
|
||||||
|
}
|
|
@ -57,7 +57,6 @@ import android.view.Menu;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.webkit.JavascriptInterface;
|
import android.webkit.JavascriptInterface;
|
||||||
import android.webkit.JsResult;
|
|
||||||
import android.webkit.ValueCallback;
|
import android.webkit.ValueCallback;
|
||||||
import android.webkit.WebChromeClient;
|
import android.webkit.WebChromeClient;
|
||||||
import android.webkit.WebSettings;
|
import android.webkit.WebSettings;
|
||||||
|
@ -82,24 +81,26 @@ public class MainActivity extends AppCompatActivity
|
||||||
implements NavigationView.OnNavigationItemSelectedListener {
|
implements NavigationView.OnNavigationItemSelectedListener {
|
||||||
|
|
||||||
|
|
||||||
private static final String URL_MESSAGE = "URL_MESSAGE";
|
|
||||||
final Handler myHandler = new Handler();
|
|
||||||
WebView webView;
|
|
||||||
static final String TAG = "Diaspora Main";
|
|
||||||
String podDomain;
|
|
||||||
Menu menu;
|
|
||||||
int notificationCount = 0;
|
|
||||||
int conversationCount = 0;
|
|
||||||
ValueCallback<Uri[]> mFilePathCallback;
|
|
||||||
String mCameraPhotoPath;
|
|
||||||
public static final int INPUT_FILE_REQUEST_CODE = 1;
|
public static final int INPUT_FILE_REQUEST_CODE = 1;
|
||||||
com.getbase.floatingactionbutton.FloatingActionsMenu fab;
|
private static final int REQUEST_CODE_ASK_PERMISSIONS = 123;
|
||||||
TextView txtTitle;
|
private static final String URL_MESSAGE = "URL_MESSAGE";
|
||||||
ProgressBar progressBar;
|
|
||||||
WebSettings wSettings;
|
private AppSettings appSettings;
|
||||||
PrefManager pm;
|
private final Handler myHandler = new Handler();
|
||||||
|
private WebView webView;
|
||||||
|
private String podDomain;
|
||||||
|
private Menu menu;
|
||||||
|
private int notificationCount = 0;
|
||||||
|
private int conversationCount = 0;
|
||||||
|
private String profileId = "";
|
||||||
|
private ValueCallback<Uri[]> mFilePathCallback;
|
||||||
|
private String mCameraPhotoPath;
|
||||||
|
private com.getbase.floatingactionbutton.FloatingActionsMenu fab;
|
||||||
|
private TextView txtTitle;
|
||||||
|
private ProgressBar progressBar;
|
||||||
|
private WebSettings wSettings;
|
||||||
|
private PrefManager pm;
|
||||||
private SwipeRefreshLayout swipeView;
|
private SwipeRefreshLayout swipeView;
|
||||||
final private int REQUEST_CODE_ASK_PERMISSIONS = 123;
|
|
||||||
|
|
||||||
@SuppressLint("SetJavaScriptEnabled")
|
@SuppressLint("SetJavaScriptEnabled")
|
||||||
@Override
|
@Override
|
||||||
|
@ -125,6 +126,11 @@ public class MainActivity extends AppCompatActivity
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// Load app settings
|
||||||
|
appSettings = new AppSettings(getApplicationContext());
|
||||||
|
profileId = appSettings.getProfileId();
|
||||||
|
|
||||||
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
|
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
|
||||||
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
|
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
|
||||||
this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
|
this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
|
||||||
|
@ -148,7 +154,7 @@ public class MainActivity extends AppCompatActivity
|
||||||
R.color.fab_big);
|
R.color.fab_big);
|
||||||
|
|
||||||
webView = (WebView) findViewById(R.id.webView);
|
webView = (WebView) findViewById(R.id.webView);
|
||||||
webView.addJavascriptInterface(new JavaScriptInterface(), "NotificationCounter");
|
webView.addJavascriptInterface(new JavaScriptInterface(), "AndroidBridge");
|
||||||
|
|
||||||
if (savedInstanceState != null) {
|
if (savedInstanceState != null) {
|
||||||
webView.restoreState(savedInstanceState);
|
webView.restoreState(savedInstanceState);
|
||||||
|
@ -209,6 +215,7 @@ public class MainActivity extends AppCompatActivity
|
||||||
|
|
||||||
if (progress > 60) {
|
if (progress > 60) {
|
||||||
Helpers.hideTopBar(wv);
|
Helpers.hideTopBar(wv);
|
||||||
|
Helpers.getProfileId(wv);
|
||||||
fab.setVisibility(View.VISIBLE);
|
fab.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -269,10 +276,6 @@ public class MainActivity extends AppCompatActivity
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean onJsAlert(WebView view, String url, String message, JsResult result) {
|
|
||||||
return super.onJsAlert(view, url, message, result);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
@ -304,11 +307,12 @@ public class MainActivity extends AppCompatActivity
|
||||||
public void fab2_click(View v) {
|
public void fab2_click(View v) {
|
||||||
fab.collapse();
|
fab.collapse();
|
||||||
if (Helpers.isOnline(MainActivity.this)) {
|
if (Helpers.isOnline(MainActivity.this)) {
|
||||||
final AlertDialog.Builder alert = new AlertDialog.Builder(this);
|
|
||||||
final EditText input = new EditText(this);
|
final EditText input = new EditText(this);
|
||||||
alert.setView(input);
|
final AlertDialog.Builder dialog = new AlertDialog.Builder(this)
|
||||||
alert.setTitle(R.string.search_alert_title);
|
.setView(input)
|
||||||
alert.setPositiveButton(R.string.search_alert_people, new DialogInterface.OnClickListener() {
|
.setIcon(R.drawable.ic_launcher)
|
||||||
|
.setTitle(R.string.search_alert_title)
|
||||||
|
.setPositiveButton(R.string.search_alert_people, new DialogInterface.OnClickListener() {
|
||||||
public void onClick(DialogInterface dialog, int whichButton) {
|
public void onClick(DialogInterface dialog, int whichButton) {
|
||||||
String inputTag = input.getText().toString().trim();
|
String inputTag = input.getText().toString().trim();
|
||||||
String cleanTag = inputTag.replaceAll("\\*", "");
|
String cleanTag = inputTag.replaceAll("\\*", "");
|
||||||
|
@ -321,7 +325,8 @@ public class MainActivity extends AppCompatActivity
|
||||||
setTitle(R.string.fab2_title_person);
|
setTitle(R.string.fab2_title_person);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}).setNegativeButton(R.string.search_alert_tag,
|
})
|
||||||
|
.setNegativeButton(R.string.search_alert_tag,
|
||||||
new DialogInterface.OnClickListener() {
|
new DialogInterface.OnClickListener() {
|
||||||
public void onClick(DialogInterface dialog, int whichButton) {
|
public void onClick(DialogInterface dialog, int whichButton) {
|
||||||
String inputTag = input.getText().toString().trim();
|
String inputTag = input.getText().toString().trim();
|
||||||
|
@ -336,9 +341,8 @@ public class MainActivity extends AppCompatActivity
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
alert.show();
|
dialog.show();
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
Snackbar.make(swipeView, R.string.no_internet, Snackbar.LENGTH_INDEFINITE).show();
|
Snackbar.make(swipeView, R.string.no_internet, Snackbar.LENGTH_INDEFINITE).show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -432,7 +436,7 @@ public class MainActivity extends AppCompatActivity
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private BroadcastReceiver brLoadUrl = new BroadcastReceiver() {
|
private final BroadcastReceiver brLoadUrl = new BroadcastReceiver() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onReceive(Context context, Intent intent) {
|
public void onReceive(Context context, Intent intent) {
|
||||||
|
@ -457,7 +461,7 @@ public class MainActivity extends AppCompatActivity
|
||||||
@Override
|
@Override
|
||||||
public boolean onPrepareOptionsMenu(Menu menu) {
|
public boolean onPrepareOptionsMenu(Menu menu) {
|
||||||
this.menu = menu;
|
this.menu = menu;
|
||||||
MenuItem itemNotification = menu.findItem(R.id.notifications);
|
MenuItem itemNotification = menu.findItem(R.id.action_notifications);
|
||||||
if (itemNotification != null) {
|
if (itemNotification != null) {
|
||||||
if (notificationCount > 0) {
|
if (notificationCount > 0) {
|
||||||
itemNotification.setIcon(R.drawable.ic_bell_ring_white_24dp);
|
itemNotification.setIcon(R.drawable.ic_bell_ring_white_24dp);
|
||||||
|
@ -465,7 +469,7 @@ public class MainActivity extends AppCompatActivity
|
||||||
itemNotification.setIcon(R.drawable.ic_bell_outline_white_24dp);
|
itemNotification.setIcon(R.drawable.ic_bell_outline_white_24dp);
|
||||||
}
|
}
|
||||||
|
|
||||||
MenuItem itemConversation = menu.findItem(R.id.conversations);
|
MenuItem itemConversation = menu.findItem(R.id.action_conversations);
|
||||||
if (conversationCount > 0) {
|
if (conversationCount > 0) {
|
||||||
itemConversation.setIcon(R.drawable.ic_message_text_white_24dp);
|
itemConversation.setIcon(R.drawable.ic_message_text_white_24dp);
|
||||||
} else {
|
} else {
|
||||||
|
@ -477,9 +481,8 @@ public class MainActivity extends AppCompatActivity
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
int id = item.getItemId();
|
switch (item.getItemId()) {
|
||||||
|
case R.id.action_notifications: {
|
||||||
if (id == R.id.notifications) {
|
|
||||||
if (Helpers.isOnline(MainActivity.this)) {
|
if (Helpers.isOnline(MainActivity.this)) {
|
||||||
webView.loadUrl("https://" + podDomain + "/notifications");
|
webView.loadUrl("https://" + podDomain + "/notifications");
|
||||||
setTitle(R.string.jb_notifications);
|
setTitle(R.string.jb_notifications);
|
||||||
|
@ -490,7 +493,7 @@ public class MainActivity extends AppCompatActivity
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (id == R.id.conversations) {
|
case R.id.action_conversations: {
|
||||||
if (Helpers.isOnline(MainActivity.this)) {
|
if (Helpers.isOnline(MainActivity.this)) {
|
||||||
webView.loadUrl("https://" + podDomain + "/conversations");
|
webView.loadUrl("https://" + podDomain + "/conversations");
|
||||||
setTitle(R.string.jb_conversations);
|
setTitle(R.string.jb_conversations);
|
||||||
|
@ -501,7 +504,7 @@ public class MainActivity extends AppCompatActivity
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (id == R.id.exit) {
|
case R.id.action_exit: {
|
||||||
Snackbar snackbar = Snackbar
|
Snackbar snackbar = Snackbar
|
||||||
.make(swipeView, R.string.confirm_exit, Snackbar.LENGTH_LONG)
|
.make(swipeView, R.string.confirm_exit, Snackbar.LENGTH_LONG)
|
||||||
.setAction(R.string.yes, new View.OnClickListener() {
|
.setAction(R.string.yes, new View.OnClickListener() {
|
||||||
|
@ -512,144 +515,22 @@ public class MainActivity extends AppCompatActivity
|
||||||
});
|
});
|
||||||
snackbar.show();
|
snackbar.show();
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
if (id == R.id.help_license) {
|
case R.id.action_share: {
|
||||||
final CharSequence[] options = { getString(R.string.help_license), getString(R.string.help_about), getString(R.string.help_help), getString(R.string.help_donate) };
|
|
||||||
new AlertDialog.Builder(MainActivity.this)
|
|
||||||
.setItems(options, new DialogInterface.OnClickListener() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
|
|
||||||
public void onClick(DialogInterface dialog, int item) {
|
|
||||||
|
|
||||||
if (options[item].equals(getString(R.string.help_license)))
|
|
||||||
|
|
||||||
{
|
|
||||||
final SpannableString s = new SpannableString(Html.fromHtml(getString(R.string.license_text)));
|
|
||||||
Linkify.addLinks(s, Linkify.WEB_URLS);
|
|
||||||
|
|
||||||
final AlertDialog d = new AlertDialog.Builder(MainActivity.this)
|
|
||||||
.setTitle(R.string.license_title)
|
|
||||||
.setMessage( s )
|
|
||||||
.setPositiveButton(getString(R.string.yes),
|
|
||||||
new DialogInterface.OnClickListener() {
|
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
|
||||||
dialog.cancel();
|
|
||||||
}
|
|
||||||
}).show();
|
|
||||||
d.show();
|
|
||||||
((TextView)d.findViewById(android.R.id.message)).setMovementMethod(LinkMovementMethod.getInstance());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (options[item].equals(getString(R.string.help_about)))
|
|
||||||
|
|
||||||
{
|
|
||||||
final SpannableString s = new SpannableString(Html.fromHtml(getString(R.string.about_text)));
|
|
||||||
Linkify.addLinks(s, Linkify.WEB_URLS);
|
|
||||||
|
|
||||||
final AlertDialog d = new AlertDialog.Builder(MainActivity.this)
|
|
||||||
.setTitle(R.string.help_about)
|
|
||||||
.setMessage(s)
|
|
||||||
.setPositiveButton(getString(R.string.yes),
|
|
||||||
new DialogInterface.OnClickListener() {
|
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
|
||||||
dialog.cancel();
|
|
||||||
}
|
|
||||||
}).show();
|
|
||||||
d.show();
|
|
||||||
((TextView)d.findViewById(android.R.id.message)).setMovementMethod(LinkMovementMethod.getInstance());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (options[item].equals(getString(R.string.help_help)))
|
|
||||||
|
|
||||||
{
|
|
||||||
new AlertDialog.Builder(MainActivity.this)
|
|
||||||
.setTitle(R.string.help_help)
|
|
||||||
.setMessage(Html.fromHtml(getString(R.string.markdown_text)))
|
|
||||||
.setPositiveButton(getString(R.string.yes),
|
|
||||||
new DialogInterface.OnClickListener() {
|
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
|
||||||
dialog.cancel();
|
|
||||||
}
|
|
||||||
}).show();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (options[item].equals(getString(R.string.help_donate)))
|
|
||||||
|
|
||||||
{
|
|
||||||
new AlertDialog.Builder(MainActivity.this)
|
|
||||||
.setMessage(getString(R.string.donate_text))
|
|
||||||
.setPositiveButton(getString(R.string.yes),
|
|
||||||
new DialogInterface.OnClickListener() {
|
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
|
||||||
dialog.cancel();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.setNegativeButton(getString(R.string.donate_1),
|
|
||||||
new DialogInterface.OnClickListener() {
|
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
|
||||||
Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse("http://martinv.tip.me/"));
|
|
||||||
startActivity(i);
|
|
||||||
dialog.cancel();
|
|
||||||
}
|
|
||||||
}).show();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}).show();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (id == R.id.view) {
|
|
||||||
final CharSequence[] options = { getString(R.string.settings_font), getString(R.string.settings_view),getString(R.string.settings_image) };
|
|
||||||
if (Helpers.isOnline(MainActivity.this)) {
|
|
||||||
new AlertDialog.Builder(MainActivity.this)
|
|
||||||
.setItems(options, new DialogInterface.OnClickListener() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
|
|
||||||
public void onClick(DialogInterface dialog, int item) {
|
|
||||||
|
|
||||||
if (options[item].equals(getString(R.string.settings_font)))
|
|
||||||
alertFormElements();
|
|
||||||
|
|
||||||
if (options[item].equals(getString(R.string.settings_view)))
|
|
||||||
webView.loadUrl("https://" + podDomain + "/mobile/toggle");
|
|
||||||
|
|
||||||
if (options[item].equals(getString(R.string.settings_image)))
|
|
||||||
wSettings.setLoadsImagesAutomatically(!pm.getLoadImages());
|
|
||||||
pm.setLoadImages(!pm.getLoadImages());
|
|
||||||
webView.loadUrl(webView.getUrl());
|
|
||||||
}
|
|
||||||
|
|
||||||
}).show();
|
|
||||||
} else {
|
|
||||||
Snackbar.make(swipeView, R.string.no_internet, Snackbar.LENGTH_INDEFINITE).show();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (id == R.id.share) {
|
|
||||||
final CharSequence[] options = {getString(R.string.share_link), getString(R.string.share_screenshot), getString(R.string.take_screenshot)};
|
final CharSequence[] options = {getString(R.string.share_link), getString(R.string.share_screenshot), getString(R.string.take_screenshot)};
|
||||||
new AlertDialog.Builder(MainActivity.this)
|
new AlertDialog.Builder(MainActivity.this)
|
||||||
.setItems(options, new DialogInterface.OnClickListener() {
|
.setItems(options, new DialogInterface.OnClickListener() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
||||||
public void onClick(DialogInterface dialog, int item) {
|
public void onClick(DialogInterface dialog, int item) {
|
||||||
|
if (options[item].equals(getString(R.string.share_link))) {
|
||||||
if (options[item].equals(getString(R.string.share_link)))
|
|
||||||
|
|
||||||
{
|
|
||||||
Intent sharingIntent = new Intent(Intent.ACTION_SEND);
|
Intent sharingIntent = new Intent(Intent.ACTION_SEND);
|
||||||
sharingIntent.setType("image/png");
|
sharingIntent.setType("image/png");
|
||||||
sharingIntent.putExtra(Intent.EXTRA_SUBJECT, webView.getTitle());
|
sharingIntent.putExtra(Intent.EXTRA_SUBJECT, webView.getTitle());
|
||||||
sharingIntent.putExtra(Intent.EXTRA_TEXT, webView.getUrl());
|
sharingIntent.putExtra(Intent.EXTRA_TEXT, webView.getUrl());
|
||||||
startActivity(Intent.createChooser(sharingIntent, "Share using"));
|
startActivity(Intent.createChooser(sharingIntent, "Share using"));
|
||||||
}
|
}
|
||||||
|
if (options[item].equals(getString(R.string.share_screenshot))) {
|
||||||
if (options[item].equals(getString(R.string.share_screenshot)))
|
|
||||||
|
|
||||||
{
|
|
||||||
if (android.os.Build.VERSION.SDK_INT >= 23) {
|
if (android.os.Build.VERSION.SDK_INT >= 23) {
|
||||||
int hasWRITE_EXTERNAL_STORAGE = checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE);
|
int hasWRITE_EXTERNAL_STORAGE = checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE);
|
||||||
if (hasWRITE_EXTERNAL_STORAGE != PackageManager.PERMISSION_GRANTED) {
|
if (hasWRITE_EXTERNAL_STORAGE != PackageManager.PERMISSION_GRANTED) {
|
||||||
|
@ -673,41 +554,31 @@ public class MainActivity extends AppCompatActivity
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Snackbar.make(swipeView, R.string.toast_screenshot, Snackbar.LENGTH_LONG).show();
|
Snackbar.make(swipeView, R.string.toast_screenshot, Snackbar.LENGTH_LONG).show();
|
||||||
File directory = new File(Environment.getExternalStorageDirectory() + "/Pictures/Diaspora/");
|
File directory = new File(Environment.getExternalStorageDirectory() + "/Pictures/Diaspora/");
|
||||||
if (!directory.exists()) {
|
if (!directory.exists()) {
|
||||||
directory.mkdirs();
|
directory.mkdirs();
|
||||||
}
|
}
|
||||||
|
|
||||||
Date date = new Date();
|
Date date = new Date();
|
||||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd_HH-mm");
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd_HH-mm");
|
||||||
|
|
||||||
Picture picture = webView.capturePicture();
|
Picture picture = webView.capturePicture();
|
||||||
Bitmap b = Bitmap.createBitmap(picture.getWidth(), picture.getHeight(), Bitmap.Config.ARGB_8888);
|
Bitmap b = Bitmap.createBitmap(picture.getWidth(), picture.getHeight(), Bitmap.Config.ARGB_8888);
|
||||||
Canvas c = new Canvas(b);
|
Canvas c = new Canvas(b);
|
||||||
|
|
||||||
File screen = new File(Environment.getExternalStorageDirectory() + "/Pictures/Diaspora/"
|
File screen = new File(Environment.getExternalStorageDirectory() + "/Pictures/Diaspora/"
|
||||||
+ dateFormat.format(date) + ".jpg");
|
+ dateFormat.format(date) + ".jpg");
|
||||||
if (screen.exists())
|
if (screen.exists())
|
||||||
screen.delete();
|
screen.delete();
|
||||||
|
|
||||||
picture.draw(c);
|
picture.draw(c);
|
||||||
|
|
||||||
FileOutputStream fos = null;
|
FileOutputStream fos = null;
|
||||||
try {
|
try {
|
||||||
|
|
||||||
fos = new FileOutputStream(screen);
|
fos = new FileOutputStream(screen);
|
||||||
if (fos != null) {
|
if (fos != null) {
|
||||||
b.compress(Bitmap.CompressFormat.JPEG, 90, fos);
|
b.compress(Bitmap.CompressFormat.JPEG, 90, fos);
|
||||||
|
|
||||||
fos.close();
|
fos.close();
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.getMessage();
|
e.getMessage();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Intent sharingIntent = new Intent(Intent.ACTION_SEND);
|
Intent sharingIntent = new Intent(Intent.ACTION_SEND);
|
||||||
sharingIntent.setType("image/png");
|
sharingIntent.setType("image/png");
|
||||||
sharingIntent.putExtra(Intent.EXTRA_SUBJECT, webView.getTitle());
|
sharingIntent.putExtra(Intent.EXTRA_SUBJECT, webView.getTitle());
|
||||||
|
@ -716,17 +587,13 @@ public class MainActivity extends AppCompatActivity
|
||||||
+ dateFormat.format(date) + ".jpg"));
|
+ dateFormat.format(date) + ".jpg"));
|
||||||
sharingIntent.putExtra(Intent.EXTRA_STREAM, bmpUri);
|
sharingIntent.putExtra(Intent.EXTRA_STREAM, bmpUri);
|
||||||
startActivity(Intent.createChooser(sharingIntent, "Share using"));
|
startActivity(Intent.createChooser(sharingIntent, "Share using"));
|
||||||
|
|
||||||
File file = new File(Environment.getExternalStorageDirectory() + "/Pictures/Diaspora/"
|
File file = new File(Environment.getExternalStorageDirectory() + "/Pictures/Diaspora/"
|
||||||
+ dateFormat.format(date) + ".jpg");
|
+ dateFormat.format(date) + ".jpg");
|
||||||
Uri uri = Uri.fromFile(file);
|
Uri uri = Uri.fromFile(file);
|
||||||
Intent intent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, uri);
|
Intent intent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, uri);
|
||||||
sendBroadcast(intent);
|
sendBroadcast(intent);
|
||||||
}
|
}
|
||||||
|
if (options[item].equals(getString(R.string.take_screenshot))) {
|
||||||
if (options[item].equals(getString(R.string.take_screenshot)))
|
|
||||||
|
|
||||||
{
|
|
||||||
if (android.os.Build.VERSION.SDK_INT >= 23) {
|
if (android.os.Build.VERSION.SDK_INT >= 23) {
|
||||||
int hasWRITE_EXTERNAL_STORAGE = checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE);
|
int hasWRITE_EXTERNAL_STORAGE = checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE);
|
||||||
if (hasWRITE_EXTERNAL_STORAGE != PackageManager.PERMISSION_GRANTED) {
|
if (hasWRITE_EXTERNAL_STORAGE != PackageManager.PERMISSION_GRANTED) {
|
||||||
|
@ -750,59 +617,47 @@ public class MainActivity extends AppCompatActivity
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Snackbar.make(swipeView, R.string.toast_screenshot, Snackbar.LENGTH_LONG).show();
|
Snackbar.make(swipeView, R.string.toast_screenshot, Snackbar.LENGTH_LONG).show();
|
||||||
|
|
||||||
File directory = new File(Environment.getExternalStorageDirectory() + "/Pictures/Diaspora/");
|
File directory = new File(Environment.getExternalStorageDirectory() + "/Pictures/Diaspora/");
|
||||||
if (!directory.exists()) {
|
if (!directory.exists()) {
|
||||||
directory.mkdirs();
|
directory.mkdirs();
|
||||||
}
|
}
|
||||||
|
|
||||||
Date date = new Date();
|
Date date = new Date();
|
||||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd_HH-mm");
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd_HH-mm");
|
||||||
|
|
||||||
Picture picture = webView.capturePicture();
|
Picture picture = webView.capturePicture();
|
||||||
Bitmap b = Bitmap.createBitmap(picture.getWidth(), picture.getHeight(), Bitmap.Config.ARGB_8888);
|
Bitmap b = Bitmap.createBitmap(picture.getWidth(), picture.getHeight(), Bitmap.Config.ARGB_8888);
|
||||||
Canvas c = new Canvas(b);
|
Canvas c = new Canvas(b);
|
||||||
|
|
||||||
File screen = new File(Environment.getExternalStorageDirectory() + "/Pictures/Diaspora/"
|
File screen = new File(Environment.getExternalStorageDirectory() + "/Pictures/Diaspora/"
|
||||||
+ dateFormat.format(date) + ".jpg");
|
+ dateFormat.format(date) + ".jpg");
|
||||||
if (screen.exists())
|
if (screen.exists())
|
||||||
screen.delete();
|
screen.delete();
|
||||||
|
|
||||||
picture.draw(c);
|
picture.draw(c);
|
||||||
|
|
||||||
FileOutputStream fos = null;
|
FileOutputStream fos = null;
|
||||||
try {
|
try {
|
||||||
|
|
||||||
fos = new FileOutputStream(screen);
|
fos = new FileOutputStream(screen);
|
||||||
if (fos != null) {
|
if (fos != null) {
|
||||||
b.compress(Bitmap.CompressFormat.JPEG, 90, fos);
|
b.compress(Bitmap.CompressFormat.JPEG, 90, fos);
|
||||||
|
|
||||||
fos.close();
|
fos.close();
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.getMessage();
|
e.getMessage();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
File file = new File(Environment.getExternalStorageDirectory() + "/Pictures/Diaspora/"
|
File file = new File(Environment.getExternalStorageDirectory() + "/Pictures/Diaspora/"
|
||||||
+ dateFormat.format(date) + ".jpg");
|
+ dateFormat.format(date) + ".jpg");
|
||||||
Uri uri = Uri.fromFile(file);
|
Uri uri = Uri.fromFile(file);
|
||||||
Intent intent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, uri);
|
Intent intent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, uri);
|
||||||
sendBroadcast(intent);
|
sendBroadcast(intent);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}).show();
|
}).show();
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
return super.onOptionsItemSelected(item);
|
return super.onOptionsItemSelected(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void alertFormElements() {
|
||||||
public void alertFormElements() {
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Inflate the XML view. activity_main is in
|
* Inflate the XML view. activity_main is in
|
||||||
|
@ -857,7 +712,7 @@ public class MainActivity extends AppCompatActivity
|
||||||
public void run() {
|
public void run() {
|
||||||
notificationCount = Integer.valueOf(webMessage);
|
notificationCount = Integer.valueOf(webMessage);
|
||||||
|
|
||||||
MenuItem item = menu.findItem(R.id.notifications);
|
MenuItem item = menu.findItem(R.id.action_notifications);
|
||||||
|
|
||||||
if (item != null) {
|
if (item != null) {
|
||||||
if (notificationCount > 0) {
|
if (notificationCount > 0) {
|
||||||
|
@ -886,6 +741,16 @@ public class MainActivity extends AppCompatActivity
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@JavascriptInterface
|
||||||
|
public void setProfileId(final String webMessage) {
|
||||||
|
if(profileId.equals("") || !profileId.equals(webMessage)) {
|
||||||
|
profileId = webMessage;
|
||||||
|
appSettings.setProfileId(profileId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@JavascriptInterface
|
@JavascriptInterface
|
||||||
public void setConversationCount(final String webMessage) {
|
public void setConversationCount(final String webMessage) {
|
||||||
myHandler.post(new Runnable() {
|
myHandler.post(new Runnable() {
|
||||||
|
@ -893,7 +758,7 @@ public class MainActivity extends AppCompatActivity
|
||||||
public void run() {
|
public void run() {
|
||||||
conversationCount = Integer.valueOf(webMessage);
|
conversationCount = Integer.valueOf(webMessage);
|
||||||
|
|
||||||
MenuItem item = menu.findItem(R.id.conversations);
|
MenuItem item = menu.findItem(R.id.action_conversations);
|
||||||
|
|
||||||
if (item != null) {
|
if (item != null) {
|
||||||
if (conversationCount > 0) {
|
if (conversationCount > 0) {
|
||||||
|
@ -927,87 +792,109 @@ public class MainActivity extends AppCompatActivity
|
||||||
@Override
|
@Override
|
||||||
public boolean onNavigationItemSelected(MenuItem item) {
|
public boolean onNavigationItemSelected(MenuItem item) {
|
||||||
// Handle navigation view item clicks here.
|
// Handle navigation view item clicks here.
|
||||||
int id = item.getItemId();
|
switch (item.getItemId()) {
|
||||||
|
case R.id.nav_stream: {
|
||||||
if (id == R.id.jb_stream) {
|
|
||||||
if (Helpers.isOnline(MainActivity.this)) {
|
if (Helpers.isOnline(MainActivity.this)) {
|
||||||
webView.loadUrl("https://" + podDomain + "/stream");
|
webView.loadUrl("https://" + podDomain + "/stream");
|
||||||
setTitle(R.string.jb_stream);
|
setTitle(R.string.jb_stream);
|
||||||
} else {
|
} else {
|
||||||
Snackbar.make(swipeView, R.string.no_internet, Snackbar.LENGTH_INDEFINITE).show();
|
Snackbar.make(swipeView, R.string.no_internet, Snackbar.LENGTH_INDEFINITE).show();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
} else if (id == R.id.jb_followed_tags) {
|
case R.id.nav_profile: {
|
||||||
|
if (Helpers.isOnline(MainActivity.this)) {
|
||||||
|
webView.loadUrl("https://" + podDomain + "/people/" + profileId);
|
||||||
|
setTitle(R.string.jb_profile);
|
||||||
|
} else {
|
||||||
|
Snackbar.make(swipeView, R.string.no_internet, Snackbar.LENGTH_INDEFINITE).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
// TODO followed_tags currently not implemented as single viewable page (0.5.7.1-paf04894e, 2016 March 20)
|
||||||
|
case R.id.nav_followed_tags: {
|
||||||
if (Helpers.isOnline(MainActivity.this)) {
|
if (Helpers.isOnline(MainActivity.this)) {
|
||||||
webView.loadUrl("https://" + podDomain + "/followed_tags");
|
webView.loadUrl("https://" + podDomain + "/followed_tags");
|
||||||
setTitle(R.string.jb_followed_tags);
|
setTitle(R.string.jb_followed_tags);
|
||||||
} else {
|
} else {
|
||||||
Snackbar.make(swipeView, R.string.no_internet, Snackbar.LENGTH_INDEFINITE).show();
|
Snackbar.make(swipeView, R.string.no_internet, Snackbar.LENGTH_INDEFINITE).show();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
} else if (id == R.id.jb_aspects) {
|
case R.id.nav_aspects: {
|
||||||
if (Helpers.isOnline(MainActivity.this)) {
|
if (Helpers.isOnline(MainActivity.this)) {
|
||||||
webView.loadUrl("https://" + podDomain + "/aspects");
|
webView.loadUrl("https://" + podDomain + "/aspects");
|
||||||
setTitle(R.string.jb_aspects);
|
setTitle(R.string.jb_aspects);
|
||||||
} else {
|
} else {
|
||||||
Snackbar.make(swipeView, R.string.no_internet, Snackbar.LENGTH_INDEFINITE).show();
|
Snackbar.make(swipeView, R.string.no_internet, Snackbar.LENGTH_INDEFINITE).show();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
} else if (id == R.id.jb_activities) {
|
case R.id.nav_activities: {
|
||||||
if (Helpers.isOnline(MainActivity.this)) {
|
if (Helpers.isOnline(MainActivity.this)) {
|
||||||
webView.loadUrl("https://" + podDomain + "/activity");
|
webView.loadUrl("https://" + podDomain + "/activity");
|
||||||
setTitle(R.string.jb_activities);
|
setTitle(R.string.jb_activities);
|
||||||
} else {
|
} else {
|
||||||
Snackbar.make(swipeView, R.string.no_internet, Snackbar.LENGTH_INDEFINITE).show();
|
Snackbar.make(swipeView, R.string.no_internet, Snackbar.LENGTH_INDEFINITE).show();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
} else if (id == R.id.jb_liked) {
|
case R.id.nav_liked: {
|
||||||
if (Helpers.isOnline(MainActivity.this)) {
|
if (Helpers.isOnline(MainActivity.this)) {
|
||||||
webView.loadUrl("https://" + podDomain + "/liked");
|
webView.loadUrl("https://" + podDomain + "/liked");
|
||||||
setTitle(R.string.jb_liked);
|
setTitle(R.string.jb_liked);
|
||||||
} else {
|
} else {
|
||||||
Snackbar.make(swipeView, R.string.no_internet, Snackbar.LENGTH_INDEFINITE).show();
|
Snackbar.make(swipeView, R.string.no_internet, Snackbar.LENGTH_INDEFINITE).show();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
} else if (id == R.id.jb_commented) {
|
case R.id.nav_commented: {
|
||||||
if (Helpers.isOnline(MainActivity.this)) {
|
if (Helpers.isOnline(MainActivity.this)) {
|
||||||
webView.loadUrl("https://" + podDomain + "/commented");
|
webView.loadUrl("https://" + podDomain + "/commented");
|
||||||
setTitle(R.string.jb_commented);
|
setTitle(R.string.jb_commented);
|
||||||
} else {
|
} else {
|
||||||
Snackbar.make(swipeView, R.string.no_internet, Snackbar.LENGTH_INDEFINITE).show();
|
Snackbar.make(swipeView, R.string.no_internet, Snackbar.LENGTH_INDEFINITE).show();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
} else if (id == R.id.jb_mentions) {
|
case R.id.nav_mentions: {
|
||||||
if (Helpers.isOnline(MainActivity.this)) {
|
if (Helpers.isOnline(MainActivity.this)) {
|
||||||
webView.loadUrl("https://" + podDomain + "/mentions");
|
webView.loadUrl("https://" + podDomain + "/mentions");
|
||||||
setTitle(R.string.jb_mentions);
|
setTitle(R.string.jb_mentions);
|
||||||
} else {
|
} else {
|
||||||
Snackbar.make(swipeView, R.string.no_internet, Snackbar.LENGTH_INDEFINITE).show();
|
Snackbar.make(swipeView, R.string.no_internet, Snackbar.LENGTH_INDEFINITE).show();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
} else if (id == R.id.jb_public) {
|
case R.id.nav_public: {
|
||||||
if (Helpers.isOnline(MainActivity.this)) {
|
if (Helpers.isOnline(MainActivity.this)) {
|
||||||
webView.loadUrl("https://" + podDomain + "/public");
|
webView.loadUrl("https://" + podDomain + "/public");
|
||||||
setTitle(R.string.jb_public);
|
setTitle(R.string.jb_public);
|
||||||
} else {
|
} else {
|
||||||
Snackbar.make(swipeView, R.string.no_internet, Snackbar.LENGTH_INDEFINITE).show();
|
Snackbar.make(swipeView, R.string.no_internet, Snackbar.LENGTH_INDEFINITE).show();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
} else if (id == R.id.jb_settings_view) {
|
case R.id.nav_settings_view: {
|
||||||
final CharSequence[] options = {getString(R.string.settings_font), getString(R.string.settings_view), getString(R.string.settings_image)};
|
final CharSequence[] options = {getString(R.string.settings_font), getString(R.string.settings_view), getString(R.string.settings_image)};
|
||||||
if (Helpers.isOnline(MainActivity.this)) {
|
if (Helpers.isOnline(MainActivity.this)) {
|
||||||
new AlertDialog.Builder(MainActivity.this)
|
new AlertDialog.Builder(MainActivity.this)
|
||||||
.setItems(options, new DialogInterface.OnClickListener() {
|
.setItems(options, new DialogInterface.OnClickListener() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int item) {
|
public void onClick(DialogInterface dialog, int item) {
|
||||||
|
|
||||||
if (options[item].equals(getString(R.string.settings_font)))
|
if (options[item].equals(getString(R.string.settings_font)))
|
||||||
alertFormElements();
|
alertFormElements();
|
||||||
|
|
||||||
if (options[item].equals(getString(R.string.settings_view)))
|
if (options[item].equals(getString(R.string.settings_view)))
|
||||||
webView.loadUrl("https://" + podDomain + "/mobile/toggle");
|
webView.loadUrl("https://" + podDomain + "/mobile/toggle");
|
||||||
|
|
||||||
if (options[item].equals(getString(R.string.settings_image)))
|
if (options[item].equals(getString(R.string.settings_image)))
|
||||||
wSettings.setLoadsImagesAutomatically(!pm.getLoadImages());
|
wSettings.setLoadsImagesAutomatically(!pm.getLoadImages());
|
||||||
pm.setLoadImages(!pm.getLoadImages());
|
pm.setLoadImages(!pm.getLoadImages());
|
||||||
|
@ -1017,27 +904,23 @@ public class MainActivity extends AppCompatActivity
|
||||||
} else {
|
} else {
|
||||||
Snackbar.make(swipeView, R.string.no_internet, Snackbar.LENGTH_INDEFINITE).show();
|
Snackbar.make(swipeView, R.string.no_internet, Snackbar.LENGTH_INDEFINITE).show();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
} else if (id == R.id.jb_settings_diaspora) {
|
case R.id.nav_settings_diaspora: {
|
||||||
|
|
||||||
final CharSequence[] options2 = {getString(R.string.jb_settings), getString(R.string.jb_manage_tags),
|
final CharSequence[] options2 = {getString(R.string.jb_settings), getString(R.string.jb_manage_tags),
|
||||||
getString(R.string.jb_contacts), getString(R.string.jb_pod)};
|
getString(R.string.jb_contacts), getString(R.string.jb_pod)};
|
||||||
if (Helpers.isOnline(MainActivity.this)) {
|
if (Helpers.isOnline(MainActivity.this)) {
|
||||||
new AlertDialog.Builder(MainActivity.this)
|
new AlertDialog.Builder(MainActivity.this)
|
||||||
.setItems(options2, new DialogInterface.OnClickListener() {
|
.setItems(options2, new DialogInterface.OnClickListener() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int item) {
|
public void onClick(DialogInterface dialog, int item) {
|
||||||
|
|
||||||
if (options2[item].equals(getString(R.string.jb_settings)))
|
if (options2[item].equals(getString(R.string.jb_settings)))
|
||||||
webView.loadUrl("https://" + podDomain + "/user/edit");
|
webView.loadUrl("https://" + podDomain + "/user/edit");
|
||||||
|
|
||||||
if (options2[item].equals(getString(R.string.jb_manage_tags)))
|
if (options2[item].equals(getString(R.string.jb_manage_tags)))
|
||||||
webView.loadUrl("https://" + podDomain + "/tag_followings/manage");
|
webView.loadUrl("https://" + podDomain + "/tag_followings/manage");
|
||||||
|
|
||||||
if (options2[item].equals(getString(R.string.jb_contacts)))
|
if (options2[item].equals(getString(R.string.jb_contacts)))
|
||||||
webView.loadUrl("https://" + podDomain + "/contacts");
|
webView.loadUrl("https://" + podDomain + "/contacts");
|
||||||
|
|
||||||
if (options2[item].equals(getString(R.string.jb_pod)))
|
if (options2[item].equals(getString(R.string.jb_pod)))
|
||||||
new AlertDialog.Builder(MainActivity.this)
|
new AlertDialog.Builder(MainActivity.this)
|
||||||
.setTitle(getString(R.string.confirmation))
|
.setTitle(getString(R.string.confirmation))
|
||||||
|
@ -1064,22 +947,18 @@ public class MainActivity extends AppCompatActivity
|
||||||
} else {
|
} else {
|
||||||
Snackbar.make(swipeView, R.string.no_internet, Snackbar.LENGTH_INDEFINITE).show();
|
Snackbar.make(swipeView, R.string.no_internet, Snackbar.LENGTH_INDEFINITE).show();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
} else if (id == R.id.jb_license_help) {
|
case R.id.nav_license_help: {
|
||||||
final CharSequence[] options = {getString(R.string.help_license), getString(R.string.help_about), getString(R.string.help_help), getString(R.string.help_donate)};
|
final CharSequence[] options = {getString(R.string.help_license), getString(R.string.help_about), getString(R.string.help_help), getString(R.string.help_donate)};
|
||||||
new AlertDialog.Builder(MainActivity.this)
|
new AlertDialog.Builder(MainActivity.this)
|
||||||
.setItems(options, new DialogInterface.OnClickListener() {
|
.setItems(options, new DialogInterface.OnClickListener() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
||||||
public void onClick(DialogInterface dialog, int item) {
|
public void onClick(DialogInterface dialog, int item) {
|
||||||
|
if (options[item].equals(getString(R.string.help_license))) {
|
||||||
if (options[item].equals(getString(R.string.help_license)))
|
|
||||||
|
|
||||||
{
|
|
||||||
final SpannableString s = new SpannableString(Html.fromHtml(getString(R.string.license_text)));
|
final SpannableString s = new SpannableString(Html.fromHtml(getString(R.string.license_text)));
|
||||||
Linkify.addLinks(s, Linkify.WEB_URLS);
|
Linkify.addLinks(s, Linkify.WEB_URLS);
|
||||||
|
|
||||||
final AlertDialog d = new AlertDialog.Builder(MainActivity.this)
|
final AlertDialog d = new AlertDialog.Builder(MainActivity.this)
|
||||||
.setTitle(R.string.license_title)
|
.setTitle(R.string.license_title)
|
||||||
.setMessage(s)
|
.setMessage(s)
|
||||||
|
@ -1092,13 +971,9 @@ public class MainActivity extends AppCompatActivity
|
||||||
d.show();
|
d.show();
|
||||||
((TextView) d.findViewById(android.R.id.message)).setMovementMethod(LinkMovementMethod.getInstance());
|
((TextView) d.findViewById(android.R.id.message)).setMovementMethod(LinkMovementMethod.getInstance());
|
||||||
}
|
}
|
||||||
|
if (options[item].equals(getString(R.string.help_about))) {
|
||||||
if (options[item].equals(getString(R.string.help_about)))
|
|
||||||
|
|
||||||
{
|
|
||||||
final SpannableString s = new SpannableString(Html.fromHtml(getString(R.string.about_text)));
|
final SpannableString s = new SpannableString(Html.fromHtml(getString(R.string.about_text)));
|
||||||
Linkify.addLinks(s, Linkify.WEB_URLS);
|
Linkify.addLinks(s, Linkify.WEB_URLS);
|
||||||
|
|
||||||
final AlertDialog d = new AlertDialog.Builder(MainActivity.this)
|
final AlertDialog d = new AlertDialog.Builder(MainActivity.this)
|
||||||
.setTitle(R.string.help_about)
|
.setTitle(R.string.help_about)
|
||||||
.setMessage(s)
|
.setMessage(s)
|
||||||
|
@ -1111,10 +986,7 @@ public class MainActivity extends AppCompatActivity
|
||||||
d.show();
|
d.show();
|
||||||
((TextView) d.findViewById(android.R.id.message)).setMovementMethod(LinkMovementMethod.getInstance());
|
((TextView) d.findViewById(android.R.id.message)).setMovementMethod(LinkMovementMethod.getInstance());
|
||||||
}
|
}
|
||||||
|
if (options[item].equals(getString(R.string.help_help))) {
|
||||||
if (options[item].equals(getString(R.string.help_help)))
|
|
||||||
|
|
||||||
{
|
|
||||||
new AlertDialog.Builder(MainActivity.this)
|
new AlertDialog.Builder(MainActivity.this)
|
||||||
.setTitle(R.string.help_help)
|
.setTitle(R.string.help_help)
|
||||||
.setMessage(Html.fromHtml(getString(R.string.markdown_text)))
|
.setMessage(Html.fromHtml(getString(R.string.markdown_text)))
|
||||||
|
@ -1125,10 +997,7 @@ public class MainActivity extends AppCompatActivity
|
||||||
}
|
}
|
||||||
}).show();
|
}).show();
|
||||||
}
|
}
|
||||||
|
if (options[item].equals(getString(R.string.help_donate))) {
|
||||||
if (options[item].equals(getString(R.string.help_donate)))
|
|
||||||
|
|
||||||
{
|
|
||||||
new AlertDialog.Builder(MainActivity.this)
|
new AlertDialog.Builder(MainActivity.this)
|
||||||
.setMessage(getString(R.string.donate_text))
|
.setMessage(getString(R.string.donate_text))
|
||||||
.setPositiveButton(getString(R.string.yes),
|
.setPositiveButton(getString(R.string.yes),
|
||||||
|
@ -1146,11 +1015,11 @@ public class MainActivity extends AppCompatActivity
|
||||||
}
|
}
|
||||||
}).show();
|
}).show();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}).show();
|
}).show();
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
|
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
|
||||||
drawer.closeDrawer(GravityCompat.START);
|
drawer.closeDrawer(GravityCompat.START);
|
||||||
|
|
|
@ -241,7 +241,7 @@ public class PodsActivity extends ActionBarActivity {
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
int id = item.getItemId();
|
int id = item.getItemId();
|
||||||
|
|
||||||
if (id == R.id.reload) {
|
if (id == R.id.action_reload) {
|
||||||
if (Helpers.isOnline(PodsActivity.this)) {
|
if (Helpers.isOnline(PodsActivity.this)) {
|
||||||
progressDialog.show();
|
progressDialog.show();
|
||||||
Intent i= new Intent(PodsActivity.this, GetPodsService.class);
|
Intent i= new Intent(PodsActivity.this, GetPodsService.class);
|
||||||
|
|
|
@ -43,7 +43,6 @@ import android.webkit.WebSettings;
|
||||||
import android.webkit.WebView;
|
import android.webkit.WebView;
|
||||||
import android.webkit.WebViewClient;
|
import android.webkit.WebViewClient;
|
||||||
import android.widget.ProgressBar;
|
import android.widget.ProgressBar;
|
||||||
import android.widget.TextView;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -333,7 +332,7 @@ public class ShareActivity extends MainActivity {
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
int id = item.getItemId();
|
int id = item.getItemId();
|
||||||
|
|
||||||
if (id == R.id.reload) {
|
if (id == R.id.action_reload) {
|
||||||
if (Helpers.isOnline(ShareActivity.this)) {
|
if (Helpers.isOnline(ShareActivity.this)) {
|
||||||
webView.reload();
|
webView.reload();
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -333,7 +333,7 @@ public class ShareActivity2 extends MainActivity {
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
int id = item.getItemId();
|
int id = item.getItemId();
|
||||||
|
|
||||||
if (id == R.id.reload) {
|
if (id == R.id.action_reload) {
|
||||||
if (Helpers.isOnline(ShareActivity2.this)) {
|
if (Helpers.isOnline(ShareActivity2.this)) {
|
||||||
webView.reload();
|
webView.reload();
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -33,7 +33,7 @@ public class Helpers {
|
||||||
return ni != null && ni.isConnectedOrConnecting();
|
return ni != null && ni.isConnectedOrConnecting();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void hideTopBar(WebView wv) {
|
public static void hideTopBar(final WebView wv) {
|
||||||
wv.loadUrl("javascript: ( function() {" +
|
wv.loadUrl("javascript: ( function() {" +
|
||||||
" if(document.getElementById('main_nav')) {" +
|
" if(document.getElementById('main_nav')) {" +
|
||||||
" document.getElementById('main_nav').parentNode.removeChild(" +
|
" document.getElementById('main_nav').parentNode.removeChild(" +
|
||||||
|
@ -45,19 +45,28 @@ public class Helpers {
|
||||||
"})();");
|
"})();");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void getNotificationCount(WebView wv) {
|
public static void getNotificationCount(final WebView wv) {
|
||||||
wv.loadUrl("javascript: ( function() {" +
|
wv.loadUrl("javascript: ( function() {" +
|
||||||
"if (document.getElementById('notification')) {" +
|
"if (document.getElementById('notification')) {" +
|
||||||
" var count = document.getElementById('notification').innerHTML;" +
|
" var count = document.getElementById('notification').innerHTML;" +
|
||||||
" NotificationCounter.setNotificationCount(count.replace(/(\\r\\n|\\n|\\r)/gm, \"\"));" +
|
" AndroidBridge.setNotificationCount(count.replace(/(\\r\\n|\\n|\\r)/gm, \"\"));" +
|
||||||
" } else {" +
|
" } else {" +
|
||||||
" NotificationCounter.setNotificationCount('0');" +
|
" AndroidBridge.setNotificationCount('0');" +
|
||||||
" }" +
|
" }" +
|
||||||
" if (document.getElementById('conversation')) {" +
|
" if (document.getElementById('conversation')) {" +
|
||||||
" var count = document.getElementById('conversation').innerHTML;" +
|
" var count = document.getElementById('conversation').innerHTML;" +
|
||||||
" NotificationCounter.setConversationCount(count.replace(/(\\r\\n|\\n|\\r)/gm, \"\"));" +
|
" AndroidBridge.setConversationCount(count.replace(/(\\r\\n|\\n|\\r)/gm, \"\"));" +
|
||||||
" } else {" +
|
" } else {" +
|
||||||
" NotificationCounter.setConversationCount('0');" +
|
" AndroidBridge.setConversationCount('0');" +
|
||||||
|
" }" +
|
||||||
|
"})();");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void getProfileId(final WebView wv) {
|
||||||
|
wv.loadUrl("javascript: ( function() {" +
|
||||||
|
" if (typeof gon !== 'undefined' && typeof gon.user !== 'undefined' && typeof gon.user.guid !== 'undefined') {" +
|
||||||
|
" var guid = gon.user.guid;" +
|
||||||
|
" AndroidBridge.setProfileId(guid.toString());" +
|
||||||
" } " +
|
" } " +
|
||||||
"})();");
|
"})();");
|
||||||
}
|
}
|
||||||
|
|
BIN
app/src/main/res/drawable-hdpi/ic_person_black_24dp.png
Normal file
After Width: | Height: | Size: 269 B |
BIN
app/src/main/res/drawable-hdpi/ic_share_white_24dp.png
Normal file
After Width: | Height: | Size: 397 B |
BIN
app/src/main/res/drawable-mdpi/ic_person_black_24dp.png
Normal file
After Width: | Height: | Size: 189 B |
BIN
app/src/main/res/drawable-mdpi/ic_share_white_24dp.png
Normal file
After Width: | Height: | Size: 268 B |
BIN
app/src/main/res/drawable-xhdpi/ic_person_black_24dp.png
Normal file
After Width: | Height: | Size: 307 B |
BIN
app/src/main/res/drawable-xhdpi/ic_share_white_24dp.png
Normal file
After Width: | Height: | Size: 496 B |
BIN
app/src/main/res/drawable-xxhdpi/ic_person_black_24dp.png
Normal file
After Width: | Height: | Size: 428 B |
BIN
app/src/main/res/drawable-xxhdpi/ic_share_white_24dp.png
Normal file
After Width: | Height: | Size: 698 B |
BIN
app/src/main/res/drawable-xxxhdpi/ic_person_black_24dp.png
Normal file
After Width: | Height: | Size: 565 B |
BIN
app/src/main/res/drawable-xxxhdpi/ic_share_white_24dp.png
Normal file
After Width: | Height: | Size: 938 B |
|
@ -3,42 +3,49 @@
|
||||||
|
|
||||||
<group android:checkableBehavior="single">
|
<group android:checkableBehavior="single">
|
||||||
<item
|
<item
|
||||||
android:id="@+id/jb_stream"
|
android:id="@+id/nav_stream"
|
||||||
android:icon="@drawable/jb_stream"
|
android:icon="@drawable/jb_stream"
|
||||||
android:title="@string/jb_stream" />
|
android:title="@string/jb_stream" />
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/jb_followed_tags"
|
android:id="@+id/nav_profile"
|
||||||
|
android:icon="@drawable/ic_person_black_24dp"
|
||||||
|
android:title="@string/jb_profile" />
|
||||||
|
|
||||||
|
<!-- TODO followed_tags currently not implemented as single viewable page
|
||||||
|
(0.5.7.1-paf04894e, 2016 March 20) -->
|
||||||
|
<item
|
||||||
|
android:visible="false"
|
||||||
|
android:id="@+id/nav_followed_tags"
|
||||||
android:icon="@drawable/jb_tag2"
|
android:icon="@drawable/jb_tag2"
|
||||||
android:title="@string/jb_followed_tags" />
|
android:title="@string/jb_followed_tags" />
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/jb_aspects"
|
android:id="@+id/nav_aspects"
|
||||||
android:icon="@drawable/jb_aspects"
|
android:icon="@drawable/jb_aspects"
|
||||||
android:title="@string/jb_aspects" />
|
android:title="@string/jb_aspects" />
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/jb_activities"
|
android:id="@+id/nav_activities"
|
||||||
android:icon="@drawable/jb_activities"
|
android:icon="@drawable/jb_activities"
|
||||||
android:title="@string/jb_activities" />
|
android:title="@string/jb_activities" />
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/jb_liked"
|
android:id="@+id/nav_liked"
|
||||||
android:icon="@drawable/jb_heart"
|
android:icon="@drawable/jb_heart"
|
||||||
android:title="@string/jb_liked" />
|
android:title="@string/jb_liked" />
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/jb_commented"
|
android:id="@+id/nav_commented"
|
||||||
android:icon="@drawable/jb_commented"
|
android:icon="@drawable/jb_commented"
|
||||||
android:title="@string/jb_commented" />
|
android:title="@string/jb_commented" />
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/jb_mentions"
|
android:id="@+id/nav_mentions"
|
||||||
android:icon="@drawable/jb_mentions"
|
android:icon="@drawable/jb_mentions"
|
||||||
android:title="@string/jb_mentions" />
|
android:title="@string/jb_mentions" />
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/jb_public"
|
android:id="@+id/nav_public"
|
||||||
android:icon="@drawable/jb_aspects"
|
android:icon="@drawable/jb_aspects"
|
||||||
android:title="@string/jb_public" />
|
android:title="@string/jb_public" />
|
||||||
</group>
|
</group>
|
||||||
|
@ -46,17 +53,17 @@
|
||||||
<item android:title="@string/jb_menu_1">
|
<item android:title="@string/jb_menu_1">
|
||||||
<menu>
|
<menu>
|
||||||
<item
|
<item
|
||||||
android:id="@+id/jb_settings_view"
|
android:id="@+id/nav_settings_view"
|
||||||
android:icon="@drawable/jb_settings"
|
android:icon="@drawable/jb_settings"
|
||||||
android:title="@string/jb_settings_view" />
|
android:title="@string/jb_settings_view" />
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/jb_settings_diaspora"
|
android:id="@+id/nav_settings_diaspora"
|
||||||
android:icon="@drawable/jb_stream"
|
android:icon="@drawable/jb_stream"
|
||||||
android:title="@string/jb_settings_diaspora" />
|
android:title="@string/jb_settings_diaspora" />
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/jb_license_help"
|
android:id="@+id/nav_license_help"
|
||||||
android:icon="@drawable/jb_license"
|
android:icon="@drawable/jb_license"
|
||||||
android:title="@string/jb_help_license" />
|
android:title="@string/jb_help_license" />
|
||||||
</menu>
|
</menu>
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
xmlns:tools="http://schemas.android.com/tools" tools:context=".MainActivity">
|
xmlns:tools="http://schemas.android.com/tools" tools:context=".MainActivity">
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/reload"
|
android:id="@+id/action_reload"
|
||||||
android:icon="@drawable/ic_sync_white_24dp"
|
android:icon="@drawable/ic_sync_white_24dp"
|
||||||
android:title="@string/reload"
|
android:title="@string/reload"
|
||||||
android:orderInCategory="109"
|
android:orderInCategory="109"
|
||||||
|
|
|
@ -3,34 +3,25 @@
|
||||||
xmlns:tools="http://schemas.android.com/tools" tools:context=".MainActivity">
|
xmlns:tools="http://schemas.android.com/tools" tools:context=".MainActivity">
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/notifications"
|
android:id="@+id/action_notifications"
|
||||||
android:icon="@drawable/ic_bell_outline_white_24dp"
|
android:icon="@drawable/ic_bell_outline_white_24dp"
|
||||||
android:title="@string/notifications"
|
android:title="@string/notifications"
|
||||||
app:showAsAction="always" />
|
app:showAsAction="always" />
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/conversations"
|
android:id="@+id/action_conversations"
|
||||||
android:icon="@drawable/ic_message_text_outline_white_24dp"
|
android:icon="@drawable/ic_message_text_outline_white_24dp"
|
||||||
android:title="@string/messages"
|
android:title="@string/messages"
|
||||||
app:showAsAction="always" />
|
app:showAsAction="always" />
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/help_license"
|
android:id="@+id/action_share"
|
||||||
android:title="@string/jb_help_license"
|
android:icon="@drawable/ic_share_white_24dp"
|
||||||
app:showAsAction="never" />
|
|
||||||
|
|
||||||
<item
|
|
||||||
android:id="@+id/view"
|
|
||||||
android:title="@string/jb_settings_view"
|
|
||||||
app:showAsAction="never" />
|
|
||||||
|
|
||||||
<item
|
|
||||||
android:id="@+id/share"
|
|
||||||
android:title="@string/jb_share"
|
android:title="@string/jb_share"
|
||||||
app:showAsAction="never" />
|
app:showAsAction="ifRoom" />
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/exit"
|
android:id="@+id/action_exit"
|
||||||
android:icon="@drawable/ic_sync_white_24dp"
|
android:icon="@drawable/ic_sync_white_24dp"
|
||||||
android:title="@string/exit_app"
|
android:title="@string/exit_app"
|
||||||
app:showAsAction="never" />
|
app:showAsAction="never" />
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
tools:context="ar.com.tristeslostrestigres.diasporanativewebapp.PodsActivity">
|
tools:context="ar.com.tristeslostrestigres.diasporanativewebapp.PodsActivity">
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/reload"
|
android:id="@+id/action_reload"
|
||||||
android:title="@string/reload"
|
android:title="@string/reload"
|
||||||
android:icon="@drawable/ic_sync_white_24dp"
|
android:icon="@drawable/ic_sync_white_24dp"
|
||||||
android:orderInCategory="100"
|
android:orderInCategory="100"
|
||||||
|
|
|
@ -29,15 +29,15 @@
|
||||||
<string name="jb_stream">Stream</string>
|
<string name="jb_stream">Stream</string>
|
||||||
<string name="jb_notifications">Benachrichtigungen</string>
|
<string name="jb_notifications">Benachrichtigungen</string>
|
||||||
<string name="jb_conversations">Unterhaltungen</string>
|
<string name="jb_conversations">Unterhaltungen</string>
|
||||||
<string name="jb_liked">Gelikete Beiträge</string>
|
<string name="jb_liked">Gelikte Beiträge</string>
|
||||||
<string name="jb_commented">Kommentierte Beiträge</string>
|
<string name="jb_commented">Kommentierte Beiträge</string>
|
||||||
<string name="jb_contacts">Kontakte</string>
|
<string name="jb_contacts">Kontakte</string>
|
||||||
<string name="jb_mentions">Erwähnungen</string>
|
<string name="jb_mentions">Erwähnungen</string>
|
||||||
<string name="jb_activities">Meine Aktivitäten</string>
|
<string name="jb_activities">Aktivitäten</string>
|
||||||
<string name="jb_followed_tags">Verfolgte Tags</string>
|
<string name="jb_followed_tags">Verfolgte Tags</string>
|
||||||
<string name="jb_manage_tags">Tags verwalten</string>
|
<string name="jb_manage_tags">Tags verwalten</string>
|
||||||
<string name="jb_settings">Persönliche Einstellungen</string>
|
<string name="jb_settings">Persönliche Einstellungen</string>
|
||||||
<string name="jb_aspects">Meine Aspekte</string>
|
<string name="jb_aspects">Aspekte</string>
|
||||||
<string name="jb_pod">Pod wechseln</string>
|
<string name="jb_pod">Pod wechseln</string>
|
||||||
<string name="jb_public">Öffentliche Aktivitäten</string>
|
<string name="jb_public">Öffentliche Aktivitäten</string>
|
||||||
|
|
||||||
|
@ -144,8 +144,8 @@ 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:
|
<i>Die Bilder des Startbildschirms können auf Flickr gefunden werden:
|
||||||
https://www.flickr.com/photos/129581906@N06/sets/72157651933980136/with/16594947123.
|
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>
|
Sie wurden von \"Lydia\" veröffentlicht und stehen unter der cc by-nc-sa Lizenz.</i></string>
|
||||||
<string name="fab2_title_person">Suche nach Personen ...</string>
|
<string name="fab2_title_person">Suche nach Personen …</string>
|
||||||
<string name="fab2_title_tag">Suche nach Tags ...</string>
|
<string name="fab2_title_tag">Suche nach Tags …</string>
|
||||||
<string name="donate_1">per Bitcoin</string>
|
<string name="donate_1">per Bitcoin</string>
|
||||||
<string name="donate_text">Wenn dir die App gefällt, kannst du dem Entwickler der original \"DiasporaNativeWebApp\"
|
<string name="donate_text">Wenn dir die App gefällt, kannst du dem Entwickler der original \"DiasporaNativeWebApp\"
|
||||||
eine Kleinigkeit spenden:</string>
|
eine Kleinigkeit spenden:</string>
|
||||||
|
@ -155,5 +155,6 @@ along with this program. If not, see http://www.gnu.org/licenses.<br> <br
|
||||||
<string name="new_notifications">Ungelesene Benachrichtigung. Lesen?</string>
|
<string name="new_notifications">Ungelesene Benachrichtigung. Lesen?</string>
|
||||||
<string name="help_about">Changelog</string>
|
<string name="help_about">Changelog</string>
|
||||||
<string name="new_post2">Titel und Text</string>
|
<string name="new_post2">Titel und Text</string>
|
||||||
|
<string name="jb_profile">Profil</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -1,21 +0,0 @@
|
||||||
<resources>
|
|
||||||
<string name="app_name" translatable="false">Diaspora Native WebApp</string>
|
|
||||||
<string name="reload">Reload</string>
|
|
||||||
<string name="title_activity_pods">Select Pod</string>
|
|
||||||
<string name="filter_hint">Enter pod domain</string>
|
|
||||||
<string name="exit_app">Exit app</string>
|
|
||||||
<string name="confirm_url">Confirm pod url</string>
|
|
||||||
<string name="diaspora" translatable="false">Diaspora</string>
|
|
||||||
<string name="podlist_source_note">Note: This list is populated with only the secure pods from podupti.me</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>
|
|
||||||
<string name="confirmation">Confirmation</string>
|
|
||||||
<string name="confirm_pod">Do you want to use the pod: </string>
|
|
||||||
<string name="confirm_exit">Are you sure you want to exit?</string>
|
|
||||||
<string name="yes">YES</string>
|
|
||||||
<string name="no">NO</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">New post</string>
|
|
||||||
</resources>
|
|
|
@ -10,7 +10,7 @@
|
||||||
<color name="fab_small">#607d8b</color>
|
<color name="fab_small">#607d8b</color>
|
||||||
<color name="fab_small_pressed">#90a4ae</color>
|
<color name="fab_small_pressed">#90a4ae</color>
|
||||||
|
|
||||||
<color name="label_background">#99212121</color>
|
<color name="label_background">#BC212121</color>
|
||||||
<color name="label_text">#ffffff</color>
|
<color name="label_text">#ffffff</color>
|
||||||
|
|
||||||
<color name="white">#ffffff</color>
|
<color name="white">#ffffff</color>
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
<string name="podlist_source_note">Note: This list is populated with only the secure pods from podupti.me</string>
|
<string name="podlist_source_note">Note: This list is populated with only the secure pods from podupti.me</string>
|
||||||
<string name="valid_pod">Please enter a valid domain name</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="podlist_error">Error: Could not retrieve list of pods!</string>
|
||||||
<string name="loading_podlist">Loading pod list ...</string>
|
<string name="loading_podlist">Loading pod list …</string>
|
||||||
|
|
||||||
|
|
||||||
<string name="no_internet">Sorry, you must be connected to the Internet to proceed</string>
|
<string name="no_internet">Sorry, you must be connected to the Internet to proceed</string>
|
||||||
|
@ -48,11 +48,11 @@
|
||||||
<string name="jb_commented">Commented</string>
|
<string name="jb_commented">Commented</string>
|
||||||
<string name="jb_contacts">Contacts</string>
|
<string name="jb_contacts">Contacts</string>
|
||||||
<string name="jb_mentions">Mentions</string>
|
<string name="jb_mentions">Mentions</string>
|
||||||
<string name="jb_activities">My activity</string>
|
<string name="jb_activities">Activities</string>
|
||||||
<string name="jb_followed_tags">Followed Hashtags</string>
|
<string name="jb_followed_tags">Followed Hashtags</string>
|
||||||
<string name="jb_manage_tags">Manage Hashtags</string>
|
<string name="jb_manage_tags">Manage Hashtags</string>
|
||||||
<string name="jb_settings">Personal settings</string>
|
<string name="jb_settings">Personal settings</string>
|
||||||
<string name="jb_aspects">My aspects</string>
|
<string name="jb_aspects">Aspects</string>
|
||||||
<string name="jb_pod">Change pod</string>
|
<string name="jb_pod">Change pod</string>
|
||||||
<string name="jb_public">Public activities</string>
|
<string name="jb_public">Public activities</string>
|
||||||
<string name="jb_settings_view">View settings</string>
|
<string name="jb_settings_view">View settings</string>
|
||||||
|
@ -71,15 +71,15 @@
|
||||||
<string name="help_donate">Donate</string>
|
<string name="help_donate">Donate</string>
|
||||||
<string name="help_about">Changelog</string>
|
<string name="help_about">Changelog</string>
|
||||||
|
|
||||||
<string name="toast_screenshot">Taking screenshot ...</string>
|
<string name="toast_screenshot">Taking screenshot …</string>
|
||||||
|
|
||||||
|
|
||||||
// Floating Action Buttons - Titles
|
// Floating Action Buttons - Titles
|
||||||
|
|
||||||
<string name="fab3_title">Go to top</string>
|
<string name="fab3_title">Go to top</string>
|
||||||
<string name="fab2_title">Search by tags or persons</string>
|
<string name="fab2_title">Search by tags or persons</string>
|
||||||
<string name="fab2_title_tag">Search for tag ...</string>
|
<string name="fab2_title_tag">Search for tag …</string>
|
||||||
<string name="fab2_title_person">Search for person ...</string>
|
<string name="fab2_title_person">Search for person …</string>
|
||||||
<string name="fab1_title">New message</string>
|
<string name="fab1_title">New message</string>
|
||||||
|
|
||||||
|
|
||||||
|
@ -186,6 +186,7 @@
|
||||||
<string name="large">Large</string>
|
<string name="large">Large</string>
|
||||||
<string name="huge">Huge</string>
|
<string name="huge">Huge</string>
|
||||||
<string name="image">Unable to get image</string>
|
<string name="image">Unable to get image</string>
|
||||||
|
<string name="jb_profile">Profile</string>
|
||||||
|
|
||||||
<array name="splash_images">
|
<array name="splash_images">
|
||||||
<item>@drawable/splashscreen1</item>
|
<item>@drawable/splashscreen1</item>
|
||||||
|
@ -195,4 +196,7 @@
|
||||||
<item>@drawable/splashscreen5</item>
|
<item>@drawable/splashscreen5</item>
|
||||||
<item>@drawable/splashscreen6</item>
|
<item>@drawable/splashscreen6</item>
|
||||||
</array>
|
</array>
|
||||||
|
|
||||||
|
<string name="exit_app">Exit app</string>
|
||||||
|
<string name="diaspora" translatable="false">Diaspora</string>
|
||||||
</resources>
|
</resources>
|
|
@ -1,15 +0,0 @@
|
||||||
package de.baumann.diaspora;
|
|
||||||
|
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* To work on unit tests, switch the Test Artifact in the Build Variants view.
|
|
||||||
*/
|
|
||||||
public class ExampleUnitTest {
|
|
||||||
@Test
|
|
||||||
public void addition_isCorrect() throws Exception {
|
|
||||||
assertEquals(4, 2 + 2);
|
|
||||||
}
|
|
||||||
}
|
|