mirror of
https://github.com/gsantner/dandelion
synced 2024-11-22 12:22:08 +01:00
Refactoring; package movement;changed package name due to organisation name
This commit is contained in:
parent
30734f8f2a
commit
4482f09430
30 changed files with 205 additions and 173 deletions
|
@ -1,10 +1,12 @@
|
|||
[![F-Droid](https://f-droid.org/wiki/images/0/06/F-Droid-button_get-it-on.png)](https://f-droid.org/repository/browse/?fdfilter=diaspora&fdid=de.baumann.diaspora)
|
||||
|
||||
## Contributors:
|
||||
Project was moved to <https://github.com/Diaspora-for-Android/diaspora-android>, README and paths need to be updated.
|
||||
|
||||
- [de-live-gdev](https://github.com/de-live-gdev)
|
||||
- [scoute-dich](https://github.com/scoute-dich)
|
||||
## Main developers:
|
||||
|
||||
- de-live-gdev (<https://de-live-gdev.github.io>)
|
||||
- martinchodev (<https://github.com/martinchodev>)
|
||||
- scoute-dich (<https://github.com/scoute-dich>)
|
||||
|
||||
# Diaspora
|
||||
|
||||
|
|
|
@ -6,11 +6,11 @@ android {
|
|||
useLibrary 'org.apache.http.legacy'
|
||||
|
||||
defaultConfig {
|
||||
applicationId "de.dfa.diaspora"
|
||||
applicationId "de.dfa.diaspora_android"
|
||||
minSdkVersion 15
|
||||
targetSdkVersion 23
|
||||
versionCode 17
|
||||
versionName "1.3"
|
||||
versionCode 1
|
||||
versionName "0.9.0"
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="de.dfa.diaspora">
|
||||
package="de.dfa.diaspora_android">
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
|
@ -10,11 +10,11 @@
|
|||
android:allowBackup="true"
|
||||
android:fullBackupContent="true"
|
||||
android:icon="@drawable/ic_launcher"
|
||||
android:name="de.dfa.diaspora.App"
|
||||
android:name="de.dfa.diaspora_android.App"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/AppTheme" >
|
||||
<activity
|
||||
android:name="de.dfa.diaspora.SplashActivity"
|
||||
android:name=".activity.SplashActivity"
|
||||
android:launchMode="singleInstance"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize"
|
||||
android:label="@string/app_name"
|
||||
|
@ -26,7 +26,7 @@
|
|||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name="de.dfa.diaspora.PodsActivity"
|
||||
android:name=".activity.PodsActivity"
|
||||
android:launchMode="singleInstance"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize"
|
||||
android:label="@string/title_activity_pods"
|
||||
|
@ -34,7 +34,7 @@
|
|||
android:windowSoftInputMode="stateHidden" >
|
||||
</activity>
|
||||
<activity
|
||||
android:name="de.dfa.diaspora.MainActivity"
|
||||
android:name=".activity.MainActivity"
|
||||
android:launchMode="singleInstance"
|
||||
android:windowSoftInputMode="adjustResize"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize"
|
||||
|
@ -43,7 +43,7 @@
|
|||
</activity>
|
||||
|
||||
<activity
|
||||
android:name="de.dfa.diaspora.ShareActivity"
|
||||
android:name=".activity.ShareActivity"
|
||||
android:launchMode="singleInstance"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize"
|
||||
android:label="@string/new_post"
|
||||
|
@ -58,7 +58,7 @@
|
|||
</activity>
|
||||
|
||||
<activity
|
||||
android:name="de.dfa.diaspora.ShareActivity2"
|
||||
android:name=".activity.ShareActivity2"
|
||||
android:launchMode="singleInstance"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize"
|
||||
android:label="@string/new_post"
|
||||
|
@ -74,7 +74,7 @@
|
|||
</activity>
|
||||
|
||||
<service
|
||||
android:name="de.dfa.diaspora.services.GetPodsService"
|
||||
android:name=".task.GetPodsService"
|
||||
android:enabled="true"
|
||||
android:exported="false" >
|
||||
</service>
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
package de.dfa.diaspora;
|
||||
package de.dfa.diaspora_android;
|
||||
|
||||
import android.app.Application;
|
||||
|
||||
import de.dfa.diaspora.utils.AvatarImageLoader;
|
||||
import de.dfa.diaspora_android.data.AppSettings;
|
||||
import de.dfa.diaspora_android.util.AvatarImageLoader;
|
||||
|
||||
/**
|
||||
* Created by gregor on 24.03.16.
|
|
@ -17,7 +17,7 @@
|
|||
If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package de.dfa.diaspora;
|
||||
package de.dfa.diaspora_android.activity;
|
||||
|
||||
import android.Manifest;
|
||||
import android.annotation.SuppressLint;
|
||||
|
@ -80,8 +80,13 @@ import java.util.Date;
|
|||
|
||||
import butterknife.Bind;
|
||||
import butterknife.ButterKnife;
|
||||
import de.dfa.diaspora.utils.Helpers;
|
||||
import de.dfa.diaspora.utils.SoftKeyboardStateWatcher;
|
||||
import de.dfa.diaspora_android.App;
|
||||
import de.dfa.diaspora_android.R;
|
||||
import de.dfa.diaspora_android.data.AppSettings;
|
||||
import de.dfa.diaspora_android.data.WebUserProfile;
|
||||
import de.dfa.diaspora_android.listener.SoftKeyboardStateWatcher;
|
||||
import de.dfa.diaspora_android.listener.WebUserProfileChangedListener;
|
||||
import de.dfa.diaspora_android.util.Helpers;
|
||||
|
||||
public class MainActivity extends AppCompatActivity
|
||||
implements NavigationView.OnNavigationItemSelectedListener, WebUserProfileChangedListener {
|
||||
|
@ -138,7 +143,7 @@ public class MainActivity extends AppCompatActivity
|
|||
|
||||
app = (App) getApplication();
|
||||
appSettings = app.getSettings();
|
||||
webUserProfile = new WebUserProfile(app,uiHandler,this);
|
||||
webUserProfile = new WebUserProfile(app, uiHandler, this);
|
||||
|
||||
// Setup toolbar
|
||||
setSupportActionBar(toolbar);
|
||||
|
@ -164,6 +169,7 @@ public class MainActivity extends AppCompatActivity
|
|||
public void onSoftKeyboardOpened(int keyboardHeightInPx) {
|
||||
fab.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSoftKeyboardClosed() {
|
||||
fab.setVisibility(View.VISIBLE);
|
||||
|
@ -315,7 +321,7 @@ public class MainActivity extends AppCompatActivity
|
|||
|
||||
}
|
||||
|
||||
private void setupNavigationSlider(){
|
||||
private void setupNavigationSlider() {
|
||||
DrawerLayout drawer = ButterKnife.findById(this, R.id.drawer_layout);
|
||||
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
|
||||
this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
|
||||
|
@ -326,19 +332,19 @@ public class MainActivity extends AppCompatActivity
|
|||
navigationView.setNavigationItemSelectedListener(this);
|
||||
|
||||
View navHeader = navigationView.getHeaderView(0);
|
||||
navheaderTitle = ButterKnife.findById(navHeader,R.id.navheader_title);
|
||||
navheaderDescription = ButterKnife.findById(navHeader,R.id.navheader_description);
|
||||
navheaderImage = ButterKnife.findById(navHeader,R.id.navheader_user_image);
|
||||
navheaderTitle = ButterKnife.findById(navHeader, R.id.navheader_title);
|
||||
navheaderDescription = ButterKnife.findById(navHeader, R.id.navheader_description);
|
||||
navheaderImage = ButterKnife.findById(navHeader, R.id.navheader_user_image);
|
||||
|
||||
if(!appSettings.getName().equals("")) {
|
||||
if (!appSettings.getName().equals("")) {
|
||||
navheaderTitle.setText(appSettings.getName());
|
||||
}
|
||||
if(!appSettings.getPodDomain().equals("")){
|
||||
if (!appSettings.getPodDomain().equals("")) {
|
||||
navheaderDescription.setText(appSettings.getPodDomain());
|
||||
}
|
||||
if(!appSettings.getAvatarUrl().equals("")){
|
||||
if (!appSettings.getAvatarUrl().equals("")) {
|
||||
// Try to load image
|
||||
if(!app.getAvatarImageLoader().loadToImageView(navheaderImage)){
|
||||
if (!app.getAvatarImageLoader().loadToImageView(navheaderImage)) {
|
||||
// If not yet loaded, start download
|
||||
app.getAvatarImageLoader().startImageDownload(navheaderImage, appSettings.getAvatarUrl());
|
||||
}
|
||||
|
@ -803,7 +809,7 @@ public class MainActivity extends AppCompatActivity
|
|||
|
||||
@JavascriptInterface
|
||||
public void setUserProfile(final String webMessage) throws JSONException {
|
||||
if (webUserProfile.isRefreshNeeded()){
|
||||
if (webUserProfile.isRefreshNeeded()) {
|
||||
webUserProfile.parseJson(webMessage);
|
||||
}
|
||||
}
|
|
@ -17,7 +17,7 @@
|
|||
If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package de.dfa.diaspora;
|
||||
package de.dfa.diaspora_android.activity;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.app.AlertDialog;
|
||||
|
@ -47,8 +47,10 @@ import android.widget.TextView;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
|
||||
import de.dfa.diaspora.services.GetPodsService;
|
||||
import de.dfa.diaspora.utils.Helpers;
|
||||
import de.dfa.diaspora_android.App;
|
||||
import de.dfa.diaspora_android.R;
|
||||
import de.dfa.diaspora_android.task.GetPodsService;
|
||||
import de.dfa.diaspora_android.util.Helpers;
|
||||
|
||||
|
||||
public class PodsActivity extends AppCompatActivity {
|
||||
|
@ -73,7 +75,7 @@ public class PodsActivity extends AppCompatActivity {
|
|||
imgSelectPod.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (filter.getText().length() > 4 && filter.getText().toString().contains("."))
|
||||
if (filter.getText().length() > 4 && filter.getText().toString().contains(""))
|
||||
askConfirmation(filter.getText().toString());
|
||||
else
|
||||
Snackbar.make(lv, R.string.valid_pod, Snackbar.LENGTH_LONG).show();
|
||||
|
@ -90,7 +92,7 @@ public class PodsActivity extends AppCompatActivity {
|
|||
if (progressDialog != null)
|
||||
progressDialog.dismiss();
|
||||
|
||||
if (pods != null && pods.length>0)
|
||||
if (pods != null && pods.length > 0)
|
||||
updateListview(pods);
|
||||
else {
|
||||
Snackbar.make(lv, R.string.podlist_error, Snackbar.LENGTH_LONG).show();
|
||||
|
@ -117,7 +119,7 @@ public class PodsActivity extends AppCompatActivity {
|
|||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
Intent i= new Intent(PodsActivity.this, GetPodsService.class);
|
||||
Intent i = new Intent(PodsActivity.this, GetPodsService.class);
|
||||
startService(i);
|
||||
}
|
||||
|
||||
|
@ -164,7 +166,7 @@ public class PodsActivity extends AppCompatActivity {
|
|||
if (Helpers.isOnline(PodsActivity.this)) {
|
||||
new AlertDialog.Builder(PodsActivity.this)
|
||||
.setTitle(getString(R.string.confirmation))
|
||||
.setMessage(getString(R.string.confirm_pod)+podDomain+"?")
|
||||
.setMessage(getString(R.string.confirm_pod) + podDomain + "?")
|
||||
.setPositiveButton(R.string.yes,
|
||||
new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
|
@ -238,7 +240,7 @@ public class PodsActivity extends AppCompatActivity {
|
|||
if (id == R.id.action_reload) {
|
||||
if (Helpers.isOnline(PodsActivity.this)) {
|
||||
progressDialog.show();
|
||||
Intent i= new Intent(PodsActivity.this, GetPodsService.class);
|
||||
Intent i = new Intent(PodsActivity.this, GetPodsService.class);
|
||||
startService(i);
|
||||
return true;
|
||||
} else {
|
|
@ -17,10 +17,9 @@
|
|||
If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package de.dfa.diaspora;
|
||||
package de.dfa.diaspora_android.activity;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
|
@ -46,7 +45,9 @@ import java.io.IOException;
|
|||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
import de.dfa.diaspora.utils.Helpers;
|
||||
import de.dfa.diaspora_android.App;
|
||||
import de.dfa.diaspora_android.R;
|
||||
import de.dfa.diaspora_android.util.Helpers;
|
||||
|
||||
public class ShareActivity extends MainActivity {
|
||||
|
||||
|
@ -68,7 +69,7 @@ public class ShareActivity extends MainActivity {
|
|||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||
setSupportActionBar(toolbar);
|
||||
|
||||
progressBar = (ProgressBar)findViewById(R.id.progressBar);
|
||||
progressBar = (ProgressBar) findViewById(R.id.progressBar);
|
||||
|
||||
swipeView = (SwipeRefreshLayout) findViewById(R.id.swipe);
|
||||
swipeView.setEnabled(false);
|
||||
|
@ -87,12 +88,12 @@ public class ShareActivity extends MainActivity {
|
|||
});
|
||||
|
||||
|
||||
podDomain = ((App)getApplication()).getSettings().getPodDomain();
|
||||
podDomain = ((App) getApplication()).getSettings().getPodDomain();
|
||||
|
||||
fab = (com.getbase.floatingactionbutton.FloatingActionsMenu) findViewById(R.id.fab_menubutton);
|
||||
fab.setVisibility(View.GONE);
|
||||
|
||||
webView = (WebView)findViewById(R.id.webView);
|
||||
webView = (WebView) findViewById(R.id.webView);
|
||||
webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
|
||||
|
||||
WebSettings wSettings = webView.getSettings();
|
||||
|
@ -197,8 +198,6 @@ public class ShareActivity extends MainActivity {
|
|||
});
|
||||
|
||||
|
||||
|
||||
|
||||
Intent intent = getIntent();
|
||||
final Bundle extras = intent.getExtras();
|
||||
String action = intent.getAction();
|
||||
|
@ -229,7 +228,7 @@ public class ShareActivity extends MainActivity {
|
|||
webView.loadUrl("javascript:(function() { " +
|
||||
"document.getElementsByTagName('textarea')[0].style.height='110px'; " +
|
||||
"document.getElementsByTagName('textarea')[0].innerHTML = '> " +
|
||||
String.format("%s %s'; ",extraText,getString(R.string.shared_by_diaspora_android)) +
|
||||
String.format("%s %s'; ", extraText, getString(R.string.shared_by_diaspora_android)) +
|
||||
" if(document.getElementById(\"main_nav\")) {" +
|
||||
" document.getElementById(\"main_nav\").parentNode.removeChild(" +
|
||||
" document.getElementById(\"main_nav\"));" +
|
||||
|
@ -246,7 +245,7 @@ public class ShareActivity extends MainActivity {
|
|||
|
||||
if (savedInstanceState == null) {
|
||||
if (Helpers.isOnline(ShareActivity.this)) {
|
||||
webView.loadUrl("https://"+podDomain+"/status_messages/new");
|
||||
webView.loadUrl("https://" + podDomain + "/status_messages/new");
|
||||
} else {
|
||||
Snackbar.make(getWindow().findViewById(R.id.drawer_layout), R.string.no_internet, Snackbar.LENGTH_LONG).show();
|
||||
}
|
||||
|
@ -256,15 +255,15 @@ public class ShareActivity extends MainActivity {
|
|||
|
||||
|
||||
@Override
|
||||
public void onActivityResult (int requestCode, int resultCode, Intent data) {
|
||||
if(requestCode != INPUT_FILE_REQUEST_CODE || mFilePathCallback == null) {
|
||||
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
if (requestCode != INPUT_FILE_REQUEST_CODE || mFilePathCallback == null) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
return;
|
||||
}
|
||||
Uri[] results = null;
|
||||
if(resultCode == Activity.RESULT_OK) {
|
||||
if(data == null) {
|
||||
if(mCameraPhotoPath != null) {
|
||||
if (resultCode == RESULT_OK) {
|
||||
if (data == null) {
|
||||
if (mCameraPhotoPath != null) {
|
||||
results = new Uri[]{Uri.parse(mCameraPhotoPath)};
|
||||
}
|
||||
} else {
|
|
@ -17,10 +17,9 @@
|
|||
If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package de.dfa.diaspora;
|
||||
package de.dfa.diaspora_android.activity;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
|
@ -46,7 +45,9 @@ import java.io.IOException;
|
|||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
import de.dfa.diaspora.utils.Helpers;
|
||||
import de.dfa.diaspora_android.App;
|
||||
import de.dfa.diaspora_android.R;
|
||||
import de.dfa.diaspora_android.util.Helpers;
|
||||
|
||||
public class ShareActivity2 extends MainActivity {
|
||||
|
||||
|
@ -68,7 +69,7 @@ public class ShareActivity2 extends MainActivity {
|
|||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||
setSupportActionBar(toolbar);
|
||||
|
||||
progressBar = (ProgressBar)findViewById(R.id.progressBar);
|
||||
progressBar = (ProgressBar) findViewById(R.id.progressBar);
|
||||
|
||||
swipeView = (SwipeRefreshLayout) findViewById(R.id.swipe);
|
||||
swipeView.setEnabled(false);
|
||||
|
@ -87,12 +88,12 @@ public class ShareActivity2 extends MainActivity {
|
|||
});
|
||||
|
||||
|
||||
podDomain = ((App)getApplication()).getSettings().getPodDomain();
|
||||
podDomain = ((App) getApplication()).getSettings().getPodDomain();
|
||||
|
||||
fab = (com.getbase.floatingactionbutton.FloatingActionsMenu) findViewById(R.id.fab_expand_menu_button);
|
||||
fab.setVisibility(View.GONE);
|
||||
|
||||
webView = (WebView)findViewById(R.id.webView);
|
||||
webView = (WebView) findViewById(R.id.webView);
|
||||
webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
|
||||
|
||||
WebSettings wSettings = webView.getSettings();
|
||||
|
@ -197,8 +198,6 @@ public class ShareActivity2 extends MainActivity {
|
|||
});
|
||||
|
||||
|
||||
|
||||
|
||||
Intent intent = getIntent();
|
||||
final Bundle extras = intent.getExtras();
|
||||
String action = intent.getAction();
|
||||
|
@ -246,7 +245,7 @@ public class ShareActivity2 extends MainActivity {
|
|||
|
||||
if (savedInstanceState == null) {
|
||||
if (Helpers.isOnline(ShareActivity2.this)) {
|
||||
webView.loadUrl("https://"+podDomain+"/status_messages/new");
|
||||
webView.loadUrl("https://" + podDomain + "/status_messages/new");
|
||||
} else {
|
||||
Snackbar.make(getWindow().findViewById(R.id.drawer_layout), R.string.no_internet, Snackbar.LENGTH_SHORT).show();
|
||||
}
|
||||
|
@ -256,15 +255,15 @@ public class ShareActivity2 extends MainActivity {
|
|||
|
||||
|
||||
@Override
|
||||
public void onActivityResult (int requestCode, int resultCode, Intent data) {
|
||||
if(requestCode != INPUT_FILE_REQUEST_CODE || mFilePathCallback == null) {
|
||||
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
if (requestCode != INPUT_FILE_REQUEST_CODE || mFilePathCallback == null) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
return;
|
||||
}
|
||||
Uri[] results = null;
|
||||
if(resultCode == Activity.RESULT_OK) {
|
||||
if(data == null) {
|
||||
if(mCameraPhotoPath != null) {
|
||||
if (resultCode == RESULT_OK) {
|
||||
if (data == null) {
|
||||
if (mCameraPhotoPath != null) {
|
||||
results = new Uri[]{Uri.parse(mCameraPhotoPath)};
|
||||
}
|
||||
} else {
|
|
@ -17,7 +17,7 @@
|
|||
If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package de.dfa.diaspora;
|
||||
package de.dfa.diaspora_android.activity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.content.res.TypedArray;
|
||||
|
@ -29,6 +29,9 @@ import android.widget.ImageView;
|
|||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
|
||||
import de.dfa.diaspora_android.App;
|
||||
import de.dfa.diaspora_android.R;
|
||||
|
||||
|
||||
public class SplashActivity extends AppCompatActivity {
|
||||
private App app;
|
||||
|
@ -39,7 +42,7 @@ public class SplashActivity extends AppCompatActivity {
|
|||
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
|
||||
WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
||||
setContentView(R.layout.activity_splash);
|
||||
app = (App)getApplication();
|
||||
app = (App) getApplication();
|
||||
|
||||
ImageView imgSplash = (ImageView) findViewById(R.id.imgSplash);
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package de.dfa.diaspora;
|
||||
package de.dfa.diaspora_android.data;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
|
@ -6,7 +6,7 @@ import android.content.SharedPreferences;
|
|||
/**
|
||||
* Created by de-live-gdev on 20.03.16. Part of Diaspora WebApp.
|
||||
*/
|
||||
class AppSettings {
|
||||
public class AppSettings {
|
||||
private final SharedPreferences pref;
|
||||
private final Context context;
|
||||
|
||||
|
@ -18,9 +18,11 @@ class AppSettings {
|
|||
private void setString(String key, String value) {
|
||||
pref.edit().putString(key, value).apply();
|
||||
}
|
||||
|
||||
private void setInt(String key, int value) {
|
||||
pref.edit().putInt(key, value).apply();
|
||||
}
|
||||
|
||||
private void setBool(String key, boolean value) {
|
||||
pref.edit().putBoolean(key, value).apply();
|
||||
}
|
||||
|
@ -36,7 +38,6 @@ class AppSettings {
|
|||
private static final String PREF_PODDOMAIN = "podDomain";
|
||||
|
||||
|
||||
|
||||
/*
|
||||
// Setters & Getters
|
||||
*/
|
||||
|
@ -74,19 +75,19 @@ class AppSettings {
|
|||
setString(PREF_AVATAR_URL, avatarUrl);
|
||||
}
|
||||
|
||||
public String getName(){
|
||||
public String getName() {
|
||||
return pref.getString(PREF_WEBUSERPROFILE_NAME, "");
|
||||
}
|
||||
|
||||
public void setName(String name){
|
||||
public void setName(String name) {
|
||||
setString(PREF_WEBUSERPROFILE_NAME, name);
|
||||
}
|
||||
|
||||
public String getPodDomain(){
|
||||
public String getPodDomain() {
|
||||
return pref.getString(PREF_PODDOMAIN, "");
|
||||
}
|
||||
|
||||
public void setPodDomain(String podDomain){
|
||||
public void setPodDomain(String podDomain) {
|
||||
setString(PREF_PODDOMAIN, podDomain);
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package de.dfa.diaspora;
|
||||
package de.dfa.diaspora_android.data;
|
||||
|
||||
import android.os.Handler;
|
||||
import android.util.Log;
|
||||
|
@ -6,6 +6,9 @@ import android.util.Log;
|
|||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import de.dfa.diaspora_android.App;
|
||||
import de.dfa.diaspora_android.listener.WebUserProfileChangedListener;
|
||||
|
||||
/**
|
||||
* Created by de-live-gdev on 24.03.16. Part of Diaspora WebApp.
|
||||
*/
|
||||
|
@ -156,10 +159,3 @@ public class WebUserProfile {
|
|||
* ? ?
|
||||
*/
|
||||
}
|
||||
|
||||
interface WebUserProfileChangedListener {
|
||||
void onUserProfileNameChanged(String name);
|
||||
void onUserProfileAvatarChanged(String avatarUrl);
|
||||
void onNotificationCountChanged(int notificationCount);
|
||||
void onUnreadMessageCountChanged(int unreadMessageCount);
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package de.dfa.diaspora.utils;
|
||||
package de.dfa.diaspora_android.listener;
|
||||
|
||||
/**
|
||||
* Created by juergen on 25.03.16. Part of Diaspora WebApp.
|
||||
|
@ -16,6 +16,7 @@ public class SoftKeyboardStateWatcher implements ViewTreeObserver.OnGlobalLayout
|
|||
|
||||
public interface SoftKeyboardStateListener {
|
||||
void onSoftKeyboardOpened(int keyboardHeightInPx);
|
||||
|
||||
void onSoftKeyboardClosed();
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package de.dfa.diaspora_android.listener;
|
||||
|
||||
/**
|
||||
* Created by Gregor Santner (de-live-gdev) on 26.03.16.
|
||||
*/
|
||||
public interface WebUserProfileChangedListener {
|
||||
void onUserProfileNameChanged(String name);
|
||||
|
||||
void onUserProfileAvatarChanged(String avatarUrl);
|
||||
|
||||
void onNotificationCountChanged(int notificationCount);
|
||||
|
||||
void onUnreadMessageCountChanged(int unreadMessageCount);
|
||||
}
|
|
@ -17,7 +17,7 @@
|
|||
If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package de.dfa.diaspora.services;
|
||||
package de.dfa.diaspora_android.task;
|
||||
|
||||
import android.app.Service;
|
||||
import android.content.Intent;
|
||||
|
@ -46,7 +46,8 @@ public class GetPodsService extends Service {
|
|||
|
||||
private static final String TAG = "Diaspora Pod Service";
|
||||
|
||||
public GetPodsService() { }
|
||||
public GetPodsService() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int onStartCommand(Intent intent, int flags, int startId) {
|
|
@ -1,4 +1,4 @@
|
|||
package de.dfa.diaspora;
|
||||
package de.dfa.diaspora_android.task;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
|
@ -11,6 +11,8 @@ import java.io.FileOutputStream;
|
|||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
import de.dfa.diaspora_android.App;
|
||||
|
||||
/**
|
||||
* Created by Gregor Santner (de-live-gdev) on 24.03.16.
|
||||
*/
|
|
@ -1,13 +1,15 @@
|
|||
package de.dfa.diaspora;
|
||||
package de.dfa.diaspora_android.ui;
|
||||
|
||||
/**
|
||||
* Created by juergen on 29.02.16. Part of Diaspora WebApp.
|
||||
*/
|
||||
|
||||
import android.content.Context;
|
||||
import android.support.design.widget.CoordinatorLayout;
|
||||
import android.support.design.widget.Snackbar.SnackbarLayout;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
|
||||
import com.getbase.floatingactionbutton.FloatingActionsMenu;
|
||||
|
||||
public class FloatingActionsMenuBehavior extends CoordinatorLayout.Behavior<FloatingActionsMenu> {
|
|
@ -1,4 +1,4 @@
|
|||
package de.dfa.diaspora.utils;
|
||||
package de.dfa.diaspora_android.util;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
|
@ -7,7 +7,7 @@ import android.widget.ImageView;
|
|||
|
||||
import java.io.File;
|
||||
|
||||
import de.dfa.diaspora.ImageDownloadTask;
|
||||
import de.dfa.diaspora_android.task.ImageDownloadTask;
|
||||
|
||||
/**
|
||||
* Created by Gregor Santner (de-live-gdev) on 24.03.16.
|
||||
|
@ -15,11 +15,11 @@ import de.dfa.diaspora.ImageDownloadTask;
|
|||
public class AvatarImageLoader {
|
||||
private File avatarFile;
|
||||
|
||||
public AvatarImageLoader(Context context){
|
||||
public AvatarImageLoader(Context context) {
|
||||
avatarFile = new File(context.getFilesDir(), "avatar.png");
|
||||
}
|
||||
|
||||
public void clearAvatarImage(){
|
||||
public void clearAvatarImage() {
|
||||
if (isAvatarDownloaded()) {
|
||||
avatarFile.delete();
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ public class AvatarImageLoader {
|
|||
}
|
||||
|
||||
public void startImageDownload(ImageView imageView, String avatarUrl) {
|
||||
if(!avatarUrl.equals("")) {
|
||||
if (!avatarUrl.equals("")) {
|
||||
new ImageDownloadTask(imageView, avatarFile.getAbsolutePath()).execute(avatarUrl);
|
||||
}
|
||||
}
|
|
@ -17,7 +17,7 @@
|
|||
If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package de.dfa.diaspora.utils;
|
||||
package de.dfa.diaspora_android.util;
|
||||
|
||||
|
||||
import android.content.Context;
|
||||
|
@ -27,7 +27,7 @@ import android.webkit.WebView;
|
|||
|
||||
public class Helpers {
|
||||
|
||||
public static boolean isOnline(Context context){
|
||||
public static boolean isOnline(Context context) {
|
||||
ConnectivityManager cnm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||
NetworkInfo ni = cnm.getActiveNetworkInfo();
|
||||
return ni != null && ni.isConnectedOrConnecting();
|
|
@ -20,6 +20,6 @@
|
|||
android:layout_gravity="start"
|
||||
android:fitsSystemWindows="true"
|
||||
app:headerLayout="@layout/nav_header_main"
|
||||
app:menu="@menu/activity_main_drawer" />
|
||||
app:menu="@menu/navdrawer_main" />
|
||||
|
||||
</android.support.v4.widget.DrawerLayout>
|
||||
|
|
|
@ -1,52 +1,54 @@
|
|||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/podsLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingBottom="@dimen/activity_vertical_margin"
|
||||
android:paddingLeft="@dimen/activity_horizontal_margin"
|
||||
android:paddingRight="@dimen/activity_horizontal_margin"
|
||||
android:paddingTop="@dimen/activity_vertical_margin"
|
||||
android:paddingBottom="@dimen/activity_vertical_margin"
|
||||
android:id="@+id/podsLayout"
|
||||
tools:context="ar.com.tristeslostrestigres.diasporanativewebapp.PodsActivity">
|
||||
tools:context=".activity.PodsActivity">
|
||||
|
||||
<ListView
|
||||
android:id="@+id/lstPods"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/lstPods"
|
||||
android:choiceMode="singleChoice"
|
||||
android:layout_above="@+id/navheader_description"
|
||||
android:layout_below="@+id/edtFilter"
|
||||
android:layout_above="@+id/navheader_description" />
|
||||
android:choiceMode="singleChoice" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/edtFilter"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/edtFilter"
|
||||
android:layout_alignParentTop="true"
|
||||
android:hint="@string/filter_hint"
|
||||
android:layout_toLeftOf="@+id/imgSelectPod"
|
||||
android:layout_toStartOf="@+id/imgSelectPod"
|
||||
android:hint="@string/filter_hint"
|
||||
android:inputType="textUri|textWebEditText" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imgSelectPod"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingRight="5dp"
|
||||
android:paddingLeft="5dp"
|
||||
android:id="@+id/imgSelectPod"
|
||||
android:src="@mipmap/ic_arrow_right_grey600_24dp"
|
||||
android:layout_above="@+id/lstPods"
|
||||
android:layout_alignRight="@+id/lstPods"
|
||||
android:layout_alignEnd="@+id/lstPods"
|
||||
android:layout_alignRight="@+id/lstPods"
|
||||
android:layout_alignTop="@+id/edtFilter"
|
||||
android:contentDescription="@string/confirm_url" />
|
||||
android:contentDescription="@string/confirm_url"
|
||||
android:paddingLeft="5dp"
|
||||
android:paddingRight="5dp"
|
||||
android:src="@mipmap/ic_arrow_right_grey600_24dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/navheader_description"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:text="@string/podlist_source_note"
|
||||
android:id="@+id/navheader_description"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true" />
|
||||
android:layout_alignParentStart="true"
|
||||
android:text="@string/podlist_source_note"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
|
|
@ -2,15 +2,15 @@
|
|||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context="ar.com.tristeslostrestigres.diasporanativewebapp.SplashActivity">
|
||||
tools:context=".activity.SplashActivity">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imgSplash"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/imgSplash"
|
||||
android:src="@drawable/splashscreen1"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:contentDescription="@string/splash_screen_description"
|
||||
android:scaleType="centerCrop"
|
||||
android:contentDescription="@string/splash_screen_description" />
|
||||
android:src="@drawable/splashscreen1" />
|
||||
</RelativeLayout>
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:fab="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="true"
|
||||
|
@ -26,18 +26,18 @@
|
|||
|
||||
<com.getbase.floatingactionbutton.FloatingActionsMenu
|
||||
android:id="@+id/fab_menubutton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:visibility="gone"
|
||||
app:layout_behavior="de.dfa.diaspora_android.ui.FloatingActionsMenuBehavior"
|
||||
fab:fab_addButtonColorNormal="@color/fab_big"
|
||||
fab:fab_addButtonColorPressed="@color/fab_big_pressed"
|
||||
fab:fab_addButtonPlusIconColor="@color/white"
|
||||
fab:fab_labelStyle="@style/menu_labels_style"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:layout_marginRight="8dp"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
app:layout_behavior="de.dfa.diaspora.FloatingActionsMenuBehavior">
|
||||
fab:fab_labelStyle="@style/menu_labels_style">
|
||||
|
||||
<com.getbase.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/fab_top"
|
||||
|
@ -45,11 +45,11 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:onClick="fab3_click"
|
||||
fab:fab_colorNormal="@color/fab_small"
|
||||
fab:fab_icon="@drawable/fab_top"
|
||||
fab:fab_title="@string/fab3_title"
|
||||
fab:fab_colorPressed="@color/fab_small_pressed"
|
||||
fab:fab_icon="@drawable/fab_top"
|
||||
fab:fab_labelStyle="@style/menu_labels_style"
|
||||
fab:fab_size="mini" />
|
||||
fab:fab_size="mini"
|
||||
fab:fab_title="@string/fab3_title" />
|
||||
|
||||
<com.getbase.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/fab_search"
|
||||
|
@ -57,11 +57,11 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:onClick="fab2_click"
|
||||
fab:fab_colorNormal="@color/fab_small"
|
||||
fab:fab_icon="@drawable/fab_search"
|
||||
fab:fab_title="@string/fab2_title"
|
||||
fab:fab_colorPressed="@color/fab_small_pressed"
|
||||
fab:fab_icon="@drawable/fab_search"
|
||||
fab:fab_labelStyle="@style/menu_labels_style"
|
||||
fab:fab_size="mini" />
|
||||
fab:fab_size="mini"
|
||||
fab:fab_title="@string/fab2_title" />
|
||||
|
||||
<com.getbase.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/fab_compose"
|
||||
|
@ -69,10 +69,10 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:onClick="fab1_click"
|
||||
fab:fab_colorNormal="@color/fab_small"
|
||||
fab:fab_icon="@drawable/fab_compose"
|
||||
fab:fab_title="@string/fab1_title"
|
||||
fab:fab_colorPressed="@color/fab_small_pressed"
|
||||
fab:fab_size="mini" />
|
||||
fab:fab_icon="@drawable/fab_compose"
|
||||
fab:fab_size="mini"
|
||||
fab:fab_title="@string/fab1_title" />
|
||||
|
||||
</com.getbase.floatingactionbutton.FloatingActionsMenu>
|
||||
|
||||
|
|
|
@ -11,26 +11,26 @@
|
|||
<android.support.v4.widget.SwipeRefreshLayout
|
||||
android:id="@+id/swipe"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" >
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<WebView
|
||||
android:id="@+id/webView"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:id="@+id/webView"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true" />
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_centerVertical="true" />
|
||||
|
||||
</android.support.v4.widget.SwipeRefreshLayout>
|
||||
|
||||
<ProgressBar
|
||||
android:minHeight="4dip"
|
||||
android:maxHeight="4dip"
|
||||
android:id="@+id/progressBar"
|
||||
style="@android:style/Widget.ProgressBar.Horizontal"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
style="@android:style/Widget.ProgressBar.Horizontal"
|
||||
android:id="@+id/progressBar" />
|
||||
android:maxHeight="4dip"
|
||||
android:minHeight="4dip" />
|
||||
|
||||
</RelativeLayout>
|
|
@ -1,16 +1,15 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center_horizontal"
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<RadioGroup
|
||||
android:id="@+id/genderRadioGroup"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" >
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
|
||||
<RadioButton
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools" tools:context=".MainActivity">
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
tools:context=".activity.MainActivity">
|
||||
|
||||
<item
|
||||
android:id="@+id/action_exit"
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools" tools:context=".MainActivity">
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
tools:context=".activity.MainActivity">
|
||||
|
||||
<item
|
||||
android:id="@+id/action_notifications"
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
tools:context="ar.com.tristeslostrestigres.diasporanativewebapp.PodsActivity">
|
||||
tools:context=".activity.PodsActivity">
|
||||
|
||||
<item
|
||||
android:id="@+id/action_reload"
|
||||
android:title="@string/reload"
|
||||
android:icon="@drawable/ic_sync_white_24dp"
|
||||
android:orderInCategory="100"
|
||||
android:title="@string/reload"
|
||||
app:showAsAction="ifRoom" />
|
||||
</menu>
|
||||
|
|
|
@ -15,10 +15,10 @@
|
|||
<!-- 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:title="@string/jb_followed_tags" />
|
||||
android:title="@string/jb_followed_tags"
|
||||
android:visible="false" />
|
||||
<item
|
||||
android:id="@+id/nav_aspects"
|
||||
android:icon="@drawable/jb_aspects"
|
|
@ -152,6 +152,6 @@ along with this program. If not, see http://www.gnu.org/licenses.<br> <br
|
|||
<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 #DiasporaAndroid]*</string>
|
||||
<string name="shared_by_diaspora_android">*[geteilt durch #diaspora-android]*</string>
|
||||
|
||||
</resources>
|
||||
|
|
|
@ -205,5 +205,5 @@
|
|||
|
||||
<string name="exit_app">Exit app</string>
|
||||
<string name="diaspora" translatable="false">Diaspora</string>
|
||||
<string name="shared_by_diaspora_android">*[shared by #DiasporaAndroid]*</string>
|
||||
<string name="shared_by_diaspora_android">*[shared by #diaspora-android]*</string>
|
||||
</resources>
|
||||
|
|
Loading…
Reference in a new issue