Initial-Release
104
app/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1,104 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.raataar.sprueche_hollywood"
|
||||
android:versionCode="2"
|
||||
android:versionName="1">
|
||||
<uses-sdk android:minSdkVersion="14"/>
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
|
||||
<application
|
||||
android:name="com.raataar.sprueche_hollywood.app.AppController"
|
||||
android:allowBackup="true"
|
||||
android:icon="@drawable/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/AppTheme" >
|
||||
|
||||
<activity
|
||||
android:name="com.raataar.sprueche_hollywood.MainActivity"
|
||||
android:label="@string/app_name" >
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name="com.raataar.sprueche_hollywood.KategorieActivity"
|
||||
android:label="@string/title_kategorie_activity"
|
||||
android:parentActivityName="com.raataar.sprueche_hollywood.MainActivity" >
|
||||
<!-- Parent activity meta-data to support API level 7+ -->
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
android:value="PsiClass:MainActivity" />
|
||||
</activity>
|
||||
<activity
|
||||
android:name="com.raataar.sprueche_hollywood.KategorieByIDActivity"
|
||||
android:label="@string/title_kategoriebyid_activity"
|
||||
android:parentActivityName="com.raataar.sprueche_hollywood.KategorieActivity" >
|
||||
<!-- Parent activity meta-data to support API level 7+ -->
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
android:value="PsiClass:KategorieActivity" />
|
||||
</activity>
|
||||
<activity
|
||||
android:name="com.raataar.sprueche_hollywood.ZitatActivity"
|
||||
android:label="@string/title_zitat_activity">
|
||||
</activity>
|
||||
<activity
|
||||
android:name="com.raataar.sprueche_hollywood.ZufallZitatActivity"
|
||||
android:label="@string/title_zitat_activity"
|
||||
android:parentActivityName="com.raataar.sprueche_hollywood.MainActivity" >
|
||||
<!-- Parent activity meta-data to support API level 7+ -->
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
android:value="PsiClass:MainActivity" />
|
||||
</activity>
|
||||
<activity
|
||||
android:name="com.raataar.sprueche_hollywood.NewsActivity"
|
||||
android:label="@string/title_news_activity"
|
||||
android:parentActivityName="com.raataar.sprueche_hollywood.MainActivity" >
|
||||
<!-- Parent activity meta-data to support API level 7+ -->
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
android:value="PsiClass:MainActivity" />
|
||||
</activity>
|
||||
<activity
|
||||
android:name="com.raataar.sprueche_hollywood.AutorenActivity"
|
||||
android:label="@string/title_autoren_activity"
|
||||
android:parentActivityName="com.raataar.sprueche_hollywood.MainActivity" >
|
||||
<!-- Parent activity meta-data to support API level 7+ -->
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
android:value="PsiClass:MainActivity" />
|
||||
</activity>
|
||||
<activity
|
||||
android:name="com.raataar.sprueche_hollywood.AutorenByIDActivity"
|
||||
android:label="@string/title_autoren_activity"
|
||||
android:parentActivityName="com.raataar.sprueche_hollywood.AutorenActivity" >
|
||||
<!-- Parent activity meta-data to support API level 7+ -->
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
android:value="PsiClass:AutorenActivity" />
|
||||
</activity>
|
||||
<activity
|
||||
android:name="com.raataar.sprueche_hollywood.SuchenActivity"
|
||||
android:label="@string/title_suchen_activity"
|
||||
android:parentActivityName="com.raataar.sprueche_hollywood.MainActivity" >
|
||||
<!-- Parent activity meta-data to support API level 7+ -->
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
android:value="PsiClass:MainActivity" />
|
||||
</activity>
|
||||
<activity
|
||||
android:name="com.raataar.sprueche_hollywood.SuchenByIDActivity"
|
||||
android:label="@string/title_suchen_activity"
|
||||
android:parentActivityName="com.raataar.sprueche_hollywood.MainActivity" >
|
||||
<!-- Parent activity meta-data to support API level 7+ -->
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
android:value="PsiClass:MainActivity" />
|
||||
</activity>
|
||||
|
||||
</application>
|
||||
</manifest>
|
||||
@@ -0,0 +1,249 @@
|
||||
package com.raataar.sprueche_hollywood;
|
||||
|
||||
import android.app.ActionBar;
|
||||
import android.app.Activity;
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ListView;
|
||||
import com.android.volley.Response;
|
||||
import com.android.volley.VolleyError;
|
||||
import com.android.volley.VolleyLog;
|
||||
import com.android.volley.toolbox.JsonArrayRequest;
|
||||
import com.raataar.sprueche_hollywood.adater.AutorenListAdapter;
|
||||
import com.raataar.sprueche_hollywood.app.AppController;
|
||||
import com.raataar.sprueche_hollywood.model.Autoren;
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class AutorenActivity extends Activity {
|
||||
// Log tag
|
||||
private static final String TAG = AutorenActivity.class.getSimpleName();
|
||||
|
||||
// Json url
|
||||
private String url = "http://api.raataar.de/sapientia-autoren/";
|
||||
private ProgressDialog pDialog;
|
||||
private List<Autoren> autorenList = new ArrayList<Autoren>();
|
||||
private ListView listView;
|
||||
private AutorenListAdapter adapter;
|
||||
private String urlObjectId;
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_autoren);
|
||||
|
||||
Intent intent= getIntent();
|
||||
Bundle bundlevalues = intent.getExtras();
|
||||
|
||||
if(bundlevalues!=null)
|
||||
{
|
||||
urlObjectId=(String) bundlevalues.get("objectID");
|
||||
//Textv.setText(j);
|
||||
}
|
||||
|
||||
|
||||
listView = (ListView) findViewById(R.id.list);
|
||||
adapter = new AutorenListAdapter(this, autorenList);
|
||||
listView.setAdapter(adapter);
|
||||
|
||||
// changing action bar color
|
||||
getActionBar().setBackgroundDrawable(
|
||||
new ColorDrawable(Color.parseColor("#1b1b1b")));
|
||||
|
||||
|
||||
ActionBar actionBar = getActionBar();
|
||||
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
|
||||
// URL anpassen
|
||||
url = url + AppController.getMD5(getApplicationInfo().loadLabel(getPackageManager()).toString());
|
||||
|
||||
updateListView();
|
||||
|
||||
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||
|
||||
@Override
|
||||
public void onItemClick(AdapterView<?> parent, View view,
|
||||
int position, long id) {
|
||||
//Toast.makeText(MainActivity.this, "You Clicked at " + mainmenueList.get(+position).getObjectId(), Toast.LENGTH_SHORT).show();
|
||||
startMenueActivity(autorenList.get(+position).getObjectActivity(),autorenList.get(+position).getObjectId(),autorenList.get(+position).getTitle());
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
hidePDialog();
|
||||
}
|
||||
|
||||
|
||||
public void updateListView() {
|
||||
|
||||
pDialog = new ProgressDialog(this);
|
||||
// Showing progress dialog before making http request
|
||||
pDialog.setMessage("Lade Autoren...");
|
||||
pDialog.show();
|
||||
|
||||
|
||||
// Creating volley request obj
|
||||
JsonArrayRequest menueReq = new JsonArrayRequest(url
|
||||
, new Response.Listener<JSONArray>() {
|
||||
|
||||
@Override
|
||||
public void onResponse(JSONArray response) {
|
||||
Log.d(TAG, response.toString());
|
||||
hidePDialog();
|
||||
|
||||
//Toast.makeText(MainActivity.this, String.valueOf(response.length()), Toast.LENGTH_SHORT).show();
|
||||
|
||||
// Parsing json
|
||||
for (int i = 0; i < response.length(); i++) {
|
||||
try {
|
||||
|
||||
JSONObject obj = response.getJSONObject(i);
|
||||
Autoren autorenmodel = new Autoren();
|
||||
autorenmodel.setTitle(obj.getString("title"));
|
||||
autorenmodel.setImage(obj.getString("image"));
|
||||
autorenmodel.setObjectId(obj.getString("objectId"));
|
||||
autorenmodel.setAnzahl(obj.getString("anzahl"));
|
||||
autorenmodel.setBeschreibung(obj.getString("beschreibung"));
|
||||
autorenmodel.setObjectActivity(obj.getString("objectActivity"));
|
||||
|
||||
// adding movie to movies array
|
||||
autorenList.add(autorenmodel);
|
||||
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// notifying list adapter about data changes
|
||||
// so that it renders the list view with updated data
|
||||
adapter.notifyDataSetChanged();
|
||||
}
|
||||
}, new Response.ErrorListener() {
|
||||
|
||||
@Override
|
||||
public void onErrorResponse(VolleyError error) {
|
||||
VolleyLog.d(TAG, "Error: " + error.getMessage());
|
||||
hidePDialog();
|
||||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
// Adding request to request queue
|
||||
AppController.getInstance().addToRequestQueue(menueReq);
|
||||
}
|
||||
|
||||
public void startMenueActivity(String MyClass, String objectID,String titel){
|
||||
|
||||
try {
|
||||
Intent openNewIntent = new Intent( this, Class.forName( AppController.getInstance().getPackageURL() + MyClass ) );
|
||||
//Toast.makeText(MainActivity.this, "Starte Activity " + MyClass, Toast.LENGTH_SHORT).show();
|
||||
openNewIntent.putExtra("objectID", objectID);
|
||||
openNewIntent.putExtra("titel",titel);
|
||||
startActivity(openNewIntent );
|
||||
} catch (ClassNotFoundException e) {
|
||||
//Toast.makeText(MainActivity.this, "Nicht gefunden Activity " + MyClass, Toast.LENGTH_SHORT).show();
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void hidePDialog() {
|
||||
if (pDialog != null) {
|
||||
pDialog.dismiss();
|
||||
pDialog = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void startSubMenueActivity(String MyClass){
|
||||
|
||||
try {
|
||||
Intent openNewIntent = new Intent( this, Class.forName( AppController.getInstance().getPackageURL() + MyClass ) );
|
||||
startActivity(openNewIntent );
|
||||
} catch (ClassNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
// Inflate the menu; this adds items to the action bar if it is present.
|
||||
getMenuInflater().inflate(R.menu.autor_menu, menu);
|
||||
return true;
|
||||
}
|
||||
|
||||
/** FIX sorgt dafür das Icons im Menu dargestellt werden **/
|
||||
|
||||
@Override
|
||||
public boolean onMenuOpened(int featureId, Menu menu)
|
||||
{
|
||||
if(featureId == Window.FEATURE_ACTION_BAR && menu != null){
|
||||
if(menu.getClass().getSimpleName().equals("MenuBuilder")){
|
||||
try{
|
||||
Method m = menu.getClass().getDeclaredMethod(
|
||||
"setOptionalIconsVisible", Boolean.TYPE);
|
||||
m.setAccessible(true);
|
||||
m.invoke(menu, true);
|
||||
}
|
||||
catch(NoSuchMethodException e){
|
||||
Log.e(TAG, "onMenuOpened", e);
|
||||
}
|
||||
catch(Exception e){
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.onMenuOpened(featureId, menu);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
// Handle item selection
|
||||
switch (item.getItemId()) {
|
||||
case R.id.action_quit:
|
||||
moveTaskToBack(true);
|
||||
finish();
|
||||
return true;
|
||||
case R.id.action_refresh:
|
||||
autorenList.clear();
|
||||
updateListView();
|
||||
return true;
|
||||
case R.id.action_search:
|
||||
startSubMenueActivity("SuchenActivity");
|
||||
return true;
|
||||
case R.id.action_kategorie:
|
||||
startSubMenueActivity("KategorieActivity");
|
||||
return true;
|
||||
case R.id.action_autoren:
|
||||
startSubMenueActivity("AutorenActivity");
|
||||
return true;
|
||||
default:
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,264 @@
|
||||
package com.raataar.sprueche_hollywood;
|
||||
|
||||
import android.app.ActionBar;
|
||||
import android.app.Activity;
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ListView;
|
||||
import com.android.volley.Response;
|
||||
import com.android.volley.VolleyError;
|
||||
import com.android.volley.VolleyLog;
|
||||
import com.android.volley.toolbox.JsonArrayRequest;
|
||||
import com.raataar.sprueche_hollywood.adater.AutorenByIDListAdapter;
|
||||
import com.raataar.sprueche_hollywood.app.AppController;
|
||||
import com.raataar.sprueche_hollywood.model.AutorenByID;
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class AutorenByIDActivity extends Activity {
|
||||
// Log tag
|
||||
private static final String TAG = AutorenByIDActivity.class.getSimpleName();
|
||||
|
||||
// Json url
|
||||
private String url = "http://api.raataar.de/sapientia-zitat-by-autor/";
|
||||
private ProgressDialog pDialog;
|
||||
private List<AutorenByID> autorenByIDList = new ArrayList<AutorenByID>();
|
||||
private ListView listView;
|
||||
private AutorenByIDListAdapter adapter;
|
||||
private String urlObjectId;
|
||||
private String customTitle;
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_kategorie);
|
||||
|
||||
Intent intent= getIntent();
|
||||
Bundle bundlevalues = intent.getExtras();
|
||||
|
||||
this.setTitle("Kategorie-Inhalt");
|
||||
if(bundlevalues!=null)
|
||||
{
|
||||
urlObjectId=(String) bundlevalues.get("objectID");
|
||||
customTitle=(String) bundlevalues.get("titel");
|
||||
this.setTitle("Autor - " + customTitle);
|
||||
//Textv.setText(j);
|
||||
}
|
||||
|
||||
|
||||
listView = (ListView) findViewById(R.id.list);
|
||||
adapter = new AutorenByIDListAdapter(this, autorenByIDList);
|
||||
listView.setAdapter(adapter);
|
||||
|
||||
// changing action bar color
|
||||
getActionBar().setBackgroundDrawable(
|
||||
new ColorDrawable(Color.parseColor("#1b1b1b")));
|
||||
|
||||
|
||||
ActionBar actionBar = getActionBar();
|
||||
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
|
||||
// URL anpassen
|
||||
url = url + AppController.getMD5(getApplicationInfo().loadLabel(getPackageManager()).toString());
|
||||
|
||||
updateListView();
|
||||
|
||||
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||
|
||||
@Override
|
||||
public void onItemClick(AdapterView<?> parent, View view,
|
||||
int position, long id) {
|
||||
//Toast.makeText(MainActivity.this, "You Clicked at " + mainmenueList.get(+position).getObjectId(), Toast.LENGTH_SHORT).show();
|
||||
String mysubstring;
|
||||
if (autorenByIDList.get(+position).getZitat().length()>25){
|
||||
mysubstring=autorenByIDList.get(+position).getZitat().substring(0,25) + "...";
|
||||
}
|
||||
else{
|
||||
mysubstring=autorenByIDList.get(+position).getZitat();
|
||||
}
|
||||
|
||||
startMenueActivity(autorenByIDList.get(+position).getObjectActivity(),autorenByIDList.get(+position).getObjectId(),mysubstring);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
hidePDialog();
|
||||
}
|
||||
|
||||
|
||||
public void updateListView() {
|
||||
|
||||
pDialog = new ProgressDialog(this);
|
||||
// Showing progress dialog before making http request
|
||||
pDialog.setMessage("Lade Autoren-Inhalt...");
|
||||
pDialog.show();
|
||||
|
||||
|
||||
// Creating volley request obj
|
||||
JsonArrayRequest menueReq = new JsonArrayRequest(url + "/" + urlObjectId
|
||||
, new Response.Listener<JSONArray>() {
|
||||
|
||||
@Override
|
||||
public void onResponse(JSONArray response) {
|
||||
Log.d(TAG, response.toString());
|
||||
hidePDialog();
|
||||
|
||||
//Toast.makeText(KategorieByIDActivity.this, urlObjectId, Toast.LENGTH_SHORT).show();
|
||||
//Toast.makeText(MainActivity.this, String.valueOf(response.length()), Toast.LENGTH_SHORT).show();
|
||||
|
||||
// Parsing json
|
||||
for (int i = 0; i < response.length(); i++) {
|
||||
try {
|
||||
|
||||
JSONObject obj = response.getJSONObject(i);
|
||||
AutorenByID autorenbyidlist = new AutorenByID();
|
||||
autorenbyidlist.setZitat(obj.getString("zitat"));
|
||||
autorenbyidlist.setImage(obj.getString("image"));
|
||||
autorenbyidlist.setObjectId(obj.getString("objectId"));
|
||||
autorenbyidlist.setAutoren_text(obj.getString("autoren_text"));
|
||||
autorenbyidlist.setKategorie_text(obj.getString("kategorie_text"));
|
||||
autorenbyidlist.setAutor_id(obj.getString("autor_id"));
|
||||
autorenbyidlist.setKategorie_id(obj.getString("kategorie_id"));
|
||||
autorenbyidlist.setObjectActivity(obj.getString("objectActivity"));
|
||||
|
||||
// adding movie to movies array
|
||||
autorenByIDList.add(autorenbyidlist);
|
||||
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// notifying list adapter about data changes
|
||||
// so that it renders the list view with updated data
|
||||
adapter.notifyDataSetChanged();
|
||||
}
|
||||
}, new Response.ErrorListener() {
|
||||
|
||||
@Override
|
||||
public void onErrorResponse(VolleyError error) {
|
||||
VolleyLog.d(TAG, "Error: " + error.getMessage());
|
||||
hidePDialog();
|
||||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
// Adding request to request queue
|
||||
AppController.getInstance().addToRequestQueue(menueReq);
|
||||
}
|
||||
|
||||
public void startMenueActivity(String MyClass, String objectID, String titel){
|
||||
|
||||
try {
|
||||
Intent openNewIntent = new Intent( this, Class.forName( AppController.getInstance().getPackageURL() + MyClass ) );
|
||||
//Toast.makeText(MainActivity.this, "Starte Activity " + MyClass, Toast.LENGTH_SHORT).show();
|
||||
openNewIntent.putExtra("objectID",objectID);
|
||||
openNewIntent.putExtra("titel", titel);
|
||||
startActivity(openNewIntent );
|
||||
} catch (ClassNotFoundException e) {
|
||||
//Toast.makeText(MainActivity.this, "Nicht gefunden Activity " + MyClass, Toast.LENGTH_SHORT).show();
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void hidePDialog() {
|
||||
if (pDialog != null) {
|
||||
pDialog.dismiss();
|
||||
pDialog = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void startSubMenueActivity(String MyClass){
|
||||
|
||||
try {
|
||||
Intent openNewIntent = new Intent( this, Class.forName( AppController.getInstance().getPackageURL() + MyClass ) );
|
||||
startActivity(openNewIntent );
|
||||
} catch (ClassNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
// Inflate the menu; this adds items to the action bar if it is present.
|
||||
getMenuInflater().inflate(R.menu.autor_menu, menu);
|
||||
return true;
|
||||
}
|
||||
|
||||
/** FIX sorgt dafür das Icons im Menu dargestellt werden **/
|
||||
|
||||
@Override
|
||||
public boolean onMenuOpened(int featureId, Menu menu)
|
||||
{
|
||||
if(featureId == Window.FEATURE_ACTION_BAR && menu != null){
|
||||
if(menu.getClass().getSimpleName().equals("MenuBuilder")){
|
||||
try{
|
||||
Method m = menu.getClass().getDeclaredMethod(
|
||||
"setOptionalIconsVisible", Boolean.TYPE);
|
||||
m.setAccessible(true);
|
||||
m.invoke(menu, true);
|
||||
}
|
||||
catch(NoSuchMethodException e){
|
||||
Log.e(TAG, "onMenuOpened", e);
|
||||
}
|
||||
catch(Exception e){
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.onMenuOpened(featureId, menu);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
// Handle item selection
|
||||
switch (item.getItemId()) {
|
||||
case R.id.action_quit:
|
||||
moveTaskToBack(true);
|
||||
finish();
|
||||
return true;
|
||||
case R.id.action_refresh:
|
||||
autorenByIDList.clear();
|
||||
updateListView();
|
||||
return true;
|
||||
case R.id.action_search:
|
||||
startSubMenueActivity("SuchenActivity");
|
||||
return true;
|
||||
case R.id.action_kategorie:
|
||||
startSubMenueActivity("KategorieActivity");
|
||||
return true;
|
||||
case R.id.action_autoren:
|
||||
startSubMenueActivity("AutorenActivity");
|
||||
return true;
|
||||
default:
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,250 @@
|
||||
package com.raataar.sprueche_hollywood;
|
||||
|
||||
import android.app.ActionBar;
|
||||
import android.app.Activity;
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ListView;
|
||||
|
||||
import com.android.volley.Response;
|
||||
import com.android.volley.VolleyError;
|
||||
import com.android.volley.VolleyLog;
|
||||
import com.android.volley.toolbox.JsonArrayRequest;
|
||||
import com.raataar.sprueche_hollywood.adater.KategorieListAdapter;
|
||||
import com.raataar.sprueche_hollywood.app.AppController;
|
||||
import com.raataar.sprueche_hollywood.model.Kategorie;
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class KategorieActivity extends Activity {
|
||||
// Log tag
|
||||
private static final String TAG = KategorieActivity.class.getSimpleName();
|
||||
|
||||
// Json url
|
||||
private String url = "http://api.raataar.de/sapientia-kategorien/";
|
||||
private ProgressDialog pDialog;
|
||||
private List<Kategorie> kategorieList = new ArrayList<Kategorie>();
|
||||
private ListView listView;
|
||||
private KategorieListAdapter adapter;
|
||||
private String urlObjectId;
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_kategorie);
|
||||
|
||||
Intent intent= getIntent();
|
||||
Bundle bundlevalues = intent.getExtras();
|
||||
|
||||
if(bundlevalues!=null)
|
||||
{
|
||||
urlObjectId=(String) bundlevalues.get("objectID");
|
||||
//Textv.setText(j);
|
||||
}
|
||||
|
||||
|
||||
listView = (ListView) findViewById(R.id.list);
|
||||
adapter = new KategorieListAdapter(this, kategorieList);
|
||||
listView.setAdapter(adapter);
|
||||
|
||||
// changing action bar color
|
||||
getActionBar().setBackgroundDrawable(
|
||||
new ColorDrawable(Color.parseColor("#1b1b1b")));
|
||||
|
||||
|
||||
ActionBar actionBar = getActionBar();
|
||||
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
|
||||
// URL anpassen
|
||||
url = url + AppController.getMD5(getApplicationInfo().loadLabel(getPackageManager()).toString());
|
||||
|
||||
updateListView();
|
||||
|
||||
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||
|
||||
@Override
|
||||
public void onItemClick(AdapterView<?> parent, View view,
|
||||
int position, long id) {
|
||||
//Toast.makeText(MainActivity.this, "You Clicked at " + mainmenueList.get(+position).getObjectId(), Toast.LENGTH_SHORT).show();
|
||||
startMenueActivity(kategorieList.get(+position).getObjectActivity(),kategorieList.get(+position).getObjectId(),kategorieList.get(+position).getTitle());
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
hidePDialog();
|
||||
}
|
||||
|
||||
|
||||
public void updateListView() {
|
||||
|
||||
pDialog = new ProgressDialog(this);
|
||||
// Showing progress dialog before making http request
|
||||
pDialog.setMessage("Lade Kategorien...");
|
||||
pDialog.show();
|
||||
|
||||
|
||||
// Creating volley request obj
|
||||
JsonArrayRequest menueReq = new JsonArrayRequest(url
|
||||
, new Response.Listener<JSONArray>() {
|
||||
|
||||
@Override
|
||||
public void onResponse(JSONArray response) {
|
||||
Log.d(TAG, response.toString());
|
||||
hidePDialog();
|
||||
|
||||
//Toast.makeText(MainActivity.this, String.valueOf(response.length()), Toast.LENGTH_SHORT).show();
|
||||
|
||||
// Parsing json
|
||||
for (int i = 0; i < response.length(); i++) {
|
||||
try {
|
||||
|
||||
JSONObject obj = response.getJSONObject(i);
|
||||
Kategorie mainmenue = new Kategorie();
|
||||
mainmenue.setTitle(obj.getString("title"));
|
||||
mainmenue.setImage(obj.getString("image"));
|
||||
mainmenue.setObjectId(obj.getString("objectId"));
|
||||
mainmenue.setAnzahl(obj.getString("anzahl"));
|
||||
mainmenue.setBeschreibung(obj.getString("beschreibung"));
|
||||
mainmenue.setObjectActivity(obj.getString("objectActivity"));
|
||||
|
||||
// adding movie to movies array
|
||||
kategorieList.add(mainmenue);
|
||||
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// notifying list adapter about data changes
|
||||
// so that it renders the list view with updated data
|
||||
adapter.notifyDataSetChanged();
|
||||
}
|
||||
}, new Response.ErrorListener() {
|
||||
|
||||
@Override
|
||||
public void onErrorResponse(VolleyError error) {
|
||||
VolleyLog.d(TAG, "Error: " + error.getMessage());
|
||||
hidePDialog();
|
||||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
// Adding request to request queue
|
||||
AppController.getInstance().addToRequestQueue(menueReq);
|
||||
}
|
||||
|
||||
public void startMenueActivity(String MyClass, String objectID,String titel){
|
||||
|
||||
try {
|
||||
Intent openNewIntent = new Intent( this, Class.forName( AppController.getInstance().getPackageURL() + MyClass ) );
|
||||
//Toast.makeText(MainActivity.this, "Starte Activity " + MyClass, Toast.LENGTH_SHORT).show();
|
||||
openNewIntent.putExtra("objectID", objectID);
|
||||
openNewIntent.putExtra("titel",titel);
|
||||
startActivity(openNewIntent );
|
||||
} catch (ClassNotFoundException e) {
|
||||
//Toast.makeText(MainActivity.this, "Nicht gefunden Activity " + MyClass, Toast.LENGTH_SHORT).show();
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void hidePDialog() {
|
||||
if (pDialog != null) {
|
||||
pDialog.dismiss();
|
||||
pDialog = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void startSubMenueActivity(String MyClass){
|
||||
|
||||
try {
|
||||
Intent openNewIntent = new Intent( this, Class.forName( AppController.getInstance().getPackageURL() + MyClass ) );
|
||||
startActivity(openNewIntent );
|
||||
} catch (ClassNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
// Inflate the menu; this adds items to the action bar if it is present.
|
||||
getMenuInflater().inflate(R.menu.kategorie_menu, menu);
|
||||
return true;
|
||||
}
|
||||
|
||||
/** FIX sorgt dafür das Icons im Menu dargestellt werden **/
|
||||
|
||||
@Override
|
||||
public boolean onMenuOpened(int featureId, Menu menu)
|
||||
{
|
||||
if(featureId == Window.FEATURE_ACTION_BAR && menu != null){
|
||||
if(menu.getClass().getSimpleName().equals("MenuBuilder")){
|
||||
try{
|
||||
Method m = menu.getClass().getDeclaredMethod(
|
||||
"setOptionalIconsVisible", Boolean.TYPE);
|
||||
m.setAccessible(true);
|
||||
m.invoke(menu, true);
|
||||
}
|
||||
catch(NoSuchMethodException e){
|
||||
Log.e(TAG, "onMenuOpened", e);
|
||||
}
|
||||
catch(Exception e){
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.onMenuOpened(featureId, menu);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
// Handle item selection
|
||||
switch (item.getItemId()) {
|
||||
case R.id.action_quit:
|
||||
moveTaskToBack(true);
|
||||
finish();
|
||||
return true;
|
||||
case R.id.action_refresh:
|
||||
kategorieList.clear();
|
||||
updateListView();
|
||||
return true;
|
||||
case R.id.action_search:
|
||||
startSubMenueActivity("SuchenActivity");
|
||||
return true;
|
||||
case R.id.action_kategorie:
|
||||
startSubMenueActivity("KategorieActivity");
|
||||
return true;
|
||||
case R.id.action_autoren:
|
||||
startSubMenueActivity("AutorenActivity");
|
||||
return true;
|
||||
default:
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,268 @@
|
||||
package com.raataar.sprueche_hollywood;
|
||||
|
||||
import android.app.ActionBar;
|
||||
import android.app.Activity;
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ListView;
|
||||
|
||||
import com.android.volley.Response;
|
||||
import com.android.volley.VolleyError;
|
||||
import com.android.volley.VolleyLog;
|
||||
import com.android.volley.toolbox.JsonArrayRequest;
|
||||
import com.raataar.sprueche_hollywood.adater.KategorieByIDListAdapter;
|
||||
import com.raataar.sprueche_hollywood.app.AppController;
|
||||
import com.raataar.sprueche_hollywood.model.KategorieByID;
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class KategorieByIDActivity extends Activity {
|
||||
// Log tag
|
||||
private static final String TAG = KategorieByIDActivity.class.getSimpleName();
|
||||
|
||||
// Json url
|
||||
private String url = "http://api.raataar.de/sapientia-zitat-by-kategorie/";
|
||||
private ProgressDialog pDialog;
|
||||
private List<KategorieByID> kategoriebyidList = new ArrayList<KategorieByID>();
|
||||
private ListView listView;
|
||||
private KategorieByIDListAdapter adapter;
|
||||
private String urlObjectId;
|
||||
private String customTitle;
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_kategorie);
|
||||
|
||||
Intent intent= getIntent();
|
||||
Bundle bundlevalues = intent.getExtras();
|
||||
|
||||
this.setTitle("Kategorie-Inhalt");
|
||||
if(bundlevalues!=null)
|
||||
{
|
||||
urlObjectId=(String) bundlevalues.get("objectID");
|
||||
customTitle=(String) bundlevalues.get("titel");
|
||||
this.setTitle("Kategorie - " + customTitle);
|
||||
//Textv.setText(j);
|
||||
}
|
||||
|
||||
|
||||
listView = (ListView) findViewById(R.id.list);
|
||||
adapter = new KategorieByIDListAdapter(this, kategoriebyidList);
|
||||
listView.setAdapter(adapter);
|
||||
|
||||
// changing action bar color
|
||||
getActionBar().setBackgroundDrawable(
|
||||
new ColorDrawable(Color.parseColor("#1b1b1b")));
|
||||
|
||||
|
||||
ActionBar actionBar = getActionBar();
|
||||
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
|
||||
// URL anpassen
|
||||
url = url + AppController.getMD5(getApplicationInfo().loadLabel(getPackageManager()).toString());
|
||||
|
||||
updateListView();
|
||||
|
||||
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||
|
||||
@Override
|
||||
public void onItemClick(AdapterView<?> parent, View view,
|
||||
int position, long id) {
|
||||
//Toast.makeText(MainActivity.this, "You Clicked at " + mainmenueList.get(+position).getObjectId(), Toast.LENGTH_SHORT).show();
|
||||
//startMenueActivity(kategoriebyidList.get(+position).getObjectActivity(),kategoriebyidList.get(+position).getObjectId(),kategoriebyidList.get(+position).getZitat().substring(0,25)+"...");
|
||||
|
||||
String mysubstring;
|
||||
if (kategoriebyidList.get(+position).getZitat().length()>25){
|
||||
mysubstring=kategoriebyidList.get(+position).getZitat().substring(0,25) + "...";
|
||||
}
|
||||
else{
|
||||
mysubstring=kategoriebyidList.get(+position).getZitat();
|
||||
}
|
||||
|
||||
startMenueActivity(kategoriebyidList.get(+position).getObjectActivity(),kategoriebyidList.get(+position).getObjectId(),mysubstring);
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
hidePDialog();
|
||||
}
|
||||
|
||||
|
||||
public void updateListView() {
|
||||
|
||||
pDialog = new ProgressDialog(this);
|
||||
// Showing progress dialog before making http request
|
||||
pDialog.setMessage("Lade Kategorie-Inhalt...");
|
||||
pDialog.show();
|
||||
|
||||
|
||||
// Creating volley request obj
|
||||
JsonArrayRequest menueReq = new JsonArrayRequest(url + "/" + urlObjectId
|
||||
, new Response.Listener<JSONArray>() {
|
||||
|
||||
@Override
|
||||
public void onResponse(JSONArray response) {
|
||||
Log.d(TAG, response.toString());
|
||||
hidePDialog();
|
||||
|
||||
//Toast.makeText(KategorieByIDActivity.this, urlObjectId, Toast.LENGTH_SHORT).show();
|
||||
//Toast.makeText(MainActivity.this, String.valueOf(response.length()), Toast.LENGTH_SHORT).show();
|
||||
|
||||
// Parsing json
|
||||
for (int i = 0; i < response.length(); i++) {
|
||||
try {
|
||||
|
||||
JSONObject obj = response.getJSONObject(i);
|
||||
KategorieByID kategoriebyidlist = new KategorieByID();
|
||||
kategoriebyidlist.setZitat(obj.getString("zitat"));
|
||||
kategoriebyidlist.setImage(obj.getString("image"));
|
||||
kategoriebyidlist.setObjectId(obj.getString("objectId"));
|
||||
kategoriebyidlist.setAutoren_text(obj.getString("autoren_text"));
|
||||
kategoriebyidlist.setKategorie_text(obj.getString("kategorie_text"));
|
||||
kategoriebyidlist.setAutor_id(obj.getString("autor_id"));
|
||||
kategoriebyidlist.setKategorie_id(obj.getString("kategorie_id"));
|
||||
kategoriebyidlist.setObjectActivity(obj.getString("objectActivity"));
|
||||
|
||||
// adding movie to movies array
|
||||
kategoriebyidList.add(kategoriebyidlist);
|
||||
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// notifying list adapter about data changes
|
||||
// so that it renders the list view with updated data
|
||||
adapter.notifyDataSetChanged();
|
||||
}
|
||||
}, new Response.ErrorListener() {
|
||||
|
||||
@Override
|
||||
public void onErrorResponse(VolleyError error) {
|
||||
VolleyLog.d(TAG, "Error: " + error.getMessage());
|
||||
hidePDialog();
|
||||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
// Adding request to request queue
|
||||
AppController.getInstance().addToRequestQueue(menueReq);
|
||||
}
|
||||
|
||||
public void startMenueActivity(String MyClass, String objectID, String titel){
|
||||
|
||||
try {
|
||||
Intent openNewIntent = new Intent( this, Class.forName( AppController.getInstance().getPackageURL() + MyClass ) );
|
||||
//Toast.makeText(MainActivity.this, "Starte Activity " + MyClass, Toast.LENGTH_SHORT).show();
|
||||
openNewIntent.putExtra("objectID",objectID);
|
||||
openNewIntent.putExtra("titel", titel);
|
||||
startActivity(openNewIntent );
|
||||
} catch (ClassNotFoundException e) {
|
||||
//Toast.makeText(MainActivity.this, "Nicht gefunden Activity " + MyClass, Toast.LENGTH_SHORT).show();
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void hidePDialog() {
|
||||
if (pDialog != null) {
|
||||
pDialog.dismiss();
|
||||
pDialog = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void startSubMenueActivity(String MyClass){
|
||||
|
||||
try {
|
||||
Intent openNewIntent = new Intent( this, Class.forName( AppController.getInstance().getPackageURL() + MyClass ) );
|
||||
startActivity(openNewIntent );
|
||||
} catch (ClassNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
// Inflate the menu; this adds items to the action bar if it is present.
|
||||
getMenuInflater().inflate(R.menu.kategorie_menu, menu);
|
||||
return true;
|
||||
}
|
||||
|
||||
/** FIX sorgt dafür das Icons im Menu dargestellt werden **/
|
||||
|
||||
@Override
|
||||
public boolean onMenuOpened(int featureId, Menu menu)
|
||||
{
|
||||
if(featureId == Window.FEATURE_ACTION_BAR && menu != null){
|
||||
if(menu.getClass().getSimpleName().equals("MenuBuilder")){
|
||||
try{
|
||||
Method m = menu.getClass().getDeclaredMethod(
|
||||
"setOptionalIconsVisible", Boolean.TYPE);
|
||||
m.setAccessible(true);
|
||||
m.invoke(menu, true);
|
||||
}
|
||||
catch(NoSuchMethodException e){
|
||||
Log.e(TAG, "onMenuOpened", e);
|
||||
}
|
||||
catch(Exception e){
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.onMenuOpened(featureId, menu);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
// Handle item selection
|
||||
switch (item.getItemId()) {
|
||||
case R.id.action_quit:
|
||||
moveTaskToBack(true);
|
||||
finish();
|
||||
return true;
|
||||
case R.id.action_refresh:
|
||||
kategoriebyidList.clear();
|
||||
updateListView();
|
||||
return true;
|
||||
case R.id.action_search:
|
||||
startSubMenueActivity("SuchenActivity");
|
||||
return true;
|
||||
case R.id.action_kategorie:
|
||||
startSubMenueActivity("KategorieActivity");
|
||||
return true;
|
||||
case R.id.action_autoren:
|
||||
startSubMenueActivity("AutorenActivity");
|
||||
return true;
|
||||
default:
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,258 @@
|
||||
package com.raataar.sprueche_hollywood;
|
||||
|
||||
import android.app.ActionBar;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.widget.AdapterView;
|
||||
|
||||
import com.raataar.sprueche_hollywood.adater.MainmenueListAdapter;
|
||||
import com.raataar.sprueche_hollywood.app.AppController;
|
||||
import com.raataar.sprueche_hollywood.model.Mainmenue;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.ProgressDialog;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.Menu;
|
||||
import android.widget.ListView;
|
||||
|
||||
import com.android.volley.Response;
|
||||
import com.android.volley.VolleyError;
|
||||
import com.android.volley.VolleyLog;
|
||||
import com.android.volley.toolbox.JsonArrayRequest;
|
||||
|
||||
|
||||
public class MainActivity extends Activity {
|
||||
// Log tag
|
||||
private static final String TAG = MainActivity.class.getSimpleName();
|
||||
|
||||
// Json url
|
||||
private static final String url = "http://api.raataar.de/sapientia-home";
|
||||
private ProgressDialog pDialog;
|
||||
private List<Mainmenue> mainmenueList = new ArrayList<Mainmenue>();
|
||||
private ListView listView;
|
||||
private MainmenueListAdapter adapter;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
|
||||
//Prüfen ob Internet vorhanden
|
||||
if (isOnline()==false){
|
||||
pDialog = new ProgressDialog(MainActivity.this);
|
||||
// Showing progress dialog before making http request
|
||||
pDialog.setMessage("Keine Internetverbindung! \n\nDiese App benötigt eine funktionierende Internetverbindung.");
|
||||
pDialog.setCancelable(false);
|
||||
pDialog.setButton(DialogInterface.BUTTON_NEGATIVE, "Beenden", new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
dialog.dismiss();
|
||||
moveTaskToBack(true);
|
||||
finish();
|
||||
//return true;
|
||||
}
|
||||
});
|
||||
pDialog.show();
|
||||
}
|
||||
|
||||
|
||||
listView = (ListView) findViewById(R.id.list);
|
||||
adapter = new MainmenueListAdapter(this, mainmenueList);
|
||||
listView.setAdapter(adapter);
|
||||
|
||||
// changing action bar color
|
||||
getActionBar().setBackgroundDrawable(
|
||||
new ColorDrawable(Color.parseColor("#1b1b1b")));
|
||||
|
||||
|
||||
ActionBar actionBar = getActionBar();
|
||||
//actionBar.setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
//Listbox füllen
|
||||
updateListView();
|
||||
|
||||
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||
|
||||
@Override
|
||||
public void onItemClick(AdapterView<?> parent, View view,
|
||||
int position, long id) {
|
||||
//Toast.makeText(MainActivity.this, "You Clicked at " + mainmenueList.get(+position).getObjectId(), Toast.LENGTH_SHORT).show();
|
||||
startMenueActivity(mainmenueList.get(+position).getObjectActivity(), mainmenueList.get(+position).getObjectId(), mainmenueList.get(+position).getTitle());
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
hidePDialog();
|
||||
}
|
||||
|
||||
|
||||
public void updateListView() {
|
||||
|
||||
pDialog = new ProgressDialog(this);
|
||||
// Showing progress dialog before making http request
|
||||
pDialog.setMessage("Lade...");
|
||||
pDialog.show();
|
||||
|
||||
|
||||
// Creating volley request obj
|
||||
JsonArrayRequest menueReq = new JsonArrayRequest(url
|
||||
, new Response.Listener<JSONArray>() {
|
||||
|
||||
@Override
|
||||
public void onResponse(JSONArray response) {
|
||||
Log.d(TAG, response.toString());
|
||||
hidePDialog();
|
||||
|
||||
//Toast.makeText(MainActivity.this, String.valueOf(response.length()), Toast.LENGTH_SHORT).show();
|
||||
|
||||
// Parsing json
|
||||
for (int i = 0; i < response.length(); i++) {
|
||||
try {
|
||||
|
||||
JSONObject obj = response.getJSONObject(i);
|
||||
Mainmenue mainmenue = new Mainmenue();
|
||||
mainmenue.setTitle(obj.getString("title"));
|
||||
mainmenue.setImage(obj.getString("image"));
|
||||
mainmenue.setObjectId(obj.getString("objectId"));
|
||||
mainmenue.setAnzahl(obj.getString("anzahl"));
|
||||
mainmenue.setBeschreibung(obj.getString("beschreibung"));
|
||||
mainmenue.setObjectActivity(obj.getString("objectActivity"));
|
||||
|
||||
// adding movie to movies array
|
||||
mainmenueList.add(mainmenue);
|
||||
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// notifying list adapter about data changes
|
||||
// so that it renders the list view with updated data
|
||||
adapter.notifyDataSetChanged();
|
||||
}
|
||||
}, new Response.ErrorListener() {
|
||||
|
||||
@Override
|
||||
public void onErrorResponse(VolleyError error) {
|
||||
VolleyLog.d(TAG, "Error: " + error.getMessage());
|
||||
hidePDialog();
|
||||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
// Adding request to request queue
|
||||
AppController.getInstance().addToRequestQueue(menueReq);
|
||||
}
|
||||
|
||||
public void startMenueActivity(String MyClass, String objectID, String titel){
|
||||
|
||||
try {
|
||||
Intent openNewIntent = new Intent( this, Class.forName( AppController.getInstance().getPackageURL() + MyClass ) );
|
||||
//Toast.makeText(MainActivity.this, "Starte Activity " + MyClass, Toast.LENGTH_SHORT).show();
|
||||
openNewIntent.putExtra("objectID",objectID);
|
||||
openNewIntent.putExtra("titel",titel);
|
||||
startActivity(openNewIntent );
|
||||
} catch (ClassNotFoundException e) {
|
||||
//Toast.makeText(MainActivity.this, "Nicht gefunden Activity " + MyClass, Toast.LENGTH_SHORT).show();
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void hidePDialog() {
|
||||
if (pDialog != null) {
|
||||
pDialog.dismiss();
|
||||
pDialog = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
// Inflate the menu; this adds items to the action bar if it is present.
|
||||
getMenuInflater().inflate(R.menu.main_menu, menu);
|
||||
return true;
|
||||
}
|
||||
|
||||
/** FIX sorgt dafür das Icons im Menu dargestellt werden **/
|
||||
|
||||
@Override
|
||||
public boolean onMenuOpened(int featureId, Menu menu)
|
||||
{
|
||||
if(featureId == Window.FEATURE_ACTION_BAR && menu != null){
|
||||
if(menu.getClass().getSimpleName().equals("MenuBuilder")){
|
||||
try{
|
||||
Method m = menu.getClass().getDeclaredMethod(
|
||||
"setOptionalIconsVisible", Boolean.TYPE);
|
||||
m.setAccessible(true);
|
||||
m.invoke(menu, true);
|
||||
}
|
||||
catch(NoSuchMethodException e){
|
||||
Log.e(TAG, "onMenuOpened", e);
|
||||
}
|
||||
catch(Exception e){
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.onMenuOpened(featureId, menu);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
// Handle item selection
|
||||
switch (item.getItemId()) {
|
||||
case R.id.action_quit:
|
||||
moveTaskToBack(true);
|
||||
finish();
|
||||
return true;
|
||||
case R.id.action_refresh:
|
||||
mainmenueList.clear();
|
||||
updateListView();
|
||||
return true;
|
||||
default:
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isOnline() {
|
||||
|
||||
Runtime runtime = Runtime.getRuntime();
|
||||
try {
|
||||
|
||||
Process ipProcess = runtime.exec("/system/bin/ping -c 1 8.8.8.8");
|
||||
int exitValue = ipProcess.waitFor();
|
||||
//return true;
|
||||
return (exitValue == 0);
|
||||
|
||||
} catch (IOException e) { e.printStackTrace(); }
|
||||
catch (InterruptedException e) { e.printStackTrace(); }
|
||||
//return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,242 @@
|
||||
package com.raataar.sprueche_hollywood;
|
||||
|
||||
import android.app.ActionBar;
|
||||
import android.app.Activity;
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.Window;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.android.volley.Response;
|
||||
import com.android.volley.VolleyError;
|
||||
import com.android.volley.VolleyLog;
|
||||
import com.android.volley.toolbox.ImageLoader;
|
||||
import com.android.volley.toolbox.JsonArrayRequest;
|
||||
import com.android.volley.toolbox.NetworkImageView;
|
||||
import com.raataar.sprueche_hollywood.app.AppController;
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
|
||||
public class NewsActivity extends Activity {
|
||||
// Log tag
|
||||
private static final String TAG = NewsActivity.class.getSimpleName();
|
||||
|
||||
// Json url
|
||||
private String url = "http://api.raataar.de/sapientia-news/";
|
||||
private ProgressDialog pDialog;
|
||||
private String urlObjectId;
|
||||
private String customTitle;
|
||||
private String Anzahl;
|
||||
|
||||
ImageLoader imageLoader = AppController.getInstance().getImageLoader();
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_news);
|
||||
|
||||
Intent intent= getIntent();
|
||||
Bundle bundlevalues = intent.getExtras();
|
||||
|
||||
this.setTitle("News");
|
||||
if(bundlevalues!=null)
|
||||
{
|
||||
|
||||
urlObjectId = (String) bundlevalues.get("objectID");
|
||||
customTitle=(String) bundlevalues.get("titel");
|
||||
this.setTitle("Weisheit: " + customTitle);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
// changing action bar color
|
||||
getActionBar().setBackgroundDrawable(
|
||||
new ColorDrawable(Color.parseColor("#1b1b1b")));
|
||||
|
||||
|
||||
ActionBar actionBar = getActionBar();
|
||||
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
|
||||
updateNews();
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void updateNews(){
|
||||
pDialog = new ProgressDialog(this);
|
||||
// Showing progress dialog before making http request
|
||||
pDialog.setMessage("Lade News...");
|
||||
pDialog.show();
|
||||
|
||||
//URL anpassen
|
||||
url = url + AppController.getMD5(getApplicationInfo().loadLabel(getPackageManager()).toString());
|
||||
|
||||
// Creating volley request obj
|
||||
JsonArrayRequest menueReq = new JsonArrayRequest(url
|
||||
, new Response.Listener<JSONArray>() {
|
||||
|
||||
@Override
|
||||
public void onResponse(JSONArray response) {
|
||||
Log.d(TAG, response.toString());
|
||||
hidePDialog();
|
||||
|
||||
|
||||
// Parsing json
|
||||
for (int i = 0; i < response.length(); i++) {
|
||||
try {
|
||||
|
||||
JSONObject obj = response.getJSONObject(i);
|
||||
|
||||
|
||||
if (imageLoader == null)
|
||||
imageLoader = AppController.getInstance().getImageLoader();
|
||||
|
||||
|
||||
NetworkImageView news_image = (NetworkImageView)findViewById(R.id.news_image);
|
||||
|
||||
TextView news_title = (TextView)findViewById(R.id.news_title);
|
||||
TextView objectid = (TextView)findViewById(R.id.objectid);
|
||||
|
||||
TextView news_content = (TextView)findViewById(R.id.news_content);
|
||||
|
||||
news_image.setImageUrl(obj.getString("news_image"), imageLoader);
|
||||
news_title.setText(obj.getString("news_title"));
|
||||
objectid.setText(obj.getString("objectId"));
|
||||
news_content.setText(obj.getString("news_content"));
|
||||
|
||||
urlObjectId=obj.getString("objectId");
|
||||
Anzahl=obj.getString("anzahl");
|
||||
|
||||
//Toast.makeText(NewsActivity.this, obj.getString("lastId") + " xxx " + obj.getString("objectId"), Toast.LENGTH_SHORT).show();
|
||||
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}, new Response.ErrorListener() {
|
||||
|
||||
@Override
|
||||
public void onErrorResponse(VolleyError error) {
|
||||
VolleyLog.d(TAG, "Error: " + error.getMessage());
|
||||
hidePDialog();
|
||||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
// Adding request to request queue
|
||||
AppController.getInstance().addToRequestQueue(menueReq);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
hidePDialog();
|
||||
}
|
||||
|
||||
public void startMenueActivity(String MyClass){
|
||||
|
||||
try {
|
||||
Intent openNewIntent = new Intent( this, Class.forName( AppController.getInstance().getPackageURL() + MyClass ) );
|
||||
startActivity( openNewIntent );
|
||||
} catch (ClassNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void hidePDialog() {
|
||||
if (pDialog != null) {
|
||||
pDialog.dismiss();
|
||||
pDialog = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void startSubMenueActivity(String MyClass){
|
||||
|
||||
try {
|
||||
Intent openNewIntent = new Intent( this, Class.forName( AppController.getInstance().getPackageURL() + MyClass ) );
|
||||
startActivity(openNewIntent );
|
||||
} catch (ClassNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
// Inflate the menu; this adds items to the action bar if it is present.
|
||||
getMenuInflater().inflate(R.menu.news_menu, menu);
|
||||
return true;
|
||||
}
|
||||
|
||||
/** FIX sorgt dafür das Icons im Menu dargestellt werden **/
|
||||
|
||||
@Override
|
||||
public boolean onMenuOpened(int featureId, Menu menu)
|
||||
{
|
||||
if(featureId == Window.FEATURE_ACTION_BAR && menu != null){
|
||||
if(menu.getClass().getSimpleName().equals("MenuBuilder")){
|
||||
try{
|
||||
Method m = menu.getClass().getDeclaredMethod(
|
||||
"setOptionalIconsVisible", Boolean.TYPE);
|
||||
m.setAccessible(true);
|
||||
m.invoke(menu, true);
|
||||
}
|
||||
catch(NoSuchMethodException e){
|
||||
Log.e(TAG, "onMenuOpened", e);
|
||||
}
|
||||
catch(Exception e){
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.onMenuOpened(featureId, menu);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
// Handle item selection
|
||||
switch (item.getItemId()) {
|
||||
case R.id.action_quit:
|
||||
moveTaskToBack(true);
|
||||
finish();
|
||||
return true;
|
||||
case R.id.action_refresh:
|
||||
updateNews();
|
||||
return true;
|
||||
case R.id.action_search:
|
||||
startSubMenueActivity("SuchenActivity");
|
||||
return true;
|
||||
case R.id.action_kategorie:
|
||||
startSubMenueActivity("KategorieActivity");
|
||||
return true;
|
||||
case R.id.action_autoren:
|
||||
startSubMenueActivity("AutorenActivity");
|
||||
return true;
|
||||
default:
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,175 @@
|
||||
package com.raataar.sprueche_hollywood;
|
||||
|
||||
import android.app.ActionBar;
|
||||
import android.app.Activity;
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.widget.EditText;
|
||||
|
||||
import com.android.volley.toolbox.ImageLoader;
|
||||
import com.raataar.sprueche_hollywood.app.AppController;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
|
||||
public class SuchenActivity extends Activity {
|
||||
// Log tag
|
||||
private static final String TAG = SuchenActivity.class.getSimpleName();
|
||||
|
||||
// Json url
|
||||
private static final String url = "http://api.raataar.de";
|
||||
private ProgressDialog pDialog;
|
||||
private String kategorie_id;
|
||||
private String searchtext;
|
||||
private String customTitle;
|
||||
private String Anzahl;
|
||||
|
||||
ImageLoader imageLoader = AppController.getInstance().getImageLoader();
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_suchen);
|
||||
|
||||
Intent intent= getIntent();
|
||||
Bundle bundlevalues = intent.getExtras();
|
||||
|
||||
this.setTitle("Suchen");
|
||||
if(bundlevalues!=null)
|
||||
{
|
||||
|
||||
kategorie_id = (String) bundlevalues.get("kategorie_id");
|
||||
searchtext = (String) bundlevalues.get("searchtext");
|
||||
customTitle=(String) bundlevalues.get("titel");
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
// changing action bar color
|
||||
getActionBar().setBackgroundDrawable(
|
||||
new ColorDrawable(Color.parseColor("#1b1b1b")));
|
||||
|
||||
|
||||
ActionBar actionBar = getActionBar();
|
||||
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void searchNow(View view) {
|
||||
// Do something in response to button
|
||||
EditText editText = (EditText) findViewById(R.id.searchtext);
|
||||
|
||||
String searchText;
|
||||
searchText=editText.getText().toString();
|
||||
searchText=searchText.replaceAll("ä", "#ae#");
|
||||
searchText=searchText.replaceAll("Ä", "#Ae#");
|
||||
searchText=searchText.replaceAll("ü","#ue#");
|
||||
searchText=searchText.replaceAll("Ü","#Ue#");
|
||||
searchText=searchText.replaceAll("Ö","#Oe#");
|
||||
searchText=searchText.replaceAll("ö","#oe#");
|
||||
searchText=searchText.replaceAll("ß","#ss#");
|
||||
startMenueActivity("SuchenByIDActivity", searchText);
|
||||
//Toast.makeText(SuchenActivity.this, "Nicht gefunden Activity ", Toast.LENGTH_SHORT).show();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
hidePDialog();
|
||||
}
|
||||
|
||||
public void startMenueActivity(String MyClass,String searchtext){
|
||||
|
||||
try {
|
||||
Intent openNewIntent = new Intent( this, Class.forName( AppController.getInstance().getPackageURL() + MyClass ) );
|
||||
openNewIntent.putExtra("searchtext", searchtext);
|
||||
startActivity( openNewIntent );
|
||||
} catch (ClassNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void hidePDialog() {
|
||||
if (pDialog != null) {
|
||||
pDialog.dismiss();
|
||||
pDialog = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
// Inflate the menu; this adds items to the action bar if it is present.
|
||||
getMenuInflater().inflate(R.menu.search_menu, menu);
|
||||
return true;
|
||||
}
|
||||
|
||||
/** FIX sorgt dafür das Icons im Menu dargestellt werden **/
|
||||
|
||||
@Override
|
||||
public boolean onMenuOpened(int featureId, Menu menu)
|
||||
{
|
||||
if(featureId == Window.FEATURE_ACTION_BAR && menu != null){
|
||||
if(menu.getClass().getSimpleName().equals("MenuBuilder")){
|
||||
try{
|
||||
Method m = menu.getClass().getDeclaredMethod(
|
||||
"setOptionalIconsVisible", Boolean.TYPE);
|
||||
m.setAccessible(true);
|
||||
m.invoke(menu, true);
|
||||
}
|
||||
catch(NoSuchMethodException e){
|
||||
Log.e(TAG, "onMenuOpened", e);
|
||||
}
|
||||
catch(Exception e){
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.onMenuOpened(featureId, menu);
|
||||
}
|
||||
|
||||
public void startSubMenueActivity(String MyClass){
|
||||
|
||||
try {
|
||||
Intent openNewIntent = new Intent( this, Class.forName( AppController.getInstance().getPackageURL() + MyClass ) );
|
||||
startActivity(openNewIntent );
|
||||
} catch (ClassNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
// Handle item selection
|
||||
switch (item.getItemId()) {
|
||||
case R.id.action_quit:
|
||||
moveTaskToBack(true);
|
||||
finish();
|
||||
return true;
|
||||
case R.id.action_kategorie:
|
||||
startSubMenueActivity("KategorieActivity");
|
||||
return true;
|
||||
case R.id.action_autoren:
|
||||
startSubMenueActivity("AutorenActivity");
|
||||
return true;
|
||||
default:
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,288 @@
|
||||
package com.raataar.sprueche_hollywood;
|
||||
|
||||
import android.app.ActionBar;
|
||||
import android.app.Activity;
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ListView;
|
||||
import com.android.volley.Response;
|
||||
import com.android.volley.VolleyError;
|
||||
import com.android.volley.VolleyLog;
|
||||
import com.android.volley.toolbox.JsonArrayRequest;
|
||||
import com.raataar.sprueche_hollywood.adater.SuchenByIDListAdapter;
|
||||
import com.raataar.sprueche_hollywood.app.AppController;
|
||||
import com.raataar.sprueche_hollywood.model.SuchenByID;
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class SuchenByIDActivity extends Activity {
|
||||
// Log tag
|
||||
private static final String TAG = SuchenByIDActivity.class.getSimpleName();
|
||||
|
||||
// Json url
|
||||
private String url = "http://api.raataar.de/sapientia-zitat-suche/";
|
||||
private ProgressDialog pDialog;
|
||||
private List<SuchenByID> suchenbyidList = new ArrayList<SuchenByID>();
|
||||
private ListView listView;
|
||||
private SuchenByIDListAdapter adapter;
|
||||
private String urlObjectId;
|
||||
private String customTitle;
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_kategorie);
|
||||
|
||||
Intent intent= getIntent();
|
||||
Bundle bundlevalues = intent.getExtras();
|
||||
|
||||
this.setTitle("Suchen");
|
||||
if(bundlevalues!=null)
|
||||
{
|
||||
urlObjectId=(String) bundlevalues.get("objectID");
|
||||
customTitle=(String) bundlevalues.get("searchtext");
|
||||
|
||||
String searchText;
|
||||
searchText=customTitle;
|
||||
searchText=searchText.replaceAll("#ae#","ä");
|
||||
searchText=searchText.replaceAll("#Ae#","Ä");
|
||||
searchText=searchText.replaceAll("#ue#","ü");
|
||||
searchText=searchText.replaceAll("#Ue#","Ü");
|
||||
searchText=searchText.replaceAll("#Oe#","Ö");
|
||||
searchText=searchText.replaceAll("#oe#","ö");
|
||||
searchText=searchText.replaceAll("#ss#","ß");
|
||||
|
||||
|
||||
|
||||
this.setTitle("Suchen nach - " + searchText);
|
||||
//Textv.setText(j);
|
||||
}
|
||||
|
||||
|
||||
listView = (ListView) findViewById(R.id.list);
|
||||
adapter = new SuchenByIDListAdapter(this, suchenbyidList);
|
||||
listView.setAdapter(adapter);
|
||||
|
||||
// changing action bar color
|
||||
getActionBar().setBackgroundDrawable(
|
||||
new ColorDrawable(Color.parseColor("#1b1b1b")));
|
||||
|
||||
|
||||
ActionBar actionBar = getActionBar();
|
||||
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
updateListView();
|
||||
|
||||
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||
|
||||
@Override
|
||||
public void onItemClick(AdapterView<?> parent, View view,
|
||||
int position, long id) {
|
||||
//Toast.makeText(MainActivity.this, "You Clicked at " + mainmenueList.get(+position).getObjectId(), Toast.LENGTH_SHORT).show();
|
||||
String mysubstring;
|
||||
if (suchenbyidList.get(+position).getZitat().length()>25){
|
||||
mysubstring=suchenbyidList.get(+position).getZitat().substring(0,25) + "...";
|
||||
}
|
||||
else{
|
||||
mysubstring=suchenbyidList.get(+position).getZitat();
|
||||
}
|
||||
|
||||
startMenueActivity(suchenbyidList.get(+position).getObjectActivity(),suchenbyidList.get(+position).getObjectId(),mysubstring);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
hidePDialog();
|
||||
}
|
||||
|
||||
|
||||
public void updateListView() {
|
||||
|
||||
pDialog = new ProgressDialog(this);
|
||||
// Showing progress dialog before making http request
|
||||
pDialog.setMessage("Lade Suchergebnisse...");
|
||||
pDialog.show();
|
||||
|
||||
|
||||
//URL anpassen
|
||||
url = url + AppController.getMD5(getApplicationInfo().loadLabel(getPackageManager()).toString());
|
||||
|
||||
// Creating volley request obj
|
||||
JsonArrayRequest menueReq = new JsonArrayRequest(url + "/" + customTitle
|
||||
, new Response.Listener<JSONArray>() {
|
||||
|
||||
@Override
|
||||
public void onResponse(JSONArray response) {
|
||||
Log.d(TAG, response.toString());
|
||||
hidePDialog();
|
||||
|
||||
//Toast.makeText(KategorieByIDActivity.this, urlObjectId, Toast.LENGTH_SHORT).show();
|
||||
//Toast.makeText(MainActivity.this, String.valueOf(response.length()), Toast.LENGTH_SHORT).show();
|
||||
|
||||
// Parsing json
|
||||
for (int i = 0; i < response.length(); i++) {
|
||||
try {
|
||||
|
||||
JSONObject obj = response.getJSONObject(i);
|
||||
SuchenByID suchenbyidlist = new SuchenByID();
|
||||
suchenbyidlist.setZitat(obj.getString("zitat"));
|
||||
suchenbyidlist.setImage(obj.getString("image"));
|
||||
suchenbyidlist.setObjectId(obj.getString("objectId"));
|
||||
suchenbyidlist.setAutoren_text(obj.getString("autoren_text"));
|
||||
suchenbyidlist.setKategorie_text(obj.getString("kategorie_text"));
|
||||
suchenbyidlist.setAutor_id(obj.getString("autor_id"));
|
||||
suchenbyidlist.setKategorie_id(obj.getString("kategorie_id"));
|
||||
suchenbyidlist.setObjectActivity(obj.getString("objectActivity"));
|
||||
|
||||
// adding movie to movies array
|
||||
suchenbyidList.add(suchenbyidlist);
|
||||
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/** Keine Ergebnisse **/
|
||||
if ( response.length()==0){
|
||||
|
||||
pDialog = new ProgressDialog(SuchenByIDActivity.this);
|
||||
// Showing progress dialog before making http request
|
||||
pDialog.setMessage("Leider keine Treffer gefunden.");
|
||||
pDialog.setCancelable(false);
|
||||
pDialog.setButton(DialogInterface.BUTTON_NEGATIVE, "Zurück", new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
|
||||
dialog.dismiss();
|
||||
finish();
|
||||
}
|
||||
});
|
||||
pDialog.show();
|
||||
|
||||
|
||||
}
|
||||
|
||||
// notifying list adapter about data changes
|
||||
// so that it renders the list view with updated data
|
||||
adapter.notifyDataSetChanged();
|
||||
}
|
||||
}, new Response.ErrorListener() {
|
||||
|
||||
@Override
|
||||
public void onErrorResponse(VolleyError error) {
|
||||
VolleyLog.d(TAG, "Error: " + error.getMessage());
|
||||
hidePDialog();
|
||||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
// Adding request to request queue
|
||||
AppController.getInstance().addToRequestQueue(menueReq);
|
||||
}
|
||||
|
||||
public void startMenueActivity(String MyClass, String objectID, String titel){
|
||||
|
||||
try {
|
||||
Intent openNewIntent = new Intent( this, Class.forName( AppController.getInstance().getPackageURL() + MyClass ) );
|
||||
//Toast.makeText(MainActivity.this, "Starte Activity " + MyClass, Toast.LENGTH_SHORT).show();
|
||||
openNewIntent.putExtra("objectID",objectID);
|
||||
openNewIntent.putExtra("titel", titel);
|
||||
startActivity(openNewIntent );
|
||||
} catch (ClassNotFoundException e) {
|
||||
//Toast.makeText(MainActivity.this, "Nicht gefunden Activity " + MyClass, Toast.LENGTH_SHORT).show();
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void startSubMenueActivity(String MyClass){
|
||||
|
||||
try {
|
||||
Intent openNewIntent = new Intent( this, Class.forName( AppController.getInstance().getPackageURL() + MyClass ) );
|
||||
startActivity(openNewIntent );
|
||||
} catch (ClassNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void hidePDialog() {
|
||||
if (pDialog != null) {
|
||||
pDialog.dismiss();
|
||||
pDialog = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
// Inflate the menu; this adds items to the action bar if it is present.
|
||||
getMenuInflater().inflate(R.menu.search_menu, menu);
|
||||
return true;
|
||||
}
|
||||
|
||||
/** FIX sorgt dafür das Icons im Menu dargestellt werden **/
|
||||
|
||||
@Override
|
||||
public boolean onMenuOpened(int featureId, Menu menu)
|
||||
{
|
||||
if(featureId == Window.FEATURE_ACTION_BAR && menu != null){
|
||||
if(menu.getClass().getSimpleName().equals("MenuBuilder")){
|
||||
try{
|
||||
Method m = menu.getClass().getDeclaredMethod(
|
||||
"setOptionalIconsVisible", Boolean.TYPE);
|
||||
m.setAccessible(true);
|
||||
m.invoke(menu, true);
|
||||
}
|
||||
catch(NoSuchMethodException e){
|
||||
Log.e(TAG, "onMenuOpened", e);
|
||||
}
|
||||
catch(Exception e){
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.onMenuOpened(featureId, menu);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
// Handle item selection
|
||||
switch (item.getItemId()) {
|
||||
case R.id.action_quit:
|
||||
moveTaskToBack(true);
|
||||
finish();
|
||||
return true;
|
||||
case R.id.action_kategorie:
|
||||
startSubMenueActivity("KategorieActivity");
|
||||
return true;
|
||||
case R.id.action_autoren:
|
||||
startSubMenueActivity("AutorenActivity");
|
||||
return true;
|
||||
default:
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,319 @@
|
||||
package com.raataar.sprueche_hollywood;
|
||||
|
||||
import android.app.ActionBar;
|
||||
import android.app.Activity;
|
||||
import android.app.ProgressDialog;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.text.Html;
|
||||
import android.text.method.LinkMovementMethod;
|
||||
import android.util.Log;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
|
||||
import android.view.Window;
|
||||
import android.widget.*;
|
||||
import com.android.volley.Response;
|
||||
import com.android.volley.VolleyError;
|
||||
import com.android.volley.VolleyLog;
|
||||
import com.android.volley.toolbox.ImageLoader;
|
||||
import com.android.volley.toolbox.JsonArrayRequest;
|
||||
import com.android.volley.toolbox.NetworkImageView;
|
||||
import com.raataar.sprueche_hollywood.app.AppController;
|
||||
import com.raataar.sprueche_hollywood.util.RoundedTransformation;
|
||||
import com.squareup.picasso.Picasso;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
|
||||
public class ZitatActivity extends Activity {
|
||||
// Log tag
|
||||
private static final String TAG = ZitatActivity.class.getSimpleName();
|
||||
|
||||
// Json url
|
||||
private String url = "http://api.raataar.de/sapientia-zitat/";
|
||||
private ProgressDialog pDialog;
|
||||
private String urlObjectId;
|
||||
private String customTitle;
|
||||
private String zitatsharetext;
|
||||
private String HTMLImageLink;
|
||||
private String HTMLAutorLink;
|
||||
|
||||
|
||||
//Intent für den Sharbutton
|
||||
private Intent shareIntent;
|
||||
|
||||
//ShareButtonProvider
|
||||
private ShareActionProvider mShareActionProvider;
|
||||
|
||||
ImageLoader imageLoader = AppController.getInstance().getImageLoader();
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_zitat);
|
||||
|
||||
Intent intent= getIntent();
|
||||
Bundle bundlevalues = intent.getExtras();
|
||||
|
||||
shareIntent = new Intent(android.content.Intent.ACTION_SEND);
|
||||
shareIntent.setType("text/plain");
|
||||
|
||||
this.setTitle("Zitat");
|
||||
if(bundlevalues!=null)
|
||||
{
|
||||
if(urlObjectId=="menue_zufall" || urlObjectId==null) {
|
||||
urlObjectId = (String) bundlevalues.get("objectID");
|
||||
}
|
||||
customTitle=(String) bundlevalues.get("titel");
|
||||
this.setTitle("Weisheit: " + customTitle);
|
||||
//Textv.setText(j);
|
||||
}
|
||||
|
||||
// changing action bar color
|
||||
getActionBar().setBackgroundDrawable(
|
||||
new ColorDrawable(Color.parseColor("#1b1b1b")));
|
||||
|
||||
|
||||
ActionBar actionBar = getActionBar();
|
||||
//actionBar.setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
pDialog = new ProgressDialog(this);
|
||||
// Showing progress dialog before making http request
|
||||
pDialog.setMessage("Lade Weisheit...");
|
||||
pDialog.show();
|
||||
|
||||
|
||||
//URL anpassen
|
||||
url = url + AppController.getMD5(getApplicationInfo().loadLabel(getPackageManager()).toString());
|
||||
|
||||
// Creating volley request obj
|
||||
JsonArrayRequest menueReq = new JsonArrayRequest(url + "/" + urlObjectId
|
||||
, new Response.Listener<JSONArray>() {
|
||||
|
||||
@Override
|
||||
public void onResponse(JSONArray response) {
|
||||
Log.d(TAG, response.toString());
|
||||
hidePDialog();
|
||||
|
||||
|
||||
// Parsing json
|
||||
for (int i = 0; i < response.length(); i++) {
|
||||
try {
|
||||
|
||||
JSONObject obj = response.getJSONObject(i);
|
||||
|
||||
|
||||
if (imageLoader == null)
|
||||
imageLoader = AppController.getInstance().getImageLoader();
|
||||
|
||||
|
||||
NetworkImageView kategorie_image = (NetworkImageView)findViewById(R.id.kategorie_image);
|
||||
|
||||
|
||||
ImageView autoren_imagepic = (ImageView)findViewById(R.id.autoren_imagepic);
|
||||
|
||||
|
||||
TextView zitat = (TextView)findViewById(R.id.zitat);
|
||||
TextView objectid = (TextView)findViewById(R.id.objectid);
|
||||
TextView autoren_id = (TextView)findViewById(R.id.autoren_id);
|
||||
TextView kategorie_id = (TextView)findViewById(R.id.kategorie_id);
|
||||
|
||||
|
||||
TextView kategorie_text = (TextView)findViewById(R.id.kategorie_text);
|
||||
TextView kategorie_beschreibung = (TextView)findViewById(R.id.kategorie_beschreibung);
|
||||
TextView autoren_text = (TextView)findViewById(R.id.autoren_text);
|
||||
TextView autoren_beschreibung = (TextView)findViewById(R.id.autoren_beschreibung);
|
||||
TextView autoren_imagequelle = (TextView)findViewById(R.id.autoren_imagequelle);
|
||||
TextView autoren_moreinfo = (TextView)findViewById(R.id.autoren_moreinfo);
|
||||
|
||||
LinearLayout autoren_infoview= (LinearLayout)findViewById(R.id.autoren_infoview);
|
||||
|
||||
kategorie_image.setImageUrl(obj.getString("kategorie_image"), imageLoader);
|
||||
|
||||
Picasso.with(getApplicationContext())
|
||||
.load(obj.getString("autor_image"))
|
||||
.transform(new RoundedTransformation(8, 0))
|
||||
.fit()
|
||||
.into(autoren_imagepic);
|
||||
|
||||
|
||||
// Zitat
|
||||
zitat.setText(obj.getString("zitat"));
|
||||
|
||||
//Zitat für SHARE-Button
|
||||
zitatsharetext=obj.getString("zitat");
|
||||
zitatsharetext=zitatsharetext + " Von " + obj.getString("autoren_text");
|
||||
|
||||
//ShareButton Content übergeben
|
||||
shareIntent.putExtra(Intent.EXTRA_SUBJECT, "");
|
||||
shareIntent.putExtra(Intent.EXTRA_TEXT, zitatsharetext);
|
||||
|
||||
autoren_text.setText("Autor: " + obj.getString("autoren_text"));
|
||||
kategorie_text.setText("Kategorie: " + obj.getString("kategorie_text"));
|
||||
|
||||
// objectid
|
||||
objectid.setText(obj.getString("objectId"));
|
||||
|
||||
autoren_id.setText(obj.getString("autor_id"));
|
||||
kategorie_id.setText(obj.getString("kategorie_id"));
|
||||
|
||||
autoren_beschreibung.setText(obj.getString("autoren_beschreibung"));
|
||||
kategorie_beschreibung.setText(obj.getString("kategorie_beschreibung"));
|
||||
|
||||
HTMLImageLink=obj.getString("autoren_imagequelle");
|
||||
HTMLAutorLink=obj.getString("autoren_wikilink");
|
||||
|
||||
autoren_imagequelle.setText(Html.fromHtml(HTMLImageLink));
|
||||
autoren_imagequelle.setMovementMethod(LinkMovementMethod.getInstance());
|
||||
autoren_moreinfo.setText(Html.fromHtml(HTMLAutorLink));
|
||||
autoren_moreinfo.setMovementMethod(LinkMovementMethod.getInstance());
|
||||
|
||||
if (HTMLAutorLink.length()<3){
|
||||
|
||||
autoren_infoview.setVisibility(View.GONE);
|
||||
//autoren_infoview
|
||||
|
||||
}
|
||||
|
||||
urlObjectId=obj.getString("objectId");
|
||||
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}, new Response.ErrorListener() {
|
||||
|
||||
@Override
|
||||
public void onErrorResponse(VolleyError error) {
|
||||
VolleyLog.d(TAG, "Error: " + error.getMessage());
|
||||
hidePDialog();
|
||||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
// Adding request to request queue
|
||||
AppController.getInstance().addToRequestQueue(menueReq);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void showImage(View v)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
hidePDialog();
|
||||
}
|
||||
|
||||
public void startMenueActivity(String MyClass){
|
||||
|
||||
try {
|
||||
Intent openNewIntent = new Intent( this, Class.forName( AppController.getInstance().getPackageURL() + MyClass ) );
|
||||
startActivity( openNewIntent );
|
||||
} catch (ClassNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void hidePDialog() {
|
||||
if (pDialog != null) {
|
||||
pDialog.dismiss();
|
||||
pDialog = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void startSubMenueActivity(String MyClass){
|
||||
|
||||
try {
|
||||
Intent openNewIntent = new Intent( this, Class.forName( AppController.getInstance().getPackageURL() + MyClass ) );
|
||||
startActivity(openNewIntent );
|
||||
} catch (ClassNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
// Inflate the menu; this adds items to the action bar if it is present.
|
||||
getMenuInflater().inflate(R.menu.zitat_menu, menu);
|
||||
|
||||
/** Share-Button inalisieren */
|
||||
mShareActionProvider = (ShareActionProvider) menu.findItem(R.id.menu_item_share).getActionProvider();
|
||||
mShareActionProvider.setShareIntent(shareIntent);
|
||||
mShareActionProvider.onCreateActionView();
|
||||
/** Sharebutton-Ini-ende **/
|
||||
|
||||
return super.onCreateOptionsMenu(menu);
|
||||
}
|
||||
|
||||
/** FIX sorgt dafür das Icons im Menu dargestellt werden **/
|
||||
|
||||
@Override
|
||||
public boolean onMenuOpened(int featureId, Menu menu)
|
||||
{
|
||||
if(featureId == Window.FEATURE_ACTION_BAR && menu != null){
|
||||
if(menu.getClass().getSimpleName().equals("MenuBuilder")){
|
||||
try{
|
||||
Method m = menu.getClass().getDeclaredMethod(
|
||||
"setOptionalIconsVisible", Boolean.TYPE);
|
||||
m.setAccessible(true);
|
||||
m.invoke(menu, true);
|
||||
}
|
||||
catch(NoSuchMethodException e){
|
||||
Log.e(TAG, "onMenuOpened", e);
|
||||
}
|
||||
catch(Exception e){
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.onMenuOpened(featureId, menu);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
// Handle item selection
|
||||
switch (item.getItemId()) {
|
||||
case R.id.action_quit:
|
||||
moveTaskToBack(true);
|
||||
finish();
|
||||
return true;
|
||||
case R.id.action_kategorie:
|
||||
startSubMenueActivity("KategorieActivity");
|
||||
return true;
|
||||
case R.id.action_autoren:
|
||||
startSubMenueActivity("AutorenActivity");
|
||||
return true;
|
||||
default:
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,321 @@
|
||||
package com.raataar.sprueche_hollywood;
|
||||
|
||||
import android.app.ActionBar;
|
||||
import android.app.Activity;
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.text.Html;
|
||||
import android.text.method.LinkMovementMethod;
|
||||
import android.util.Log;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.ShareActionProvider;
|
||||
import android.widget.TextView;
|
||||
import com.android.volley.Response;
|
||||
import com.android.volley.VolleyError;
|
||||
import com.android.volley.VolleyLog;
|
||||
import com.android.volley.toolbox.ImageLoader;
|
||||
import com.android.volley.toolbox.JsonArrayRequest;
|
||||
import com.android.volley.toolbox.NetworkImageView;
|
||||
import com.raataar.sprueche_hollywood.app.AppController;
|
||||
import com.raataar.sprueche_hollywood.util.RoundedTransformation;
|
||||
import com.squareup.picasso.Picasso;
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
|
||||
public class ZufallZitatActivity extends Activity {
|
||||
// Log tag
|
||||
private static final String TAG = ZufallZitatActivity.class.getSimpleName();
|
||||
|
||||
// Json url
|
||||
private String url = "http://api.raataar.de/sapientia-zitat/";
|
||||
private ProgressDialog pDialog;
|
||||
private String urlObjectId;
|
||||
private String customTitle;
|
||||
private String zitatsharetext;
|
||||
private String HTMLImageLink;
|
||||
private String HTMLAutorLink;
|
||||
|
||||
|
||||
//Intent für den Sharbutton
|
||||
private Intent shareIntent;
|
||||
|
||||
//ShareButtonProvider
|
||||
private ShareActionProvider mShareActionProvider;
|
||||
|
||||
ImageLoader imageLoader = AppController.getInstance().getImageLoader();
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_zufallzitat);
|
||||
|
||||
Intent intent= getIntent();
|
||||
Bundle bundlevalues = intent.getExtras();
|
||||
|
||||
shareIntent = new Intent(Intent.ACTION_SEND);
|
||||
shareIntent.setType("text/plain");
|
||||
|
||||
this.setTitle("Zitat");
|
||||
if(bundlevalues!=null)
|
||||
{
|
||||
if(urlObjectId=="menue_zufall" || urlObjectId==null) {
|
||||
urlObjectId = (String) bundlevalues.get("objectID");
|
||||
}
|
||||
customTitle=(String) bundlevalues.get("titel");
|
||||
this.setTitle("Weisheit: " + customTitle);
|
||||
//Textv.setText(j);
|
||||
}
|
||||
|
||||
// changing action bar color
|
||||
getActionBar().setBackgroundDrawable(
|
||||
new ColorDrawable(Color.parseColor("#1b1b1b")));
|
||||
|
||||
|
||||
ActionBar actionBar = getActionBar();
|
||||
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
pDialog = new ProgressDialog(this);
|
||||
// Showing progress dialog before making http request
|
||||
pDialog.setMessage("Lade Weisheit...");
|
||||
pDialog.show();
|
||||
|
||||
|
||||
//URL anpassen
|
||||
url = url + AppController.getMD5(getApplicationInfo().loadLabel(getPackageManager()).toString()) + "/zitat";
|
||||
|
||||
// Creating volley request obj
|
||||
JsonArrayRequest menueReq = new JsonArrayRequest(url
|
||||
, new Response.Listener<JSONArray>() {
|
||||
|
||||
@Override
|
||||
public void onResponse(JSONArray response) {
|
||||
Log.d(TAG, response.toString());
|
||||
hidePDialog();
|
||||
|
||||
|
||||
// Parsing json
|
||||
for (int i = 0; i < response.length(); i++) {
|
||||
try {
|
||||
|
||||
JSONObject obj = response.getJSONObject(i);
|
||||
|
||||
|
||||
if (imageLoader == null)
|
||||
imageLoader = AppController.getInstance().getImageLoader();
|
||||
|
||||
|
||||
NetworkImageView kategorie_image = (NetworkImageView)findViewById(R.id.kategorie_image);
|
||||
ImageView autoren_imagepic = (ImageView)findViewById(R.id.autoren_imagepic);
|
||||
|
||||
|
||||
TextView zitat = (TextView)findViewById(R.id.zitat);
|
||||
TextView objectid = (TextView)findViewById(R.id.objectid);
|
||||
TextView autoren_id = (TextView)findViewById(R.id.autoren_id);
|
||||
TextView kategorie_id = (TextView)findViewById(R.id.kategorie_id);
|
||||
|
||||
|
||||
TextView kategorie_text = (TextView)findViewById(R.id.kategorie_text);
|
||||
TextView kategorie_beschreibung = (TextView)findViewById(R.id.kategorie_beschreibung);
|
||||
TextView autoren_text = (TextView)findViewById(R.id.autoren_text);
|
||||
TextView autoren_beschreibung = (TextView)findViewById(R.id.autoren_beschreibung);
|
||||
TextView autoren_imagequelle = (TextView)findViewById(R.id.autoren_imagequelle);
|
||||
TextView autoren_moreinfo = (TextView)findViewById(R.id.autoren_moreinfo);
|
||||
|
||||
LinearLayout autoren_infoview= (LinearLayout)findViewById(R.id.autoren_infoview);
|
||||
|
||||
kategorie_image.setImageUrl(obj.getString("kategorie_image"), imageLoader);
|
||||
|
||||
Picasso.with(getApplicationContext())
|
||||
.load(obj.getString("autor_image"))
|
||||
.transform(new RoundedTransformation(8, 0))
|
||||
.fit()
|
||||
.into(autoren_imagepic);
|
||||
|
||||
|
||||
// Zitat
|
||||
zitat.setText(obj.getString("zitat"));
|
||||
|
||||
//Zitat für SHARE-Button
|
||||
zitatsharetext=obj.getString("zitat");
|
||||
zitatsharetext=zitatsharetext + " Von " + obj.getString("autoren_text");
|
||||
|
||||
//ShareButton Content übergeben
|
||||
shareIntent.putExtra(Intent.EXTRA_SUBJECT, "");
|
||||
shareIntent.putExtra(Intent.EXTRA_TEXT, zitatsharetext);
|
||||
|
||||
autoren_text.setText("Autor: " + obj.getString("autoren_text"));
|
||||
kategorie_text.setText("Kategorie: " + obj.getString("kategorie_text"));
|
||||
|
||||
// objectid
|
||||
objectid.setText(obj.getString("objectId"));
|
||||
|
||||
autoren_id.setText(obj.getString("autor_id"));
|
||||
kategorie_id.setText(obj.getString("kategorie_id"));
|
||||
|
||||
autoren_beschreibung.setText(obj.getString("autoren_beschreibung"));
|
||||
kategorie_beschreibung.setText(obj.getString("kategorie_beschreibung"));
|
||||
|
||||
HTMLImageLink=obj.getString("autoren_imagequelle");
|
||||
HTMLAutorLink=obj.getString("autoren_wikilink");
|
||||
|
||||
autoren_imagequelle.setText(Html.fromHtml(HTMLImageLink));
|
||||
autoren_imagequelle.setMovementMethod(LinkMovementMethod.getInstance());
|
||||
autoren_moreinfo.setText(Html.fromHtml(HTMLAutorLink));
|
||||
autoren_moreinfo.setMovementMethod(LinkMovementMethod.getInstance());
|
||||
|
||||
|
||||
if (HTMLAutorLink.length()<3){
|
||||
|
||||
autoren_infoview.setVisibility(View.GONE);
|
||||
//autoren_infoview
|
||||
|
||||
}
|
||||
|
||||
|
||||
urlObjectId=obj.getString("objectId");
|
||||
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}, new Response.ErrorListener() {
|
||||
|
||||
@Override
|
||||
public void onErrorResponse(VolleyError error) {
|
||||
VolleyLog.d(TAG, "Error: " + error.getMessage());
|
||||
hidePDialog();
|
||||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
// Adding request to request queue
|
||||
AppController.getInstance().addToRequestQueue(menueReq);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void loadNextZitat(View v)
|
||||
{
|
||||
startMenueActivity("ZufallZitatActivity");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
hidePDialog();
|
||||
}
|
||||
|
||||
public void startMenueActivity(String MyClass){
|
||||
|
||||
try {
|
||||
Intent openNewIntent = new Intent( this, Class.forName( AppController.getInstance().getPackageURL() + MyClass ) );
|
||||
openNewIntent.putExtra("objectID","menue_zufall");
|
||||
openNewIntent.putExtra("titel","Weisheit: Zufall");
|
||||
startActivity( openNewIntent );
|
||||
} catch (ClassNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void hidePDialog() {
|
||||
if (pDialog != null) {
|
||||
pDialog.dismiss();
|
||||
pDialog = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void startSubMenueActivity(String MyClass){
|
||||
|
||||
try {
|
||||
Intent openNewIntent = new Intent( this, Class.forName( AppController.getInstance().getPackageURL() + MyClass ) );
|
||||
startActivity(openNewIntent );
|
||||
} catch (ClassNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
// Inflate the menu; this adds items to the action bar if it is present.
|
||||
getMenuInflater().inflate(R.menu.zitat_menu, menu);
|
||||
|
||||
/** Share-Button inalisieren */
|
||||
mShareActionProvider = (ShareActionProvider) menu.findItem(R.id.menu_item_share).getActionProvider();
|
||||
mShareActionProvider.setShareIntent(shareIntent);
|
||||
mShareActionProvider.onCreateActionView();
|
||||
/** Sharebutton-Ini-ende **/
|
||||
|
||||
return super.onCreateOptionsMenu(menu);
|
||||
}
|
||||
|
||||
/** FIX sorgt dafür das Icons im Menu dargestellt werden **/
|
||||
|
||||
@Override
|
||||
public boolean onMenuOpened(int featureId, Menu menu)
|
||||
{
|
||||
if(featureId == Window.FEATURE_ACTION_BAR && menu != null){
|
||||
if(menu.getClass().getSimpleName().equals("MenuBuilder")){
|
||||
try{
|
||||
Method m = menu.getClass().getDeclaredMethod(
|
||||
"setOptionalIconsVisible", Boolean.TYPE);
|
||||
m.setAccessible(true);
|
||||
m.invoke(menu, true);
|
||||
}
|
||||
catch(NoSuchMethodException e){
|
||||
Log.e(TAG, "onMenuOpened", e);
|
||||
}
|
||||
catch(Exception e){
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.onMenuOpened(featureId, menu);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
// Handle item selection
|
||||
switch (item.getItemId()) {
|
||||
case R.id.action_quit:
|
||||
moveTaskToBack(true);
|
||||
finish();
|
||||
return true;
|
||||
case R.id.action_kategorie:
|
||||
startSubMenueActivity("KategorieActivity");
|
||||
return true;
|
||||
case R.id.action_autoren:
|
||||
startSubMenueActivity("AutorenActivity");
|
||||
return true;
|
||||
default:
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.raataar.sprueche_hollywood.adater;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.BaseAdapter;
|
||||
import android.widget.TextView;
|
||||
import com.android.volley.toolbox.ImageLoader;
|
||||
import com.android.volley.toolbox.NetworkImageView;
|
||||
import com.raataar.sprueche_hollywood.R;
|
||||
import com.raataar.sprueche_hollywood.app.AppController;
|
||||
import com.raataar.sprueche_hollywood.model.AutorenByID;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class AutorenByIDListAdapter extends BaseAdapter {
|
||||
private Activity activity;
|
||||
private LayoutInflater inflater;
|
||||
private List<AutorenByID> autorenItems;
|
||||
ImageLoader imageLoader = AppController.getInstance().getImageLoader();
|
||||
|
||||
public AutorenByIDListAdapter(Activity activity, List<AutorenByID> autorenItems) {
|
||||
this.activity = activity;
|
||||
this.autorenItems = autorenItems;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return autorenItems.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getItem(int location) {
|
||||
return autorenItems.get(location);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getItemId(int position) {
|
||||
return position;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
|
||||
if (inflater == null)
|
||||
inflater = (LayoutInflater) activity
|
||||
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||
if (convertView == null)
|
||||
convertView = inflater.inflate(R.layout.list_autorenbyid, null);
|
||||
|
||||
if (imageLoader == null)
|
||||
imageLoader = AppController.getInstance().getImageLoader();
|
||||
NetworkImageView thumbNail = (NetworkImageView) convertView
|
||||
.findViewById(R.id.thumbnail);
|
||||
TextView zitat = (TextView) convertView.findViewById(R.id.zitat);
|
||||
TextView objectid = (TextView) convertView.findViewById(R.id.objectid);
|
||||
TextView zitatfooter = (TextView) convertView.findViewById(R.id.zitatfooter);
|
||||
TextView autoren_id = (TextView) convertView.findViewById(R.id.autoren_id);
|
||||
TextView kategorie_id = (TextView) convertView.findViewById(R.id.kategorie_id);
|
||||
|
||||
|
||||
// getting movie data for the row
|
||||
AutorenByID m = autorenItems.get(position);
|
||||
|
||||
// thumbnail image
|
||||
thumbNail.setImageUrl(m.getImage(), imageLoader);
|
||||
|
||||
// Zitat
|
||||
zitat.setText(m.getZitat());
|
||||
|
||||
// Zitatfooter
|
||||
zitatfooter.setText("Kategorie: " + m.getKategorie_text());
|
||||
|
||||
// objectid
|
||||
objectid.setText(m.getObjectId());
|
||||
|
||||
autoren_id.setText(m.getAutor_id());
|
||||
kategorie_id.setText(m.getKategorie_id());
|
||||
|
||||
return convertView;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package com.raataar.sprueche_hollywood.adater;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.BaseAdapter;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.android.volley.toolbox.ImageLoader;
|
||||
import com.raataar.sprueche_hollywood.R;
|
||||
import com.raataar.sprueche_hollywood.app.AppController;
|
||||
import com.raataar.sprueche_hollywood.model.Autoren;
|
||||
import com.raataar.sprueche_hollywood.util.RoundedTransformation;
|
||||
import com.squareup.picasso.Picasso;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class AutorenListAdapter extends BaseAdapter {
|
||||
private Activity activity;
|
||||
private LayoutInflater inflater;
|
||||
private List<Autoren> autorenItems;
|
||||
ImageLoader imageLoader = AppController.getInstance().getImageLoader();
|
||||
|
||||
public AutorenListAdapter(Activity activity, List<Autoren> kategorieItems) {
|
||||
this.activity = activity;
|
||||
this.autorenItems = kategorieItems;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return autorenItems.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getItem(int location) {
|
||||
return autorenItems.get(location);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getItemId(int position) {
|
||||
return position;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
|
||||
if (inflater == null)
|
||||
inflater = (LayoutInflater) activity
|
||||
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||
if (convertView == null)
|
||||
convertView = inflater.inflate(R.layout.list_autoren, null);
|
||||
|
||||
if (imageLoader == null)
|
||||
imageLoader = AppController.getInstance().getImageLoader();
|
||||
|
||||
|
||||
ImageView thumbnail = (ImageView) convertView.findViewById(R.id.thumbnail);
|
||||
|
||||
TextView title = (TextView) convertView.findViewById(R.id.title);
|
||||
TextView objectid = (TextView) convertView.findViewById(R.id.objectid);
|
||||
TextView anzahl = (TextView) convertView.findViewById(R.id.anzahl);
|
||||
TextView beschreibung = (TextView) convertView.findViewById(R.id.beschreibung);
|
||||
|
||||
|
||||
// getting movie data for the row
|
||||
Autoren m = autorenItems.get(position);
|
||||
|
||||
|
||||
Picasso.with(this.activity)
|
||||
.load(m.getImage())
|
||||
.transform(new RoundedTransformation(8, 0))
|
||||
.fit()
|
||||
.into(thumbnail);
|
||||
|
||||
// title
|
||||
title.setText(m.getTitle());
|
||||
|
||||
// anzahl
|
||||
anzahl.setText("Erfasste Weisheiten: " + String.valueOf(m.getAnzahl()));
|
||||
|
||||
// objectid
|
||||
objectid.setText(m.getObjectId());
|
||||
|
||||
beschreibung.setText(m.getBeschreibung());
|
||||
|
||||
return convertView;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
package com.raataar.sprueche_hollywood.adater;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.BaseAdapter;
|
||||
import android.widget.TextView;
|
||||
import com.android.volley.toolbox.ImageLoader;
|
||||
import com.android.volley.toolbox.NetworkImageView;
|
||||
import com.raataar.sprueche_hollywood.R;
|
||||
import com.raataar.sprueche_hollywood.app.AppController;
|
||||
import com.raataar.sprueche_hollywood.model.Movie;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class CustomListAdapter extends BaseAdapter {
|
||||
private Activity activity;
|
||||
private LayoutInflater inflater;
|
||||
private List<Movie> movieItems;
|
||||
ImageLoader imageLoader = AppController.getInstance().getImageLoader();
|
||||
|
||||
public CustomListAdapter(Activity activity, List<Movie> movieItems) {
|
||||
this.activity = activity;
|
||||
this.movieItems = movieItems;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return movieItems.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getItem(int location) {
|
||||
return movieItems.get(location);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getItemId(int position) {
|
||||
return position;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
|
||||
if (inflater == null)
|
||||
inflater = (LayoutInflater) activity
|
||||
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||
if (convertView == null)
|
||||
convertView = inflater.inflate(R.layout.list_row, null);
|
||||
|
||||
if (imageLoader == null)
|
||||
imageLoader = AppController.getInstance().getImageLoader();
|
||||
NetworkImageView thumbNail = (NetworkImageView) convertView
|
||||
.findViewById(R.id.thumbnail);
|
||||
TextView title = (TextView) convertView.findViewById(R.id.title);
|
||||
TextView rating = (TextView) convertView.findViewById(R.id.rating);
|
||||
TextView genre = (TextView) convertView.findViewById(R.id.genre);
|
||||
TextView year = (TextView) convertView.findViewById(R.id.releaseYear);
|
||||
|
||||
// getting movie data for the row
|
||||
Movie m = movieItems.get(position);
|
||||
|
||||
// thumbnail image
|
||||
thumbNail.setImageUrl(m.getThumbnailUrl(), imageLoader);
|
||||
|
||||
// title
|
||||
title.setText(m.getTitle());
|
||||
|
||||
// rating
|
||||
rating.setText("Rating: " + String.valueOf(m.getRating()));
|
||||
|
||||
// genre
|
||||
String genreStr = "";
|
||||
for (String str : m.getGenre()) {
|
||||
genreStr += str + ", ";
|
||||
}
|
||||
genreStr = genreStr.length() > 0 ? genreStr.substring(0,
|
||||
genreStr.length() - 2) : genreStr;
|
||||
genre.setText(genreStr);
|
||||
|
||||
// release year
|
||||
year.setText(String.valueOf(m.getYear()));
|
||||
|
||||
return convertView;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.raataar.sprueche_hollywood.adater;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.BaseAdapter;
|
||||
import android.widget.TextView;
|
||||
import com.android.volley.toolbox.ImageLoader;
|
||||
import com.android.volley.toolbox.NetworkImageView;
|
||||
import com.raataar.sprueche_hollywood.R;
|
||||
import com.raataar.sprueche_hollywood.app.AppController;
|
||||
import com.raataar.sprueche_hollywood.model.KategorieByID;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class KategorieByIDListAdapter extends BaseAdapter {
|
||||
private Activity activity;
|
||||
private LayoutInflater inflater;
|
||||
private List<KategorieByID> kategorieItems;
|
||||
ImageLoader imageLoader = AppController.getInstance().getImageLoader();
|
||||
|
||||
public KategorieByIDListAdapter(Activity activity, List<KategorieByID> kategorieItems) {
|
||||
this.activity = activity;
|
||||
this.kategorieItems = kategorieItems;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return kategorieItems.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getItem(int location) {
|
||||
return kategorieItems.get(location);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getItemId(int position) {
|
||||
return position;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
|
||||
if (inflater == null)
|
||||
inflater = (LayoutInflater) activity
|
||||
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||
if (convertView == null)
|
||||
convertView = inflater.inflate(R.layout.list_kategoriebyid, null);
|
||||
|
||||
if (imageLoader == null)
|
||||
imageLoader = AppController.getInstance().getImageLoader();
|
||||
NetworkImageView thumbNail = (NetworkImageView) convertView
|
||||
.findViewById(R.id.thumbnail);
|
||||
TextView zitat = (TextView) convertView.findViewById(R.id.zitat);
|
||||
TextView objectid = (TextView) convertView.findViewById(R.id.objectid);
|
||||
TextView zitatfooter = (TextView) convertView.findViewById(R.id.zitatfooter);
|
||||
TextView autoren_id = (TextView) convertView.findViewById(R.id.autoren_id);
|
||||
TextView kategorie_id = (TextView) convertView.findViewById(R.id.kategorie_id);
|
||||
|
||||
|
||||
// getting movie data for the row
|
||||
KategorieByID m = kategorieItems.get(position);
|
||||
|
||||
// thumbnail image
|
||||
thumbNail.setImageUrl(m.getImage(), imageLoader);
|
||||
|
||||
// Zitat
|
||||
zitat.setText(m.getZitat());
|
||||
|
||||
// Zitatfooter
|
||||
zitatfooter.setText("Autor: " + m.getAutoren_text());
|
||||
|
||||
// objectid
|
||||
objectid.setText(m.getObjectId());
|
||||
|
||||
autoren_id.setText(m.getAutor_id());
|
||||
kategorie_id.setText(m.getKategorie_id());
|
||||
|
||||
return convertView;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
package com.raataar.sprueche_hollywood.adater;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.BaseAdapter;
|
||||
import android.widget.TextView;
|
||||
import com.android.volley.toolbox.ImageLoader;
|
||||
import com.android.volley.toolbox.NetworkImageView;
|
||||
import com.raataar.sprueche_hollywood.R;
|
||||
import com.raataar.sprueche_hollywood.app.AppController;
|
||||
import com.raataar.sprueche_hollywood.model.Kategorie;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class KategorieListAdapter extends BaseAdapter {
|
||||
private Activity activity;
|
||||
private LayoutInflater inflater;
|
||||
private List<Kategorie> kategorieItems;
|
||||
ImageLoader imageLoader = AppController.getInstance().getImageLoader();
|
||||
|
||||
public KategorieListAdapter(Activity activity, List<Kategorie> kategorieItems) {
|
||||
this.activity = activity;
|
||||
this.kategorieItems = kategorieItems;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return kategorieItems.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getItem(int location) {
|
||||
return kategorieItems.get(location);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getItemId(int position) {
|
||||
return position;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
|
||||
if (inflater == null)
|
||||
inflater = (LayoutInflater) activity
|
||||
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||
if (convertView == null)
|
||||
convertView = inflater.inflate(R.layout.list_kategorie, null);
|
||||
|
||||
if (imageLoader == null)
|
||||
imageLoader = AppController.getInstance().getImageLoader();
|
||||
NetworkImageView thumbNail = (NetworkImageView) convertView
|
||||
.findViewById(R.id.thumbnail);
|
||||
TextView title = (TextView) convertView.findViewById(R.id.title);
|
||||
TextView objectid = (TextView) convertView.findViewById(R.id.objectid);
|
||||
TextView anzahl = (TextView) convertView.findViewById(R.id.anzahl);
|
||||
TextView beschreibung = (TextView) convertView.findViewById(R.id.beschreibung);
|
||||
|
||||
|
||||
// getting movie data for the row
|
||||
Kategorie m = kategorieItems.get(position);
|
||||
|
||||
// thumbnail image
|
||||
thumbNail.setImageUrl(m.getImage(), imageLoader);
|
||||
|
||||
// title
|
||||
title.setText(m.getTitle());
|
||||
|
||||
// anzahl
|
||||
anzahl.setText("Erfasste Weisheiten: " + String.valueOf(m.getAnzahl()));
|
||||
|
||||
// objectid
|
||||
objectid.setText(m.getObjectId());
|
||||
|
||||
beschreibung.setText(m.getBeschreibung());
|
||||
|
||||
return convertView;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
package com.raataar.sprueche_hollywood.adater;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.BaseAdapter;
|
||||
import android.widget.TextView;
|
||||
import com.android.volley.toolbox.ImageLoader;
|
||||
import com.android.volley.toolbox.NetworkImageView;
|
||||
import com.raataar.sprueche_hollywood.R;
|
||||
import com.raataar.sprueche_hollywood.app.AppController;
|
||||
import com.raataar.sprueche_hollywood.model.Mainmenue;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class MainmenueListAdapter extends BaseAdapter {
|
||||
private Activity activity;
|
||||
private LayoutInflater inflater;
|
||||
private List<Mainmenue> mainmenueItems;
|
||||
ImageLoader imageLoader = AppController.getInstance().getImageLoader();
|
||||
|
||||
public MainmenueListAdapter(Activity activity, List<Mainmenue> mainmenueItems) {
|
||||
this.activity = activity;
|
||||
this.mainmenueItems = mainmenueItems;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return mainmenueItems.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getItem(int location) {
|
||||
return mainmenueItems.get(location);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getItemId(int position) {
|
||||
return position;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
|
||||
if (inflater == null)
|
||||
inflater = (LayoutInflater) activity
|
||||
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||
if (convertView == null)
|
||||
convertView = inflater.inflate(R.layout.list_mainmenue, null);
|
||||
|
||||
if (imageLoader == null)
|
||||
imageLoader = AppController.getInstance().getImageLoader();
|
||||
NetworkImageView thumbNail = (NetworkImageView) convertView
|
||||
.findViewById(R.id.thumbnail);
|
||||
TextView title = (TextView) convertView.findViewById(R.id.title);
|
||||
TextView objectid = (TextView) convertView.findViewById(R.id.objectid);
|
||||
TextView anzahl = (TextView) convertView.findViewById(R.id.anzahl);
|
||||
TextView beschreibung = (TextView) convertView.findViewById(R.id.beschreibung);
|
||||
|
||||
|
||||
// getting movie data for the row
|
||||
Mainmenue m = mainmenueItems.get(position);
|
||||
|
||||
// thumbnail image
|
||||
thumbNail.setImageUrl(m.getImage(), imageLoader);
|
||||
|
||||
// title
|
||||
title.setText(m.getTitle());
|
||||
|
||||
// anzahl
|
||||
anzahl.setText("Anzahl: " + String.valueOf(m.getAnzahl()));
|
||||
|
||||
// objectid
|
||||
objectid.setText(m.getObjectId());
|
||||
|
||||
beschreibung.setText(m.getBeschreibung());
|
||||
|
||||
return convertView;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.raataar.sprueche_hollywood.adater;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.BaseAdapter;
|
||||
import android.widget.TextView;
|
||||
import com.android.volley.toolbox.ImageLoader;
|
||||
import com.android.volley.toolbox.NetworkImageView;
|
||||
import com.raataar.sprueche_hollywood.R;
|
||||
import com.raataar.sprueche_hollywood.app.AppController;
|
||||
import com.raataar.sprueche_hollywood.model.SuchenByID;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class SuchenByIDListAdapter extends BaseAdapter {
|
||||
private Activity activity;
|
||||
private LayoutInflater inflater;
|
||||
private List<SuchenByID> suchenItems;
|
||||
ImageLoader imageLoader = AppController.getInstance().getImageLoader();
|
||||
|
||||
public SuchenByIDListAdapter(Activity activity, List<SuchenByID> suchenItems) {
|
||||
this.activity = activity;
|
||||
this.suchenItems = suchenItems;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return suchenItems.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getItem(int location) {
|
||||
return suchenItems.get(location);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getItemId(int position) {
|
||||
return position;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
|
||||
if (inflater == null)
|
||||
inflater = (LayoutInflater) activity
|
||||
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||
if (convertView == null)
|
||||
convertView = inflater.inflate(R.layout.list_kategoriebyid, null);
|
||||
|
||||
if (imageLoader == null)
|
||||
imageLoader = AppController.getInstance().getImageLoader();
|
||||
NetworkImageView thumbNail = (NetworkImageView) convertView
|
||||
.findViewById(R.id.thumbnail);
|
||||
TextView zitat = (TextView) convertView.findViewById(R.id.zitat);
|
||||
TextView objectid = (TextView) convertView.findViewById(R.id.objectid);
|
||||
TextView zitatfooter = (TextView) convertView.findViewById(R.id.zitatfooter);
|
||||
TextView autoren_id = (TextView) convertView.findViewById(R.id.autoren_id);
|
||||
TextView kategorie_id = (TextView) convertView.findViewById(R.id.kategorie_id);
|
||||
|
||||
|
||||
// getting movie data for the row
|
||||
SuchenByID m = suchenItems.get(position);
|
||||
|
||||
// thumbnail image
|
||||
thumbNail.setImageUrl(m.getImage(), imageLoader);
|
||||
|
||||
// Zitat
|
||||
zitat.setText(m.getZitat());
|
||||
|
||||
// Zitatfooter
|
||||
zitatfooter.setText("Autor: " + m.getAutoren_text() + " / Kat.: " + m.getKategorie_text());
|
||||
|
||||
// objectid
|
||||
objectid.setText(m.getObjectId());
|
||||
|
||||
autoren_id.setText(m.getAutor_id());
|
||||
kategorie_id.setText(m.getKategorie_id());
|
||||
|
||||
return convertView;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
package com.raataar.sprueche_hollywood.app;
|
||||
|
||||
import android.app.Application;
|
||||
import android.text.TextUtils;
|
||||
import com.android.volley.Request;
|
||||
import com.android.volley.RequestQueue;
|
||||
import com.android.volley.toolbox.ImageLoader;
|
||||
import com.android.volley.toolbox.Volley;
|
||||
import com.raataar.sprueche_hollywood.util.LruBitmapCache;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
|
||||
public class AppController extends Application {
|
||||
|
||||
public static final String TAG = AppController.class.getSimpleName();
|
||||
|
||||
private RequestQueue mRequestQueue;
|
||||
private ImageLoader mImageLoader;
|
||||
|
||||
private static AppController mInstance;
|
||||
|
||||
//Application Global-Vars :) by C.H.
|
||||
private String packageURL = "com.raataar.sprueche_hollywood.";
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
mInstance = this;
|
||||
}
|
||||
|
||||
public static synchronized AppController getInstance() {
|
||||
return mInstance;
|
||||
}
|
||||
|
||||
public RequestQueue getRequestQueue() {
|
||||
if (mRequestQueue == null) {
|
||||
mRequestQueue = Volley.newRequestQueue(getApplicationContext());
|
||||
}
|
||||
|
||||
return mRequestQueue;
|
||||
}
|
||||
|
||||
public ImageLoader getImageLoader() {
|
||||
getRequestQueue();
|
||||
if (mImageLoader == null) {
|
||||
mImageLoader = new ImageLoader(this.mRequestQueue,
|
||||
new LruBitmapCache());
|
||||
}
|
||||
return this.mImageLoader;
|
||||
}
|
||||
|
||||
public <T> void addToRequestQueue(Request<T> req, String tag) {
|
||||
// set the default tag if tag is empty
|
||||
req.setTag(TextUtils.isEmpty(tag) ? TAG : tag);
|
||||
getRequestQueue().add(req);
|
||||
}
|
||||
|
||||
public <T> void addToRequestQueue(Request<T> req) {
|
||||
req.setTag(TAG);
|
||||
getRequestQueue().add(req);
|
||||
}
|
||||
|
||||
public void cancelPendingRequests(Object tag) {
|
||||
if (mRequestQueue != null) {
|
||||
mRequestQueue.cancelAll(tag);
|
||||
}
|
||||
}
|
||||
|
||||
public String getPackageURL(){
|
||||
return packageURL;
|
||||
}
|
||||
|
||||
public static String getMD5(String toMd5){
|
||||
|
||||
MessageDigest md = null;
|
||||
String digest = null;
|
||||
try {
|
||||
md = MessageDigest.getInstance("MD5");
|
||||
|
||||
byte[] hash = md.digest(toMd5.getBytes("UTF-8")); //converting byte array to Hexadecimal String
|
||||
StringBuilder sb = new StringBuilder(2*hash.length);
|
||||
|
||||
for(byte b : hash){
|
||||
sb.append(String.format("%02x", b&0xff));
|
||||
}
|
||||
|
||||
digest = sb.toString();
|
||||
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
e.printStackTrace();
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return digest;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.raataar.sprueche_hollywood.model;
|
||||
|
||||
public class Autoren {
|
||||
private String title;
|
||||
private String image;
|
||||
private String objectId;
|
||||
private String anzahl;
|
||||
private String beschreibung;
|
||||
private String objectActivity;
|
||||
|
||||
public Autoren() {
|
||||
}
|
||||
|
||||
public Autoren(String title, String image, String objectId, String anzahl, String beschreibung, String objectActivity) {
|
||||
this.title = title;
|
||||
this.image = image;
|
||||
this.objectId = objectId;
|
||||
this.anzahl = anzahl;
|
||||
this.beschreibung = beschreibung;
|
||||
this.objectActivity = objectActivity;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getImage() {
|
||||
return image;
|
||||
}
|
||||
|
||||
public void setImage(String image) {
|
||||
this.image = image;
|
||||
}
|
||||
|
||||
public String getObjectId() {
|
||||
return this.objectId;
|
||||
}
|
||||
|
||||
public void setObjectId(String objectId) {
|
||||
this.objectId = objectId;
|
||||
}
|
||||
|
||||
public String getAnzahl() {
|
||||
return anzahl;
|
||||
}
|
||||
|
||||
public void setAnzahl(String anzahl) {
|
||||
this.anzahl = anzahl;
|
||||
}
|
||||
|
||||
public String getBeschreibung() {
|
||||
return beschreibung;
|
||||
}
|
||||
|
||||
public void setBeschreibung(String beschreibung) {
|
||||
this.beschreibung = beschreibung;
|
||||
}
|
||||
|
||||
public String getObjectActivity() {
|
||||
return objectActivity;
|
||||
}
|
||||
|
||||
public void setObjectActivity(String objectActivity) {
|
||||
this.objectActivity = objectActivity;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package com.raataar.sprueche_hollywood.model;
|
||||
|
||||
public class AutorenByID {
|
||||
|
||||
private String objectId;
|
||||
private String kategorie_id;
|
||||
private String autor_id;
|
||||
private String zitat;
|
||||
private String image;
|
||||
private String autoren_text;
|
||||
private String kategorie_text;
|
||||
private String objectActivity;
|
||||
|
||||
public AutorenByID() {
|
||||
}
|
||||
|
||||
public AutorenByID(String objectId, String kategorie_id, String autor_id, String zitat, String image, String autoren_text, String kategorie_text, String objectActivity) {
|
||||
this.objectId = objectId;
|
||||
this.kategorie_id = kategorie_id;
|
||||
this.autor_id = autor_id;
|
||||
this.zitat = zitat;
|
||||
this.image = image;
|
||||
this.autoren_text = autoren_text;
|
||||
this.kategorie_text = kategorie_text;
|
||||
this.objectActivity = objectActivity;
|
||||
}
|
||||
|
||||
public String getObjectId() {
|
||||
return this.objectId;
|
||||
}
|
||||
|
||||
public void setObjectId(String objectId) {
|
||||
this.objectId = objectId;
|
||||
}
|
||||
|
||||
public String getKategorie_id() {
|
||||
return kategorie_id;
|
||||
}
|
||||
|
||||
public void setKategorie_id(String kategorie_id) {
|
||||
this.kategorie_id = kategorie_id;
|
||||
}
|
||||
|
||||
public String getAutor_id() {
|
||||
return autor_id;
|
||||
}
|
||||
|
||||
public void setAutor_id(String autor_id) {
|
||||
this.autor_id = autor_id;
|
||||
}
|
||||
|
||||
public String getZitat() {
|
||||
return zitat;
|
||||
}
|
||||
|
||||
public void setZitat(String zitat) {
|
||||
this.zitat = zitat;
|
||||
}
|
||||
|
||||
public String getImage() {
|
||||
return image;
|
||||
}
|
||||
|
||||
public void setImage(String image) {
|
||||
this.image = image;
|
||||
}
|
||||
|
||||
|
||||
public String getAutoren_text() {
|
||||
return autoren_text;
|
||||
}
|
||||
|
||||
public void setAutoren_text(String autoren_text) {
|
||||
this.autoren_text = autoren_text;
|
||||
}
|
||||
|
||||
public String getKategorie_text() {
|
||||
return kategorie_text;
|
||||
}
|
||||
|
||||
public void setKategorie_text(String kategorie_text) {
|
||||
this.kategorie_text = kategorie_text;
|
||||
}
|
||||
|
||||
public String getObjectActivity() {
|
||||
return objectActivity;
|
||||
}
|
||||
|
||||
public void setObjectActivity(String objectActivity) {
|
||||
this.objectActivity = objectActivity;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.raataar.sprueche_hollywood.model;
|
||||
|
||||
public class Kategorie {
|
||||
private String title;
|
||||
private String image;
|
||||
private String objectId;
|
||||
private String anzahl;
|
||||
private String beschreibung;
|
||||
private String objectActivity;
|
||||
|
||||
public Kategorie() {
|
||||
}
|
||||
|
||||
public Kategorie(String title, String image, String objectId, String anzahl, String beschreibung, String objectActivity) {
|
||||
this.title = title;
|
||||
this.image = image;
|
||||
this.objectId = objectId;
|
||||
this.anzahl = anzahl;
|
||||
this.beschreibung = beschreibung;
|
||||
this.objectActivity = objectActivity;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getImage() {
|
||||
return image;
|
||||
}
|
||||
|
||||
public void setImage(String image) {
|
||||
this.image = image;
|
||||
}
|
||||
|
||||
public String getObjectId() {
|
||||
return this.objectId;
|
||||
}
|
||||
|
||||
public void setObjectId(String objectId) {
|
||||
this.objectId = objectId;
|
||||
}
|
||||
|
||||
public String getAnzahl() {
|
||||
return anzahl;
|
||||
}
|
||||
|
||||
public void setAnzahl(String anzahl) {
|
||||
this.anzahl = anzahl;
|
||||
}
|
||||
|
||||
public String getBeschreibung() {
|
||||
return beschreibung;
|
||||
}
|
||||
|
||||
public void setBeschreibung(String beschreibung) {
|
||||
this.beschreibung = beschreibung;
|
||||
}
|
||||
|
||||
public String getObjectActivity() {
|
||||
return objectActivity;
|
||||
}
|
||||
|
||||
public void setObjectActivity(String objectActivity) {
|
||||
this.objectActivity = objectActivity;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package com.raataar.sprueche_hollywood.model;
|
||||
|
||||
public class KategorieByID {
|
||||
|
||||
private String objectId;
|
||||
private String kategorie_id;
|
||||
private String autor_id;
|
||||
private String zitat;
|
||||
private String image;
|
||||
private String autoren_text;
|
||||
private String kategorie_text;
|
||||
private String objectActivity;
|
||||
|
||||
public KategorieByID() {
|
||||
}
|
||||
|
||||
public KategorieByID(String objectId, String kategorie_id,String autor_id, String zitat, String image, String autoren_text, String kategorie_text, String objectActivity) {
|
||||
this.objectId = objectId;
|
||||
this.kategorie_id = kategorie_id;
|
||||
this.autor_id = autor_id;
|
||||
this.zitat = zitat;
|
||||
this.image = image;
|
||||
this.autoren_text = autoren_text;
|
||||
this.kategorie_text = kategorie_text;
|
||||
this.objectActivity = objectActivity;
|
||||
}
|
||||
|
||||
public String getObjectId() {
|
||||
return this.objectId;
|
||||
}
|
||||
|
||||
public void setObjectId(String objectId) {
|
||||
this.objectId = objectId;
|
||||
}
|
||||
|
||||
public String getKategorie_id() {
|
||||
return kategorie_id;
|
||||
}
|
||||
|
||||
public void setKategorie_id(String kategorie_id) {
|
||||
this.kategorie_id = kategorie_id;
|
||||
}
|
||||
|
||||
public String getAutor_id() {
|
||||
return autor_id;
|
||||
}
|
||||
|
||||
public void setAutor_id(String autor_id) {
|
||||
this.autor_id = autor_id;
|
||||
}
|
||||
|
||||
public String getZitat() {
|
||||
return zitat;
|
||||
}
|
||||
|
||||
public void setZitat(String zitat) {
|
||||
this.zitat = zitat;
|
||||
}
|
||||
|
||||
public String getImage() {
|
||||
return image;
|
||||
}
|
||||
|
||||
public void setImage(String image) {
|
||||
this.image = image;
|
||||
}
|
||||
|
||||
|
||||
public String getAutoren_text() {
|
||||
return autoren_text;
|
||||
}
|
||||
|
||||
public void setAutoren_text(String autoren_text) {
|
||||
this.autoren_text = autoren_text;
|
||||
}
|
||||
|
||||
public String getKategorie_text() {
|
||||
return kategorie_text;
|
||||
}
|
||||
|
||||
public void setKategorie_text(String kategorie_text) {
|
||||
this.kategorie_text = kategorie_text;
|
||||
}
|
||||
|
||||
public String getObjectActivity() {
|
||||
return objectActivity;
|
||||
}
|
||||
|
||||
public void setObjectActivity(String objectActivity) {
|
||||
this.objectActivity = objectActivity;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.raataar.sprueche_hollywood.model;
|
||||
|
||||
public class Mainmenue {
|
||||
private String title;
|
||||
private String image;
|
||||
private String objectId;
|
||||
private String anzahl;
|
||||
private String beschreibung;
|
||||
private String objectActivity;
|
||||
|
||||
public Mainmenue() {
|
||||
}
|
||||
|
||||
public Mainmenue(String title, String image, String objectId, String anzahl, String beschreibung, String objectActivity) {
|
||||
this.title = title;
|
||||
this.image = image;
|
||||
this.objectId = objectId;
|
||||
this.anzahl = anzahl;
|
||||
this.beschreibung = beschreibung;
|
||||
this.objectActivity = objectActivity;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getImage() {
|
||||
return image;
|
||||
}
|
||||
|
||||
public void setImage(String image) {
|
||||
this.image = image;
|
||||
}
|
||||
|
||||
public String getObjectId() {
|
||||
return this.objectId;
|
||||
}
|
||||
|
||||
public void setObjectId(String objectId) {
|
||||
this.objectId = objectId;
|
||||
}
|
||||
|
||||
public String getAnzahl() {
|
||||
return anzahl;
|
||||
}
|
||||
|
||||
public void setAnzahl(String anzahl) {
|
||||
this.anzahl = anzahl;
|
||||
}
|
||||
|
||||
public String getBeschreibung() {
|
||||
return beschreibung;
|
||||
}
|
||||
|
||||
public void setBeschreibung(String beschreibung) {
|
||||
this.beschreibung = beschreibung;
|
||||
}
|
||||
|
||||
public String getObjectActivity() {
|
||||
return objectActivity;
|
||||
}
|
||||
|
||||
public void setObjectActivity(String objectActivity) {
|
||||
this.objectActivity = objectActivity;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.raataar.sprueche_hollywood.model;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class Movie {
|
||||
private String title, thumbnailUrl;
|
||||
private int year;
|
||||
private double rating;
|
||||
private ArrayList<String> genre;
|
||||
|
||||
public Movie() {
|
||||
}
|
||||
|
||||
public Movie(String name, String thumbnailUrl, int year, double rating,
|
||||
ArrayList<String> genre) {
|
||||
this.title = name;
|
||||
this.thumbnailUrl = thumbnailUrl;
|
||||
this.year = year;
|
||||
this.rating = rating;
|
||||
this.genre = genre;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String name) {
|
||||
this.title = name;
|
||||
}
|
||||
|
||||
public String getThumbnailUrl() {
|
||||
return thumbnailUrl;
|
||||
}
|
||||
|
||||
public void setThumbnailUrl(String thumbnailUrl) {
|
||||
this.thumbnailUrl = thumbnailUrl;
|
||||
}
|
||||
|
||||
public int getYear() {
|
||||
return year;
|
||||
}
|
||||
|
||||
public void setYear(int year) {
|
||||
this.year = year;
|
||||
}
|
||||
|
||||
public double getRating() {
|
||||
return rating;
|
||||
}
|
||||
|
||||
public void setRating(double rating) {
|
||||
this.rating = rating;
|
||||
}
|
||||
|
||||
public ArrayList<String> getGenre() {
|
||||
return genre;
|
||||
}
|
||||
|
||||
public void setGenre(ArrayList<String> genre) {
|
||||
this.genre = genre;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package com.raataar.sprueche_hollywood.model;
|
||||
|
||||
public class SuchenByID {
|
||||
|
||||
private String objectId;
|
||||
private String kategorie_id;
|
||||
private String autor_id;
|
||||
private String zitat;
|
||||
private String image;
|
||||
private String autoren_text;
|
||||
private String kategorie_text;
|
||||
private String objectActivity;
|
||||
|
||||
public SuchenByID() {
|
||||
}
|
||||
|
||||
public SuchenByID(String objectId, String kategorie_id, String autor_id, String zitat, String image, String autoren_text, String kategorie_text, String objectActivity) {
|
||||
this.objectId = objectId;
|
||||
this.kategorie_id = kategorie_id;
|
||||
this.autor_id = autor_id;
|
||||
this.zitat = zitat;
|
||||
this.image = image;
|
||||
this.autoren_text = autoren_text;
|
||||
this.kategorie_text = kategorie_text;
|
||||
this.objectActivity = objectActivity;
|
||||
}
|
||||
|
||||
public String getObjectId() {
|
||||
return this.objectId;
|
||||
}
|
||||
|
||||
public void setObjectId(String objectId) {
|
||||
this.objectId = objectId;
|
||||
}
|
||||
|
||||
public String getKategorie_id() {
|
||||
return kategorie_id;
|
||||
}
|
||||
|
||||
public void setKategorie_id(String kategorie_id) {
|
||||
this.kategorie_id = kategorie_id;
|
||||
}
|
||||
|
||||
public String getAutor_id() {
|
||||
return autor_id;
|
||||
}
|
||||
|
||||
public void setAutor_id(String autor_id) {
|
||||
this.autor_id = autor_id;
|
||||
}
|
||||
|
||||
public String getZitat() {
|
||||
return zitat;
|
||||
}
|
||||
|
||||
public void setZitat(String zitat) {
|
||||
this.zitat = zitat;
|
||||
}
|
||||
|
||||
public String getImage() {
|
||||
return image;
|
||||
}
|
||||
|
||||
public void setImage(String image) {
|
||||
this.image = image;
|
||||
}
|
||||
|
||||
|
||||
public String getAutoren_text() {
|
||||
return autoren_text;
|
||||
}
|
||||
|
||||
public void setAutoren_text(String autoren_text) {
|
||||
this.autoren_text = autoren_text;
|
||||
}
|
||||
|
||||
public String getKategorie_text() {
|
||||
return kategorie_text;
|
||||
}
|
||||
|
||||
public void setKategorie_text(String kategorie_text) {
|
||||
this.kategorie_text = kategorie_text;
|
||||
}
|
||||
|
||||
public String getObjectActivity() {
|
||||
return objectActivity;
|
||||
}
|
||||
|
||||
public void setObjectActivity(String objectActivity) {
|
||||
this.objectActivity = objectActivity;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.raataar.sprueche_hollywood.util;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.support.v4.util.LruCache;
|
||||
import com.android.volley.toolbox.ImageLoader.ImageCache;
|
||||
|
||||
public class LruBitmapCache extends LruCache<String, Bitmap> implements
|
||||
ImageCache {
|
||||
public static int getDefaultLruCacheSize() {
|
||||
final int maxMemory = (int) (Runtime.getRuntime().maxMemory() / 1024);
|
||||
final int cacheSize = maxMemory / 8;
|
||||
|
||||
return cacheSize;
|
||||
}
|
||||
|
||||
public LruBitmapCache() {
|
||||
this(getDefaultLruCacheSize());
|
||||
}
|
||||
|
||||
public LruBitmapCache(int sizeInKiloBytes) {
|
||||
super(sizeInKiloBytes);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int sizeOf(String key, Bitmap value) {
|
||||
return value.getRowBytes() * value.getHeight() / 1024;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Bitmap getBitmap(String url) {
|
||||
return get(url);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void putBitmap(String url, Bitmap bitmap) {
|
||||
put(url, bitmap);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.raataar.sprueche_hollywood.util;
|
||||
|
||||
import android.graphics.*;
|
||||
|
||||
public class RoundedTransformation implements
|
||||
com.squareup.picasso.Transformation {
|
||||
private final int radius;
|
||||
private final int margin; // dp
|
||||
|
||||
// radius is corner radii in dp
|
||||
// margin is the board in dp
|
||||
public RoundedTransformation(final int radius, final int margin) {
|
||||
this.radius = radius;
|
||||
this.margin = margin;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Bitmap transform(final Bitmap source) {
|
||||
final Paint paint = new Paint();
|
||||
paint.setAntiAlias(true);
|
||||
paint.setShader(new BitmapShader(source, Shader.TileMode.CLAMP,
|
||||
Shader.TileMode.CLAMP));
|
||||
|
||||
Bitmap output = Bitmap.createBitmap(source.getWidth(),
|
||||
source.getHeight(), Bitmap.Config.ARGB_8888);
|
||||
Canvas canvas = new Canvas(output);
|
||||
canvas.drawRoundRect(new RectF(margin, margin, source.getWidth()
|
||||
- margin, source.getHeight() - margin), radius, radius, paint);
|
||||
|
||||
if (source != output) {
|
||||
source.recycle();
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String key() {
|
||||
return "rounded";
|
||||
}
|
||||
}
|
||||
BIN
app/src/main/res/drawable-hdpi/bg.jpg
Normal file
|
After Width: | Height: | Size: 43 KiB |
BIN
app/src/main/res/drawable-hdpi/ic_action_autor.png
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
BIN
app/src/main/res/drawable-hdpi/ic_action_exit.png
Normal file
|
After Width: | Height: | Size: 3.0 KiB |
BIN
app/src/main/res/drawable-hdpi/ic_action_kategorie.png
Normal file
|
After Width: | Height: | Size: 4.6 KiB |
BIN
app/src/main/res/drawable-hdpi/ic_action_refresh.png
Normal file
|
After Width: | Height: | Size: 5.7 KiB |
BIN
app/src/main/res/drawable-hdpi/ic_action_search.png
Normal file
|
After Width: | Height: | Size: 5.2 KiB |
BIN
app/src/main/res/drawable-hdpi/ic_blank.png
Normal file
|
After Width: | Height: | Size: 976 B |
BIN
app/src/main/res/drawable-hdpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 4.4 KiB |
BIN
app/src/main/res/drawable-ldpi/bg.jpg
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
app/src/main/res/drawable-ldpi/ic_action_autor.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
app/src/main/res/drawable-ldpi/ic_action_exit.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
app/src/main/res/drawable-ldpi/ic_action_kategorie.png
Normal file
|
After Width: | Height: | Size: 3.3 KiB |
BIN
app/src/main/res/drawable-ldpi/ic_action_refresh.png
Normal file
|
After Width: | Height: | Size: 4.0 KiB |
BIN
app/src/main/res/drawable-ldpi/ic_action_search.png
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
BIN
app/src/main/res/drawable-ldpi/ic_blank.png
Normal file
|
After Width: | Height: | Size: 959 B |
BIN
app/src/main/res/drawable-ldpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
app/src/main/res/drawable-mdpi/bg.jpg
Normal file
|
After Width: | Height: | Size: 25 KiB |
BIN
app/src/main/res/drawable-mdpi/ic_action_autor.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
app/src/main/res/drawable-mdpi/ic_action_exit.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
app/src/main/res/drawable-mdpi/ic_action_kategorie.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
app/src/main/res/drawable-mdpi/ic_action_refresh.png
Normal file
|
After Width: | Height: | Size: 3.5 KiB |
BIN
app/src/main/res/drawable-mdpi/ic_action_search.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
app/src/main/res/drawable-mdpi/ic_blank.png
Normal file
|
After Width: | Height: | Size: 953 B |
BIN
app/src/main/res/drawable-mdpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
app/src/main/res/drawable-xhdpi/bg.jpg
Normal file
|
After Width: | Height: | Size: 58 KiB |
BIN
app/src/main/res/drawable-xhdpi/ic_action_autor.png
Normal file
|
After Width: | Height: | Size: 5.1 KiB |
BIN
app/src/main/res/drawable-xhdpi/ic_action_exit.png
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
app/src/main/res/drawable-xhdpi/ic_action_kategorie.png
Normal file
|
After Width: | Height: | Size: 6.3 KiB |
BIN
app/src/main/res/drawable-xhdpi/ic_action_refresh.png
Normal file
|
After Width: | Height: | Size: 8.1 KiB |
BIN
app/src/main/res/drawable-xhdpi/ic_action_search.png
Normal file
|
After Width: | Height: | Size: 7.4 KiB |
BIN
app/src/main/res/drawable-xhdpi/ic_blank.png
Normal file
|
After Width: | Height: | Size: 1009 B |
BIN
app/src/main/res/drawable-xhdpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 6.5 KiB |
BIN
app/src/main/res/drawable-xxhdpi/bg.jpg
Normal file
|
After Width: | Height: | Size: 102 KiB |
BIN
app/src/main/res/drawable-xxhdpi/ic_action_autor.png
Normal file
|
After Width: | Height: | Size: 8.3 KiB |
BIN
app/src/main/res/drawable-xxhdpi/ic_action_exit.png
Normal file
|
After Width: | Height: | Size: 5.8 KiB |
BIN
app/src/main/res/drawable-xxhdpi/ic_action_kategorie.png
Normal file
|
After Width: | Height: | Size: 9.9 KiB |
BIN
app/src/main/res/drawable-xxhdpi/ic_action_refresh.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
app/src/main/res/drawable-xxhdpi/ic_action_search.png
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
app/src/main/res/drawable-xxhdpi/ic_blank.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
app/src/main/res/drawable-xxhdpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
app/src/main/res/drawable-xxxhdpi/bg.jpg
Normal file
|
After Width: | Height: | Size: 137 KiB |
37
app/src/main/res/drawable/buttonshape.xml
Normal file
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="true" >
|
||||
<shape>
|
||||
<solid
|
||||
android:color="#555bd5" />
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="#232ce8" />
|
||||
<corners
|
||||
android:radius="3dp" />
|
||||
<padding
|
||||
android:left="10dp"
|
||||
android:top="10dp"
|
||||
android:right="10dp"
|
||||
android:bottom="10dp" />
|
||||
</shape>
|
||||
</item>
|
||||
<item>
|
||||
<shape>
|
||||
<gradient
|
||||
android:startColor="#555bd5"
|
||||
android:endColor="#040cb9"
|
||||
android:angle="270" />
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="#040cb9" />
|
||||
<corners
|
||||
android:radius="4dp" />
|
||||
<padding
|
||||
android:left="10dp"
|
||||
android:top="10dp"
|
||||
android:right="10dp"
|
||||
android:bottom="10dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
BIN
app/src/main/res/drawable/ic_action_autor.png
Normal file
|
After Width: | Height: | Size: 4.5 KiB |
BIN
app/src/main/res/drawable/ic_action_exit.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
app/src/main/res/drawable/ic_action_kategorie.png
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
BIN
app/src/main/res/drawable/ic_action_refresh.png
Normal file
|
After Width: | Height: | Size: 6.4 KiB |
BIN
app/src/main/res/drawable/ic_action_search.png
Normal file
|
After Width: | Height: | Size: 6.8 KiB |
BIN
app/src/main/res/drawable/ic_blank.png
Normal file
|
After Width: | Height: | Size: 212 B |
7
app/src/main/res/drawable/layout_bg.xml
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="#80FFFFFF"/>
|
||||
<stroke android:width="1dip" android:color="#B1BCBE" />
|
||||
<corners android:radius="3dip"/>
|
||||
<padding android:left="0dip" android:top="0dip" android:right="0dip" android:bottom="0dip" />
|
||||
</shape>
|
||||
8
app/src/main/res/drawable/list_row_bg.xml
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<gradient
|
||||
android:startColor="@color/list_row_start_color"
|
||||
android:endColor="@color/list_row_end_color"
|
||||
android:angle="270" />
|
||||
</shape>
|
||||
10
app/src/main/res/drawable/list_row_bg_hover.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle" >
|
||||
|
||||
<gradient
|
||||
android:angle="270"
|
||||
android:endColor="@color/list_row_hover_end_color"
|
||||
android:startColor="@color/list_row_hover_start_color" />
|
||||
|
||||
</shape>
|
||||
8
app/src/main/res/drawable/list_row_selector.xml
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:drawable="@drawable/list_row_bg" android:state_pressed="false" android:state_selected="false"/>
|
||||
<item android:drawable="@drawable/list_row_bg_hover" android:state_pressed="true"/>
|
||||
<item android:drawable="@drawable/list_row_bg_hover" android:state_pressed="false" android:state_selected="true"/>
|
||||
|
||||
</selector>
|
||||
16
app/src/main/res/layout/activity_autoren.xml
Normal file
@@ -0,0 +1,16 @@
|
||||
<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:background="@drawable/bg"
|
||||
tools:context=".MainActivity">
|
||||
|
||||
<ListView
|
||||
android:id="@+id/list"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:divider="@color/list_divider"
|
||||
android:dividerHeight="1dp"
|
||||
android:listSelector="@drawable/list_row_selector" />
|
||||
|
||||
</RelativeLayout>
|
||||
17
app/src/main/res/layout/activity_kategorie.xml
Normal file
@@ -0,0 +1,17 @@
|
||||
<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:background="@drawable/bg"
|
||||
tools:context=".MainActivity" >
|
||||
|
||||
<ListView
|
||||
android:id="@+id/list"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:divider="@color/list_divider"
|
||||
android:dividerHeight="1dp"
|
||||
android:listSelector="@drawable/list_row_selector" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
16
app/src/main/res/layout/activity_main.xml
Normal file
@@ -0,0 +1,16 @@
|
||||
<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:background="@drawable/bg"
|
||||
tools:context=".MainActivity" >
|
||||
|
||||
|
||||
<ListView
|
||||
android:id="@+id/list"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:divider="@color/list_divider"
|
||||
android:dividerHeight="1dp"
|
||||
android:listSelector="@drawable/list_row_selector" />
|
||||
|
||||
</RelativeLayout>
|
||||
82
app/src/main/res/layout/activity_news.xml
Normal file
@@ -0,0 +1,82 @@
|
||||
<ScrollView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/android:list"
|
||||
android:layout_width="match_parent"
|
||||
android:background="@drawable/bg"
|
||||
android:layout_height="match_parent" >
|
||||
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<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"
|
||||
tools:context=".MainActivity" >
|
||||
|
||||
<!-- ObjetcID -->
|
||||
<TextView
|
||||
android:id="@+id/objectid"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="1dip"
|
||||
android:visibility = "gone"
|
||||
android:textSize="@dimen/rating" />
|
||||
|
||||
<!-- Autoren Thumbnail Image -->
|
||||
<com.android.volley.toolbox.NetworkImageView
|
||||
android:id="@+id/news_image"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginTop="30dp"
|
||||
android:layout_marginBottom="30dp"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_below="@id/objectid"
|
||||
android:clickable="true"
|
||||
android:onClick="showImage"
|
||||
android:layout_marginRight="8dp" />
|
||||
|
||||
<!-- AutorenText -->
|
||||
<TextView
|
||||
android:id="@+id/news_title"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="30dp"
|
||||
android:textStyle="bold|italic"
|
||||
android:textColor="@color/newstitle"
|
||||
android:shadowColor="@color/titleshadow"
|
||||
android:shadowDx="3"
|
||||
android:shadowDy="3"
|
||||
android:shadowRadius="1.5"
|
||||
android:layout_toRightOf="@+id/news_image"
|
||||
android:layout_below="@id/objectid"
|
||||
android:textSize="@dimen/title"
|
||||
android:phoneNumber="false" />
|
||||
|
||||
</RelativeLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical|center_horizontal"
|
||||
android:background="@drawable/layout_bg"
|
||||
android:layout_margin="5dp"
|
||||
android:padding="5dp"
|
||||
android:orientation="horizontal">
|
||||
<TextView
|
||||
android:id="@+id/news_content"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:layout_marginRight="15dp"
|
||||
android:layout_marginBottom="45dp"
|
||||
android:textSize="@dimen/rating" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
62
app/src/main/res/layout/activity_suchen.xml
Normal file
@@ -0,0 +1,62 @@
|
||||
<ScrollView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/android:list"
|
||||
android:layout_width="match_parent"
|
||||
android:background="@drawable/bg"
|
||||
android:layout_height="match_parent" >
|
||||
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<!-- ObjetcID -->
|
||||
<TextView
|
||||
android:id="@+id/objectid"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="1dip"
|
||||
android:visibility = "gone"
|
||||
android:textSize="@dimen/rating" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical|center_horizontal"
|
||||
android:background="@drawable/layout_bg"
|
||||
android:layout_margin="5dp"
|
||||
android:padding="5dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
<EditText
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/searchtext"
|
||||
android:hint="@string/searchlabel"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:layout_marginRight="15dp" />
|
||||
</LinearLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/suchen_button"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/button_suchen"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:layout_marginRight="15dp"
|
||||
android:onClick="searchNow"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="15sp"
|
||||
android:background="@drawable/buttonshape"
|
||||
android:shadowColor="#A8A8A8"
|
||||
android:shadowDx="0"
|
||||
android:shadowDy="0"
|
||||
android:shadowRadius="5"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
17
app/src/main/res/layout/activity_suchenbyid.xml
Normal file
@@ -0,0 +1,17 @@
|
||||
<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:background="@drawable/bg"
|
||||
tools:context=".MainActivity" >
|
||||
|
||||
<ListView
|
||||
android:id="@+id/list"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:divider="@color/list_divider"
|
||||
android:dividerHeight="1dp"
|
||||
android:listSelector="@drawable/list_row_selector" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
207
app/src/main/res/layout/activity_zitat.xml
Normal file
@@ -0,0 +1,207 @@
|
||||
<ScrollView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/android:list"
|
||||
android:layout_width="match_parent"
|
||||
android:background="@drawable/bg"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical|center_horizontal"
|
||||
android:background="@drawable/layout_bg"
|
||||
android:layout_margin="5dp"
|
||||
android:orientation="horizontal">
|
||||
<!-- Zitat -->
|
||||
<TextView
|
||||
android:id="@+id/zitat"
|
||||
android:layout_marginTop="30dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_marginBottom="30dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/zitattitle"
|
||||
android:gravity="center"
|
||||
android:textSize="@dimen/zitat"
|
||||
android:shadowColor="@color/titleshadow"
|
||||
android:shadowDx="3"
|
||||
android:shadowDy="3"
|
||||
android:shadowRadius="1.5"
|
||||
android:textStyle="bold|italic" />
|
||||
|
||||
<!-- ObjetcID -->
|
||||
<TextView
|
||||
android:id="@+id/objectid"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="1dip"
|
||||
android:visibility = "gone"
|
||||
android:textSize="@dimen/rating" />
|
||||
|
||||
|
||||
<!-- AutorenID -->
|
||||
<TextView
|
||||
android:id="@+id/autoren_id"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="1dip"
|
||||
android:visibility = "gone"
|
||||
android:textSize="@dimen/rating" />
|
||||
|
||||
<!-- KategorieID -->
|
||||
<TextView
|
||||
android:id="@+id/kategorie_id"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="1dip"
|
||||
android:visibility = "gone"
|
||||
android:textSize="@dimen/rating" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical|center_horizontal"
|
||||
android:background="@drawable/layout_bg"
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingBottom="5dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<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"
|
||||
tools:context=".MainActivity">
|
||||
|
||||
<!-- Autoren Thumbnail Image -->
|
||||
<ImageView
|
||||
android:id="@+id/autoren_imagepic"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:clickable="true"
|
||||
android:onClick="showImage"
|
||||
android:layout_marginRight="8dp"
|
||||
/>
|
||||
|
||||
|
||||
<!-- AutorenText -->
|
||||
<TextView
|
||||
android:id="@+id/autoren_text"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textStyle="bold"
|
||||
android:layout_toRightOf="@+id/autoren_imagepic"
|
||||
android:textSize="@dimen/rating" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/autoren_beschreibung"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/autoren_text"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_toRightOf="@+id/autoren_imagepic"
|
||||
android:textSize="@dimen/rating" />
|
||||
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical|center_horizontal"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingBottom="10dp"
|
||||
android:background="@drawable/layout_bg"
|
||||
android:id="@+id/autoren_infoview"
|
||||
android:orientation="horizontal">
|
||||
<TextView
|
||||
android:id="@+id/autoren_imagequelle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textStyle="bold|italic"
|
||||
android:gravity="left"
|
||||
android:clickable="true"
|
||||
android:textSize="@dimen/quelle" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/autoren_moreinfo"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textStyle="bold|italic"
|
||||
android:clickable="true"
|
||||
android:gravity="right"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:textSize="@dimen/quelle" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical|center_horizontal"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:paddingTop="10dp"
|
||||
android:background="@drawable/layout_bg"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<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"
|
||||
tools:context=".MainActivity">
|
||||
|
||||
<!-- Kategorie Thumbnail Image -->
|
||||
<com.android.volley.toolbox.NetworkImageView
|
||||
android:id="@+id/kategorie_image"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_marginRight="8dp" />
|
||||
|
||||
<!-- KategorieText -->
|
||||
<TextView
|
||||
android:id="@+id/kategorie_text"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textStyle="bold"
|
||||
android:layout_toRightOf="@+id/kategorie_image"
|
||||
android:textSize="@dimen/rating" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/kategorie_beschreibung"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/kategorie_text"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_toRightOf="@+id/kategorie_image"
|
||||
android:textSize="@dimen/rating" />
|
||||
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
227
app/src/main/res/layout/activity_zufallzitat.xml
Normal file
@@ -0,0 +1,227 @@
|
||||
<ScrollView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/android:list"
|
||||
android:layout_width="match_parent"
|
||||
android:background="@drawable/bg"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical|center_horizontal"
|
||||
android:background="@drawable/layout_bg"
|
||||
android:layout_margin="5dp"
|
||||
android:orientation="horizontal">
|
||||
<!-- Zitat -->
|
||||
<TextView
|
||||
android:id="@+id/zitat"
|
||||
android:layout_marginTop="30dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_marginBottom="30dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/zitattitle"
|
||||
android:gravity="center"
|
||||
android:textSize="@dimen/zitat"
|
||||
android:shadowColor="@color/titleshadow"
|
||||
android:shadowDx="3"
|
||||
android:shadowDy="3"
|
||||
android:shadowRadius="1.5"
|
||||
android:textStyle="bold|italic" />
|
||||
|
||||
<!-- ObjetcID -->
|
||||
<TextView
|
||||
android:id="@+id/objectid"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="1dip"
|
||||
android:visibility = "gone"
|
||||
android:textSize="@dimen/rating" />
|
||||
|
||||
|
||||
<!-- AutorenID -->
|
||||
<TextView
|
||||
android:id="@+id/autoren_id"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="1dip"
|
||||
android:visibility = "gone"
|
||||
android:textSize="@dimen/rating" />
|
||||
|
||||
<!-- KategorieID -->
|
||||
<TextView
|
||||
android:id="@+id/kategorie_id"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="1dip"
|
||||
android:visibility = "gone"
|
||||
android:textSize="@dimen/rating" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical|center_horizontal"
|
||||
android:background="@drawable/layout_bg"
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingBottom="5dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<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"
|
||||
tools:context=".MainActivity">
|
||||
|
||||
|
||||
<!-- Autoren Thumbnail Image -->
|
||||
<ImageView
|
||||
android:id="@+id/autoren_imagepic"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:clickable="true"
|
||||
android:onClick="showImage"
|
||||
android:layout_marginRight="8dp"
|
||||
/>
|
||||
|
||||
|
||||
<!-- AutorenText -->
|
||||
<TextView
|
||||
android:id="@+id/autoren_text"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textStyle="bold"
|
||||
android:layout_toRightOf="@+id/autoren_imagepic"
|
||||
android:textSize="@dimen/rating" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/autoren_beschreibung"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/autoren_text"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_toRightOf="@+id/autoren_imagepic"
|
||||
android:textSize="@dimen/rating" />
|
||||
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical|center_horizontal"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingBottom="10dp"
|
||||
android:background="@drawable/layout_bg"
|
||||
android:id="@+id/autoren_infoview"
|
||||
android:orientation="horizontal">
|
||||
<TextView
|
||||
android:id="@+id/autoren_imagequelle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textStyle="bold|italic"
|
||||
android:gravity="left"
|
||||
android:clickable="true"
|
||||
android:textSize="@dimen/quelle" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/autoren_moreinfo"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textStyle="bold|italic"
|
||||
android:clickable="true"
|
||||
android:gravity="right"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:textSize="@dimen/quelle" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical|center_horizontal"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:paddingTop="10dp"
|
||||
android:background="@drawable/layout_bg"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<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"
|
||||
tools:context=".MainActivity">
|
||||
|
||||
<!-- Kategorie Thumbnail Image -->
|
||||
<com.android.volley.toolbox.NetworkImageView
|
||||
android:id="@+id/kategorie_image"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_marginRight="8dp" />
|
||||
|
||||
<!-- KategorieText -->
|
||||
<TextView
|
||||
android:id="@+id/kategorie_text"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textStyle="bold"
|
||||
android:layout_toRightOf="@+id/kategorie_image"
|
||||
android:textSize="@dimen/rating" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/kategorie_beschreibung"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/kategorie_text"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_toRightOf="@+id/kategorie_image"
|
||||
android:textSize="@dimen/rating" />
|
||||
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/zitat_more_zitat"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/button_load_next_zitat"
|
||||
android:layout_below="@id/kategorie_image"
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:onClick="loadNextZitat"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="15sp"
|
||||
android:background="@drawable/buttonshape"
|
||||
android:shadowColor="#A8A8A8"
|
||||
android:shadowDx="0"
|
||||
android:shadowDy="0"
|
||||
android:shadowRadius="5"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
61
app/src/main/res/layout/list_autoren.xml
Normal file
@@ -0,0 +1,61 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/list_row_selector"
|
||||
android:padding="8dp" >
|
||||
|
||||
<!-- Thumbnail Image -->
|
||||
<ImageView
|
||||
android:id="@+id/thumbnail"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_marginRight="8dp"/>
|
||||
|
||||
|
||||
<!-- Title -->
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignTop="@+id/thumbnail"
|
||||
android:layout_toRightOf="@+id/thumbnail"
|
||||
android:textSize="@dimen/zitatlist"
|
||||
android:textStyle="bold" />
|
||||
|
||||
|
||||
<!-- Beschreibung -->
|
||||
<TextView
|
||||
android:id="@+id/beschreibung"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/title"
|
||||
android:layout_marginTop="1dip"
|
||||
android:layout_toRightOf="@+id/thumbnail"
|
||||
android:textSize="@dimen/rating" />
|
||||
|
||||
<!-- ObjetcID -->
|
||||
<TextView
|
||||
android:id="@+id/objectid"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/beschreibung"
|
||||
android:layout_marginTop="1dip"
|
||||
android:layout_toRightOf="@+id/thumbnail"
|
||||
android:visibility = "gone"
|
||||
android:textSize="@dimen/rating" />
|
||||
|
||||
<!-- Anzahl -->
|
||||
<TextView
|
||||
android:id="@+id/anzahl"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/objectid"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_toRightOf="@+id/thumbnail"
|
||||
android:textColor="@color/genre"
|
||||
android:textSize="@dimen/genre" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
71
app/src/main/res/layout/list_autorenbyid.xml
Normal file
@@ -0,0 +1,71 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/list_row_selector"
|
||||
android:padding="8dp" >
|
||||
|
||||
<!-- Thumbnail Image -->
|
||||
<com.android.volley.toolbox.NetworkImageView
|
||||
android:id="@+id/thumbnail"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_marginRight="8dp" />
|
||||
|
||||
<!-- Zitat -->
|
||||
<TextView
|
||||
android:id="@+id/zitat"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignTop="@+id/thumbnail"
|
||||
android:layout_toRightOf="@+id/thumbnail"
|
||||
android:textSize="@dimen/zitatlist"
|
||||
android:textStyle="bold" />
|
||||
|
||||
|
||||
<!-- Zitatfooter -->
|
||||
<TextView
|
||||
android:id="@+id/zitatfooter"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/zitat"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_toRightOf="@+id/thumbnail"
|
||||
android:textColor="@color/genre"
|
||||
android:textSize="@dimen/genre" />
|
||||
|
||||
<!-- ObjetcID -->
|
||||
<TextView
|
||||
android:id="@+id/objectid"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/zitatfooter"
|
||||
android:layout_marginTop="1dip"
|
||||
android:layout_toRightOf="@+id/thumbnail"
|
||||
android:visibility = "gone"
|
||||
android:textSize="@dimen/rating" />
|
||||
|
||||
<!-- AutorenID -->
|
||||
<TextView
|
||||
android:id="@+id/autoren_id"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/objectid"
|
||||
android:layout_marginTop="1dip"
|
||||
android:layout_toRightOf="@+id/thumbnail"
|
||||
android:visibility = "gone"
|
||||
android:textSize="@dimen/rating" />
|
||||
|
||||
<!-- KategorieID -->
|
||||
<TextView
|
||||
android:id="@+id/kategorie_id"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/autoren_id"
|
||||
android:layout_marginTop="1dip"
|
||||
android:layout_toRightOf="@+id/thumbnail"
|
||||
android:visibility = "gone"
|
||||
android:textSize="@dimen/rating" />
|
||||
|
||||
</RelativeLayout>
|
||||
60
app/src/main/res/layout/list_kategorie.xml
Normal file
@@ -0,0 +1,60 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/list_row_selector"
|
||||
android:padding="8dp" >
|
||||
|
||||
<!-- Thumbnail Image -->
|
||||
<com.android.volley.toolbox.NetworkImageView
|
||||
android:id="@+id/thumbnail"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_marginRight="8dp" />
|
||||
|
||||
<!-- Title -->
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignTop="@+id/thumbnail"
|
||||
android:layout_toRightOf="@+id/thumbnail"
|
||||
android:textSize="@dimen/title"
|
||||
android:textStyle="bold" />
|
||||
|
||||
|
||||
<!-- Beschreibung -->
|
||||
<TextView
|
||||
android:id="@+id/beschreibung"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/title"
|
||||
android:layout_marginTop="1dip"
|
||||
android:layout_toRightOf="@+id/thumbnail"
|
||||
android:textSize="@dimen/rating" />
|
||||
|
||||
<!-- ObjetcID -->
|
||||
<TextView
|
||||
android:id="@+id/objectid"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/beschreibung"
|
||||
android:layout_marginTop="1dip"
|
||||
android:layout_toRightOf="@+id/thumbnail"
|
||||
android:visibility = "gone"
|
||||
android:textSize="@dimen/rating" />
|
||||
|
||||
<!-- Anzahl -->
|
||||
<TextView
|
||||
android:id="@+id/anzahl"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/objectid"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_toRightOf="@+id/thumbnail"
|
||||
android:textColor="@color/genre"
|
||||
android:textSize="@dimen/genre" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
71
app/src/main/res/layout/list_kategoriebyid.xml
Normal file
@@ -0,0 +1,71 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/list_row_selector"
|
||||
android:padding="8dp" >
|
||||
|
||||
<!-- Thumbnail Image -->
|
||||
<com.android.volley.toolbox.NetworkImageView
|
||||
android:id="@+id/thumbnail"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_marginRight="8dp" />
|
||||
|
||||
<!-- Zitat -->
|
||||
<TextView
|
||||
android:id="@+id/zitat"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignTop="@+id/thumbnail"
|
||||
android:layout_toRightOf="@+id/thumbnail"
|
||||
android:textSize="@dimen/zitatlist"
|
||||
android:textStyle="bold" />
|
||||
|
||||
|
||||
<!-- Zitatfooter -->
|
||||
<TextView
|
||||
android:id="@+id/zitatfooter"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/zitat"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_toRightOf="@+id/thumbnail"
|
||||
android:textColor="@color/genre"
|
||||
android:textSize="@dimen/genre" />
|
||||
|
||||
<!-- ObjetcID -->
|
||||
<TextView
|
||||
android:id="@+id/objectid"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/zitatfooter"
|
||||
android:layout_marginTop="1dip"
|
||||
android:layout_toRightOf="@+id/thumbnail"
|
||||
android:visibility = "gone"
|
||||
android:textSize="@dimen/rating" />
|
||||
|
||||
<!-- AutorenID -->
|
||||
<TextView
|
||||
android:id="@+id/autoren_id"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/objectid"
|
||||
android:layout_marginTop="1dip"
|
||||
android:layout_toRightOf="@+id/thumbnail"
|
||||
android:visibility = "gone"
|
||||
android:textSize="@dimen/rating" />
|
||||
|
||||
<!-- KategorieID -->
|
||||
<TextView
|
||||
android:id="@+id/kategorie_id"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/autoren_id"
|
||||
android:layout_marginTop="1dip"
|
||||
android:layout_toRightOf="@+id/thumbnail"
|
||||
android:visibility = "gone"
|
||||
android:textSize="@dimen/rating" />
|
||||
|
||||
</RelativeLayout>
|
||||
61
app/src/main/res/layout/list_mainmenue.xml
Normal file
@@ -0,0 +1,61 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/list_row_selector"
|
||||
android:padding="8dp" >
|
||||
|
||||
<!-- Thumbnail Image -->
|
||||
<com.android.volley.toolbox.NetworkImageView
|
||||
android:id="@+id/thumbnail"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_marginRight="8dp" />
|
||||
|
||||
<!-- Title -->
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignTop="@+id/thumbnail"
|
||||
android:layout_toRightOf="@+id/thumbnail"
|
||||
android:textSize="@dimen/title"
|
||||
android:textStyle="bold" />
|
||||
|
||||
|
||||
<!-- Beschreibung -->
|
||||
<TextView
|
||||
android:id="@+id/beschreibung"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/title"
|
||||
android:layout_marginTop="1dip"
|
||||
android:layout_toRightOf="@+id/thumbnail"
|
||||
android:textSize="@dimen/rating" />
|
||||
|
||||
<!-- ObjetcID -->
|
||||
<TextView
|
||||
android:id="@+id/objectid"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/beschreibung"
|
||||
android:layout_marginTop="1dip"
|
||||
android:layout_toRightOf="@+id/thumbnail"
|
||||
android:visibility = "gone"
|
||||
android:textSize="@dimen/rating" />
|
||||
|
||||
<!-- Anzahl -->
|
||||
<TextView
|
||||
android:id="@+id/anzahl"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/objectid"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_toRightOf="@+id/thumbnail"
|
||||
android:textColor="@color/genre"
|
||||
android:visibility = "gone"
|
||||
android:textSize="@dimen/genre" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
57
app/src/main/res/layout/list_row.xml
Normal file
@@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/list_row_selector"
|
||||
android:padding="8dp" >
|
||||
|
||||
<!-- Thumbnail Image -->
|
||||
<com.android.volley.toolbox.NetworkImageView
|
||||
android:id="@+id/thumbnail"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_marginRight="8dp" />
|
||||
|
||||
<!-- Movie Title -->
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignTop="@+id/thumbnail"
|
||||
android:layout_toRightOf="@+id/thumbnail"
|
||||
android:textSize="@dimen/title"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<!-- Rating -->
|
||||
<TextView
|
||||
android:id="@+id/rating"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/title"
|
||||
android:layout_marginTop="1dip"
|
||||
android:layout_toRightOf="@+id/thumbnail"
|
||||
android:textSize="@dimen/rating" />
|
||||
|
||||
<!-- Genre -->
|
||||
<TextView
|
||||
android:id="@+id/genre"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/rating"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_toRightOf="@+id/thumbnail"
|
||||
android:textColor="@color/genre"
|
||||
android:textSize="@dimen/genre" />
|
||||
|
||||
<!-- Release Year -->
|
||||
<TextView
|
||||
android:id="@+id/releaseYear"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:textColor="@color/year"
|
||||
android:textSize="@dimen/year" />
|
||||
|
||||
</RelativeLayout>
|
||||
71
app/src/main/res/layout/list_suchenbyid.xml
Normal file
@@ -0,0 +1,71 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/list_row_selector"
|
||||
android:padding="8dp" >
|
||||
|
||||
<!-- Thumbnail Image -->
|
||||
<com.android.volley.toolbox.NetworkImageView
|
||||
android:id="@+id/thumbnail"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_marginRight="8dp" />
|
||||
|
||||
<!-- Zitat -->
|
||||
<TextView
|
||||
android:id="@+id/zitat"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignTop="@+id/thumbnail"
|
||||
android:layout_toRightOf="@+id/thumbnail"
|
||||
android:textSize="@dimen/zitatlist"
|
||||
android:textStyle="bold" />
|
||||
|
||||
|
||||
<!-- Zitatfooter -->
|
||||
<TextView
|
||||
android:id="@+id/zitatfooter"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/zitat"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_toRightOf="@+id/thumbnail"
|
||||
android:textColor="@color/genre"
|
||||
android:textSize="@dimen/genre" />
|
||||
|
||||
<!-- ObjetcID -->
|
||||
<TextView
|
||||
android:id="@+id/objectid"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/zitatfooter"
|
||||
android:layout_marginTop="1dip"
|
||||
android:layout_toRightOf="@+id/thumbnail"
|
||||
android:visibility = "gone"
|
||||
android:textSize="@dimen/rating" />
|
||||
|
||||
<!-- AutorenID -->
|
||||
<TextView
|
||||
android:id="@+id/autoren_id"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/objectid"
|
||||
android:layout_marginTop="1dip"
|
||||
android:layout_toRightOf="@+id/thumbnail"
|
||||
android:visibility = "gone"
|
||||
android:textSize="@dimen/rating" />
|
||||
|
||||
<!-- KategorieID -->
|
||||
<TextView
|
||||
android:id="@+id/kategorie_id"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/autoren_id"
|
||||
android:layout_marginTop="1dip"
|
||||
android:layout_toRightOf="@+id/thumbnail"
|
||||
android:visibility = "gone"
|
||||
android:textSize="@dimen/rating" />
|
||||
|
||||
</RelativeLayout>
|
||||
38
app/src/main/res/menu/autor_menu.xml
Normal file
@@ -0,0 +1,38 @@
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
|
||||
<item
|
||||
android:id="@+id/action_search"
|
||||
android:orderInCategory="1"
|
||||
android:icon="@drawable/ic_action_search"
|
||||
android:showAsAction="always"
|
||||
android:title="@string/action_search"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/action_refresh"
|
||||
android:orderInCategory="2"
|
||||
android:icon="@drawable/ic_action_refresh"
|
||||
android:showAsAction="always"
|
||||
android:title="@string/action_refresh"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/action_kategorie"
|
||||
android:orderInCategory="3"
|
||||
android:icon="@drawable/ic_action_kategorie"
|
||||
android:showAsAction="never|withText"
|
||||
android:title="@string/action_kategorie"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/action_autoren"
|
||||
android:orderInCategory="4"
|
||||
android:icon="@drawable/ic_action_autor"
|
||||
android:showAsAction="never|withText"
|
||||
android:title="@string/action_autoren"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/action_quit"
|
||||
android:orderInCategory="5"
|
||||
android:icon="@drawable/ic_action_exit"
|
||||
android:showAsAction="never|withText"
|
||||
android:title="@string/action_quit"/>
|
||||
|
||||
</menu>
|
||||
38
app/src/main/res/menu/kategorie_menu.xml
Normal file
@@ -0,0 +1,38 @@
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
|
||||
<item
|
||||
android:id="@+id/action_search"
|
||||
android:orderInCategory="1"
|
||||
android:icon="@drawable/ic_action_search"
|
||||
android:showAsAction="always"
|
||||
android:title="@string/action_search"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/action_refresh"
|
||||
android:orderInCategory="2"
|
||||
android:icon="@drawable/ic_action_refresh"
|
||||
android:showAsAction="always"
|
||||
android:title="@string/action_refresh"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/action_kategorie"
|
||||
android:orderInCategory="3"
|
||||
android:icon="@drawable/ic_action_kategorie"
|
||||
android:showAsAction="never|withText"
|
||||
android:title="@string/action_kategorie"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/action_autoren"
|
||||
android:orderInCategory="4"
|
||||
android:icon="@drawable/ic_action_autor"
|
||||
android:showAsAction="never|withText"
|
||||
android:title="@string/action_autoren"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/action_quit"
|
||||
android:orderInCategory="5"
|
||||
android:icon="@drawable/ic_action_exit"
|
||||
android:showAsAction="never|withText"
|
||||
android:title="@string/action_quit"/>
|
||||
|
||||
</menu>
|
||||
17
app/src/main/res/menu/main_menu.xml
Normal file
@@ -0,0 +1,17 @@
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
|
||||
<item
|
||||
android:id="@+id/action_refresh"
|
||||
android:orderInCategory="1"
|
||||
android:showAsAction="always"
|
||||
android:icon="@drawable/ic_action_refresh"
|
||||
android:title="@string/action_refresh"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/action_quit"
|
||||
android:orderInCategory="2"
|
||||
android:showAsAction="never"
|
||||
android:icon="@drawable/ic_action_exit"
|
||||
android:title="@string/action_quit"/>
|
||||
|
||||
</menu>
|
||||
38
app/src/main/res/menu/news_menu.xml
Normal file
@@ -0,0 +1,38 @@
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
|
||||
<item
|
||||
android:id="@+id/action_search"
|
||||
android:orderInCategory="1"
|
||||
android:icon="@drawable/ic_action_search"
|
||||
android:showAsAction="always"
|
||||
android:title="@string/action_search"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/action_refresh"
|
||||
android:orderInCategory="2"
|
||||
android:icon="@drawable/ic_action_refresh"
|
||||
android:showAsAction="always"
|
||||
android:title="@string/action_refresh"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/action_kategorie"
|
||||
android:orderInCategory="3"
|
||||
android:icon="@drawable/ic_action_kategorie"
|
||||
android:showAsAction="never|withText"
|
||||
android:title="@string/action_kategorie"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/action_autoren"
|
||||
android:orderInCategory="4"
|
||||
android:icon="@drawable/ic_action_autor"
|
||||
android:showAsAction="never|withText"
|
||||
android:title="@string/action_autoren"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/action_quit"
|
||||
android:orderInCategory="5"
|
||||
android:icon="@drawable/ic_action_exit"
|
||||
android:showAsAction="never|withText"
|
||||
android:title="@string/action_quit"/>
|
||||
|
||||
</menu>
|
||||
24
app/src/main/res/menu/search_menu.xml
Normal file
@@ -0,0 +1,24 @@
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
|
||||
<item
|
||||
android:id="@+id/action_kategorie"
|
||||
android:orderInCategory="1"
|
||||
android:icon="@drawable/ic_action_kategorie"
|
||||
android:showAsAction="never|withText"
|
||||
android:title="@string/action_kategorie"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/action_autoren"
|
||||
android:orderInCategory="2"
|
||||
android:icon="@drawable/ic_action_autor"
|
||||
android:showAsAction="never|withText"
|
||||
android:title="@string/action_autoren"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/action_quit"
|
||||
android:orderInCategory="3"
|
||||
android:icon="@drawable/ic_action_exit"
|
||||
android:showAsAction="never|withText"
|
||||
android:title="@string/action_quit"/>
|
||||
|
||||
</menu>
|
||||