Major Enhancements
@ -2,6 +2,7 @@ package org.nuclearfog.twidda.DataBase;
|
||||
|
||||
import android.content.ContentValues;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.database.Cursor;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
|
||||
@ -69,7 +70,6 @@ public class TrendDatabase {
|
||||
|
||||
private void store(){
|
||||
SQLiteDatabase db = dataHelper.getWritableDatabase();
|
||||
|
||||
ContentValues trend = new ContentValues();
|
||||
for(int pos = 0; pos < getSize(); pos++) {
|
||||
trend.put("trendpos", getTrendpos(pos));
|
||||
@ -87,6 +87,9 @@ public class TrendDatabase {
|
||||
}
|
||||
|
||||
private void setup() {
|
||||
SharedPreferences settings = c.getSharedPreferences("settings", 0);
|
||||
SharedPreferences.Editor e = settings.edit();
|
||||
e.putString("location", trends.getLocation().getName()).apply();
|
||||
for(Trend trend : trends.getTrends()) {
|
||||
trendName.add(trend.getName());
|
||||
trendLink.add(trend.getURL());
|
||||
|
@ -5,6 +5,7 @@ import org.nuclearfog.twidda.R;
|
||||
|
||||
import android.content.ContentValues;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.database.Cursor;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
|
||||
@ -25,6 +26,7 @@ public class TweetDatabase {
|
||||
private Context c;
|
||||
private int size = 0;
|
||||
private int mode = 0;
|
||||
private SharedPreferences settings;
|
||||
|
||||
/**
|
||||
* Store & Read Data
|
||||
@ -35,7 +37,7 @@ public class TweetDatabase {
|
||||
this.c=c;
|
||||
this.mode=mode;
|
||||
dataHelper = AppDatabase.getInstance(c);
|
||||
|
||||
settings = c.getSharedPreferences("settings", 0);
|
||||
initArray();
|
||||
store();
|
||||
load();
|
||||
@ -49,6 +51,7 @@ public class TweetDatabase {
|
||||
this.c=c;
|
||||
this.mode=mode;
|
||||
dataHelper = AppDatabase.getInstance(c);
|
||||
settings = c.getSharedPreferences("settings", 0);
|
||||
initArray();
|
||||
load();
|
||||
}
|
||||
@ -106,7 +109,7 @@ public class TweetDatabase {
|
||||
tweet.add( cursor.getString(index) );
|
||||
index = cursor.getColumnIndex("retweet"); // retweet
|
||||
noRT.add( cursor.getString(index) );
|
||||
index = cursor.getColumnIndex("favorite"); // favorite
|
||||
index = cursor.getColumnIndex("favorite"); // fav
|
||||
noFav.add( cursor.getString(index) );
|
||||
index = cursor.getColumnIndex("answers"); // answers
|
||||
noAns.add( cursor.getString(index) );
|
||||
@ -140,6 +143,9 @@ public class TweetDatabase {
|
||||
public String getDate(int pos){return timeToString(getTime(pos));}
|
||||
public String getAnswer(int pos){return noAns.get(pos);}
|
||||
public String getPbImg (int pos){return pbLink.get(pos);}
|
||||
public boolean loadImages(){
|
||||
return settings.getBoolean("image_load", false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert Time to String
|
||||
|
@ -0,0 +1,37 @@
|
||||
package org.nuclearfog.twidda.Engine;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.os.AsyncTask;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.net.URL;
|
||||
|
||||
|
||||
public class ImageDownloader extends AsyncTask<String, Void, Bitmap>
|
||||
{
|
||||
private ImageView imgView;
|
||||
|
||||
public ImageDownloader( ImageView imgView){
|
||||
this.imgView = imgView;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Bitmap doInBackground(String... links){
|
||||
Bitmap picture = null;
|
||||
|
||||
try {
|
||||
InputStream iStream = new URL(links[0]).openStream();
|
||||
picture = BitmapFactory.decodeStream(iStream);
|
||||
} catch(Exception err) {
|
||||
err.printStackTrace();
|
||||
}
|
||||
return picture;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostExecute(Bitmap img){
|
||||
imgView.setImageBitmap(img);
|
||||
}
|
||||
}
|
@ -0,0 +1,68 @@
|
||||
package org.nuclearfog.twidda.Engine;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.AsyncTask;
|
||||
import android.widget.TextView;
|
||||
|
||||
import org.nuclearfog.twidda.R;
|
||||
import org.nuclearfog.twidda.Window.Profile;
|
||||
|
||||
import twitter4j.Twitter;
|
||||
import twitter4j.User;
|
||||
|
||||
public class ProfileInformation extends AsyncTask<Long,Void,Void>
|
||||
{
|
||||
private Context context,toClass;
|
||||
private String screenName, username, description, location, follower, following;
|
||||
private TextView txtUser,txtScrName, txtBio,txtLocation,txtFollowing,txtFollower;
|
||||
|
||||
/**
|
||||
* @param context "this" Context
|
||||
*/
|
||||
public ProfileInformation(Context context) {
|
||||
this.context=context;
|
||||
this.toClass = toClass;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onPreExecute() {
|
||||
txtUser = (TextView) ((Profile)context).findViewById(R.id.profile_username);
|
||||
txtScrName =(TextView) ((Profile)context).findViewById(R.id.profile_screenname);
|
||||
txtBio = (TextView)((Profile)context).findViewById(R.id.bio);
|
||||
txtLocation = (TextView)((Profile)context).findViewById(R.id.location);
|
||||
txtFollowing = (TextView)((Profile)context).findViewById(R.id.following);
|
||||
txtFollower = (TextView)((Profile)context).findViewById(R.id.follower);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param args [0] Username
|
||||
*/
|
||||
@Override
|
||||
protected Void doInBackground(Long... args) {
|
||||
TwitterStore mTwitter = TwitterStore.getInstance(context);
|
||||
Twitter twitter = mTwitter.getTwitter();
|
||||
try {
|
||||
User user = twitter.showUser(args[0]);
|
||||
screenName = user.getScreenName();
|
||||
username = "@"+ user.getName();
|
||||
description = user.getDescription();
|
||||
location = user.getLocation();
|
||||
follower = "Follower: "+ user.getFollowersCount();
|
||||
following = "Following: "+user.getFriendsCount();
|
||||
} catch(Exception err){err.printStackTrace();}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onPostExecute(Void v) {
|
||||
txtUser.setText(username);
|
||||
txtScrName.setText(screenName);
|
||||
txtBio.setText(description);
|
||||
txtLocation.setText(location);
|
||||
txtFollower.setText(follower);
|
||||
txtFollowing.setText(following);
|
||||
}
|
||||
}
|
@ -1,35 +1,19 @@
|
||||
package org.nuclearfog.twidda.Engine;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.net.Uri;
|
||||
import android.os.AsyncTask;
|
||||
import android.widget.Button;
|
||||
import android.widget.Toast;
|
||||
import twitter4j.Twitter;
|
||||
import twitter4j.TwitterException;
|
||||
import twitter4j.TwitterFactory;
|
||||
import twitter4j.auth.AccessToken;
|
||||
import twitter4j.auth.RequestToken;
|
||||
import twitter4j.conf.Configuration;
|
||||
import twitter4j.conf.ConfigurationBuilder;
|
||||
|
||||
public class RegisterAccount extends AsyncTask<String, Void, Boolean> {
|
||||
|
||||
private final String TWITTER_CONSUMER_KEY = "GrylGIgQK3cDjo9mSTBqF1vwf";
|
||||
private final String TWITTER_CONSUMER_SECRET = "pgaWUlDVS5b7Q6VJQDgBzHKw0mIxJIX0UQBcT1oFJEivsCl5OV";
|
||||
|
||||
|
||||
public class RegisterAccount extends AsyncTask<String, Void, Boolean>
|
||||
{
|
||||
private TwitterStore mTwitter;
|
||||
|
||||
private Button loginButton, verifierButton;
|
||||
private SharedPreferences einstellungen;
|
||||
private Context context;
|
||||
|
||||
public RegisterAccount( Context context ){
|
||||
this.context = context;
|
||||
einstellungen = context.getSharedPreferences("settings", 0);
|
||||
}
|
||||
|
||||
public void setButton( Button loginButton, Button verifierButton ) {
|
||||
|
@ -119,6 +119,7 @@ public class TwitterStore {
|
||||
* @return Twitter Object
|
||||
*/
|
||||
public Twitter getTwitter(){
|
||||
init();
|
||||
return twitter;
|
||||
}
|
||||
|
||||
@ -139,7 +140,7 @@ public class TwitterStore {
|
||||
|
||||
/**
|
||||
* Store user id + keys into sqlite database
|
||||
* @param username Screenname of User
|
||||
* @param username Screen name of User
|
||||
* @param userId unique User ID
|
||||
* @param key1 First Key of Access-token
|
||||
* @param key2 Second Key of Access-Token
|
||||
@ -161,7 +162,7 @@ public class TwitterStore {
|
||||
|
||||
/**
|
||||
* Singleton
|
||||
* @param context Main Thread Contet
|
||||
* @param context Main Thread Context
|
||||
* @return TwitterStore Instance
|
||||
*/
|
||||
public static TwitterStore getInstance(Context context) {
|
||||
|
@ -31,11 +31,14 @@ public class MainActivity extends AppCompatActivity
|
||||
{
|
||||
private Button linkButton, verifierButton, loginButton;
|
||||
private SwipeRefreshLayout refresh;
|
||||
private SharedPreferences settings;
|
||||
private EditText pin;
|
||||
private Context con;
|
||||
private TabHost tabhost;
|
||||
private ListView list;
|
||||
private Toolbar toolbar;
|
||||
private String currentTab = "timeline";
|
||||
private Menu menu;
|
||||
|
||||
/**
|
||||
* Create Activity
|
||||
@ -44,9 +47,9 @@ public class MainActivity extends AppCompatActivity
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
con = getApplicationContext();
|
||||
SharedPreferences settings = con.getSharedPreferences("settings", 0);
|
||||
settings = con.getSharedPreferences("settings", 0);
|
||||
if( !(settings.getBoolean("login", false)) ) {
|
||||
setContentView(R.layout.activity_login);
|
||||
setContentView(R.layout.login);
|
||||
pin = (EditText) findViewById(R.id.pin);
|
||||
linkButton = (Button) findViewById(R.id.linkButton);
|
||||
verifierButton = (Button) findViewById(R.id.verifier);
|
||||
@ -65,7 +68,8 @@ public class MainActivity extends AppCompatActivity
|
||||
*/
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu m) {
|
||||
getMenuInflater().inflate(R.menu.buttons, m);
|
||||
toolbar.inflateMenu(R.menu.home);
|
||||
setToolbar();
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -80,7 +84,7 @@ public class MainActivity extends AppCompatActivity
|
||||
case R.id.action_profile:
|
||||
intent = new Intent(this, Profile.class);
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString("username","home");
|
||||
bundle.putLong("userID",settings.getLong("userID", -1));
|
||||
intent.putExtras(bundle);
|
||||
startActivity(intent);
|
||||
break;
|
||||
@ -122,12 +126,12 @@ public class MainActivity extends AppCompatActivity
|
||||
* Login Handle
|
||||
*/
|
||||
private void login() {
|
||||
setContentView(R.layout.main_layout);
|
||||
setContentView(R.layout.mainpage);
|
||||
list = (ListView) findViewById(R.id.list);
|
||||
setRefreshListener();
|
||||
setTabListener();
|
||||
Toolbar tool = (Toolbar) findViewById(R.id.toolbar);
|
||||
setSupportActionBar(tool);
|
||||
toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||
setSupportActionBar(toolbar);
|
||||
getSupportActionBar().setDisplayShowTitleEnabled(false);
|
||||
}
|
||||
|
||||
@ -152,8 +156,10 @@ public class MainActivity extends AppCompatActivity
|
||||
tabhost.setOnTabChangedListener(new TabHost.OnTabChangeListener() {
|
||||
@Override
|
||||
public void onTabChanged(String tabId) {
|
||||
if(refresh.isRefreshing()){ refresh.setRefreshing(false);}
|
||||
currentTab = tabId;
|
||||
setTabContent();
|
||||
setToolbar();
|
||||
}
|
||||
});
|
||||
setTabContent();
|
||||
@ -212,4 +218,31 @@ public class MainActivity extends AppCompatActivity
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Toolbar Items
|
||||
*/
|
||||
private void setToolbar() {
|
||||
MenuItem profile = toolbar.getMenu().findItem(R.id.action_profile);
|
||||
MenuItem search = toolbar.getMenu().findItem(R.id.action_search);
|
||||
MenuItem tweet = toolbar.getMenu().findItem(R.id.action_tweet);
|
||||
|
||||
switch(currentTab){
|
||||
case "timeline":
|
||||
profile.setVisible(true);
|
||||
search.setVisible(false);
|
||||
tweet.setVisible(true);
|
||||
break;
|
||||
case "trends":
|
||||
profile.setVisible(false);
|
||||
search.setVisible(true);
|
||||
tweet.setVisible(false);
|
||||
break;
|
||||
case "mention":
|
||||
profile.setVisible(false);
|
||||
search.setVisible(false);
|
||||
tweet.setVisible(false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
@ -5,8 +5,10 @@ import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import org.nuclearfog.twidda.Engine.ImageDownloader;
|
||||
import org.nuclearfog.twidda.R;
|
||||
import org.nuclearfog.twidda.DataBase.TweetDatabase;
|
||||
|
||||
@ -37,6 +39,11 @@ public class TimelineAdapter extends ArrayAdapter {
|
||||
((TextView) v.findViewById(R.id.retweet_number)).setText(mTweets.getRetweet(position));
|
||||
((TextView) v.findViewById(R.id.favorite_number)).setText(mTweets.getFavorite(position));
|
||||
((TextView) v.findViewById(R.id.time)).setText(mTweets.getDate(position));
|
||||
if(mTweets.loadImages()) {
|
||||
ImageView imgView = v.findViewById(R.id.tweetPb);
|
||||
ImageDownloader imgDl = new ImageDownloader(imgView);
|
||||
imgDl.execute(mTweets.getPbImg(position));
|
||||
}
|
||||
return v;
|
||||
}
|
||||
}
|
@ -8,11 +8,13 @@ import android.support.v7.app.AppCompatActivity;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ListView;
|
||||
import android.widget.TabHost;
|
||||
import android.widget.TextView;
|
||||
|
||||
import org.nuclearfog.twidda.Engine.ProfileInformation;
|
||||
import org.nuclearfog.twidda.R;
|
||||
import org.nuclearfog.twidda.Engine.TwitterEngine;
|
||||
|
||||
@ -23,7 +25,7 @@ public class Profile extends AppCompatActivity {
|
||||
private TextView username, bio,link,following;
|
||||
private ImageView profile_img, profile_banner;
|
||||
private SwipeRefreshLayout refresh;
|
||||
private String value;
|
||||
private long userId;
|
||||
private Context context;
|
||||
|
||||
|
||||
@ -34,23 +36,18 @@ public class Profile extends AppCompatActivity {
|
||||
Toolbar tool = (Toolbar) findViewById(R.id.profile_toolbar);
|
||||
setSupportActionBar(tool);
|
||||
getSupportActionBar().setDisplayShowTitleEnabled(false);
|
||||
value = getIntent().getExtras().getString("username");
|
||||
userId = getIntent().getExtras().getLong("userID");
|
||||
context = getApplicationContext();
|
||||
initElements();
|
||||
initTabs();
|
||||
initSwipe();
|
||||
loadProfile();
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy(){
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu m) {
|
||||
getMenuInflater().inflate(R.menu.buttons, m);
|
||||
getMenuInflater().inflate(R.menu.home, m);
|
||||
m.findItem(R.id.action_profile).setVisible(false);
|
||||
return true;
|
||||
}
|
||||
@ -103,13 +100,8 @@ public class Profile extends AppCompatActivity {
|
||||
* Profile Contents
|
||||
*/
|
||||
private void initElements() {
|
||||
homeTl = (ListView) findViewById(R.id.home_tl);
|
||||
username = (TextView) findViewById(R.id.my_username);
|
||||
bio = (TextView) findViewById(R.id.bio);
|
||||
link = (TextView) findViewById(R.id.links);
|
||||
following = (TextView) findViewById(R.id.follow);
|
||||
profile_img = (ImageView) findViewById(R.id.profile_img);
|
||||
profile_banner = (ImageView) findViewById(R.id.banner);
|
||||
ProfileInformation profile = new ProfileInformation(this);
|
||||
profile.execute(userId);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -120,23 +112,23 @@ public class Profile extends AppCompatActivity {
|
||||
refresh.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
|
||||
@Override
|
||||
public void onRefresh() {
|
||||
|
||||
getTweets();
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void getTweets(){
|
||||
|
||||
TwitterEngine twitterEngine = new TwitterEngine(context, homeTl);
|
||||
twitterEngine.setRefresh(refresh);
|
||||
switch(value) {
|
||||
/*switch(value) {
|
||||
case "home":
|
||||
twitterEngine.execute(3);
|
||||
break;
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
private void loadProfile() {
|
||||
ImageView pb = (ImageView) findViewById(R.id.profile_img);
|
||||
ImageView banner = (ImageView) findViewById(R.id.banner);//TODO
|
||||
}
|
||||
}
|
||||
|
@ -5,6 +5,10 @@ import android.os.Bundle;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.EditText;
|
||||
import android.widget.Switch;
|
||||
|
||||
import org.nuclearfog.twidda.R;
|
||||
|
||||
@ -19,7 +23,22 @@ public class Settings extends AppCompatActivity {
|
||||
setContentView(R.layout.settings);
|
||||
Toolbar tool = (Toolbar) findViewById(R.id.toolbar_setting);
|
||||
setSupportActionBar(tool);
|
||||
getSupportActionBar().setDisplayShowTitleEnabled(false);
|
||||
|
||||
Switch toggleImg = (Switch) findViewById(R.id.toggleImg);
|
||||
toggleImg.setChecked(settings.getBoolean("image_load",false));
|
||||
toggleImg.setOnCheckedChangeListener(
|
||||
new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton b, boolean checked){
|
||||
SharedPreferences.Editor e = settings.edit();
|
||||
e.putBoolean("image_load", checked);
|
||||
e.apply();
|
||||
}
|
||||
});
|
||||
|
||||
EditText locationField = (EditText) findViewById(R.id.location_edit);
|
||||
locationField.setText(settings.getString("location",""));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -27,12 +46,21 @@ public class Settings extends AppCompatActivity {
|
||||
*/
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu m) {
|
||||
getMenuInflater().inflate(R.menu.buttons, m);
|
||||
m.findItem(R.id.action_profile).setVisible(false);
|
||||
m.findItem(R.id.action_settings).setVisible(false);
|
||||
m.findItem(R.id.action_tweet).setVisible(false);
|
||||
|
||||
getMenuInflater().inflate(R.menu.setting, m);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Actionbar selection
|
||||
*/
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
switch(item.getItemId())
|
||||
{
|
||||
case R.id.back_settings:
|
||||
finish();
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,5 @@
|
||||
package org.nuclearfog.twidda.Window;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.view.View;
|
||||
@ -9,12 +8,8 @@ import android.widget.EditText;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import org.nuclearfog.twidda.Engine.SendStatus;
|
||||
import org.nuclearfog.twidda.Engine.TwitterStore;
|
||||
import org.nuclearfog.twidda.R;
|
||||
|
||||
import twitter4j.Twitter;
|
||||
import twitter4j.TwitterException;
|
||||
|
||||
|
||||
public class TweetWindow extends AppCompatActivity {
|
||||
|
||||
@ -24,7 +19,7 @@ public class TweetWindow extends AppCompatActivity {
|
||||
protected void onCreate(Bundle SavedInstance){
|
||||
super.onCreate(SavedInstance);
|
||||
getWindow().setLayout(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
|
||||
setContentView(R.layout.tweet_popup);
|
||||
setContentView(R.layout.tweetwindow);
|
||||
tweetfield = (EditText) findViewById(R.id.tweet_input);
|
||||
|
||||
Button closeButton = (Button) findViewById(R.id.close);
|
||||
|
Before Width: | Height: | Size: 9.3 KiB |
4
app/src/main/res/drawable/chat.xml
Normal file
@ -0,0 +1,4 @@
|
||||
<vector android:height="24dp" android:viewportHeight="20.0"
|
||||
android:viewportWidth="20.0" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#FFFFFF" android:pathData="M5.8,12.2V6H2C0.9,6 0,6.9 0,8v6c0,1.1 0.9,2 2,2h1v3l3,-3h5c1.1,0 2,-0.9 2,-2v-1.82c-0.064,0.014 -0.132,0.021 -0.2,0.021h-7V12.2zM18,1H9C7.9,1 7,1.9 7,3v8h7l3,3v-3h1c1.1,0 2,-0.899 2,-2V3C20,1.9 19.1,1 18,1z"/>
|
||||
</vector>
|
4
app/src/main/res/drawable/favorite.xml
Normal file
@ -0,0 +1,4 @@
|
||||
<vector android:height="24dp" android:viewportHeight="20.0"
|
||||
android:viewportWidth="20.0" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#FFFFFF" android:pathData="M10,1.3l2.388,6.722H18.8l-5.232,3.948l1.871,6.928L10,14.744l-5.438,4.154l1.87,-6.928L1.199,8.022h6.412L10,1.3z"/>
|
||||
</vector>
|
Before Width: | Height: | Size: 4.5 KiB |
4
app/src/main/res/drawable/retweet.xml
Normal file
@ -0,0 +1,4 @@
|
||||
<vector android:height="24dp" android:viewportHeight="20.0"
|
||||
android:viewportWidth="20.0" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#FFFFFF" android:pathData="M5,13V8h2L3.5,4L0,8h2v6c0,1.104 0.895,2 2,2h9.482l-2.638,-3H5zM9.156,7L6.518,4H16c1.104,0 2,0.897 2,2v6h2l-3.5,4L13,12h2V7H9.156z"/>
|
||||
</vector>
|
9
app/src/main/res/drawable/search.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="#FFFFFFFF"
|
||||
android:pathData="M15.5,14h-0.79l-0.28,-0.27C15.41,12.59 16,11.11 16,9.5 16,5.91 13.09,3 9.5,3S3,5.91 3,9.5 5.91,16 9.5,16c1.61,0 3.09,-0.59 4.23,-1.57l0.27,0.28v0.79l5,4.99L20.49,19l-4.99,-5zM9.5,14C7.01,14 5,11.99 5,9.5S7.01,5 9.5,5 14,7.01 14,9.5 11.99,14 9.5,14z"/>
|
||||
</vector>
|
Before Width: | Height: | Size: 10 KiB |
@ -1,6 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/test"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
@ -26,14 +26,13 @@
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="94dp"
|
||||
android:layout_height="96dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/profile_img"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_width="96dp"
|
||||
android:layout_height="96dp"
|
||||
android:contentDescription="profile picture"
|
||||
app:srcCompat="@color/soylentgreen" />
|
||||
|
||||
@ -43,37 +42,72 @@
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/my_username"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@username" />
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/profile_screenname"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/profile_username"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bio"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="Bio" />
|
||||
android:layout_weight="1" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/links"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="standort weblink" />
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/location"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/links"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/following"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/follower"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/follow"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="following" />
|
||||
|
||||
<TabHost
|
||||
android:id="@+id/tabhost"
|
||||
android:layout_width="match_parent"
|
||||
|
@ -17,4 +17,11 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/image" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/location_edit"
|
||||
android:layout_width="180dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:ems="10"
|
||||
android:inputType="textPersonName" />
|
||||
|
||||
</LinearLayout>
|
||||
|
@ -12,7 +12,6 @@
|
||||
android:id="@+id/user"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
@ -38,7 +37,7 @@
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView"
|
||||
android:id="@+id/tweetPb"
|
||||
android:layout_width="64dp"
|
||||
android:layout_height="64dp"
|
||||
android:contentDescription="@string/profile_image" />
|
||||
@ -53,7 +52,7 @@
|
||||
<LinearLayout
|
||||
android:id="@+id/actionbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="32dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_weight="1"
|
||||
android:addStatesFromChildren="false"
|
||||
android:gravity="right"
|
||||
@ -61,8 +60,8 @@
|
||||
|
||||
<Button
|
||||
android:id="@+id/answer"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:background="@drawable/chat" />
|
||||
|
||||
<TextView
|
||||
@ -73,8 +72,8 @@
|
||||
|
||||
<Button
|
||||
android:id="@+id/retweet"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:background="@drawable/retweet" />
|
||||
|
||||
<TextView
|
||||
@ -85,9 +84,9 @@
|
||||
|
||||
<Button
|
||||
android:id="@+id/favorite"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/star" />
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:background="@drawable/favorite" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/favorite_number"
|
||||
|
@ -10,7 +10,8 @@
|
||||
<EditText
|
||||
android:id="@+id/tweet_input"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="160dp" />
|
||||
android:layout_height="160dp"
|
||||
android:inputType="text" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
@ -1,20 +1,30 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<!--Tweet-->
|
||||
<item
|
||||
android:id="@+id/action_tweet"
|
||||
android:icon="@drawable/tweet_icon"
|
||||
android:title="@string/tweet"
|
||||
android:visible="true"
|
||||
app:showAsAction="always" />
|
||||
<!--Profile-->
|
||||
<item
|
||||
android:id="@+id/action_profile"
|
||||
android:icon="@drawable/ic_user"
|
||||
android:icon="@drawable/user"
|
||||
android:title="@string/profile"
|
||||
android:visible="true"
|
||||
app:showAsAction="ifRoom" />
|
||||
<!--Settings-->
|
||||
|
||||
<item
|
||||
android:id="@+id/action_search"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:checkable="false"
|
||||
android:icon="@drawable/search"
|
||||
android:title="Search"
|
||||
app:actionViewClass="android.widget.SearchView"
|
||||
app:showAsAction="always" />
|
||||
<item
|
||||
android:id="@+id/action_settings"
|
||||
android:icon="@drawable/setting_icon"
|
12
app/src/main/res/menu/setting.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item
|
||||
android:id="@+id/back_settings"
|
||||
android:checkable="false"
|
||||
android:icon="@drawable/back"
|
||||
android:title="@string/back"
|
||||
android:visible="true"
|
||||
app:showAsAction="always" />
|
||||
</menu>
|
Before Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 4.7 KiB |
Before Width: | Height: | Size: 7.5 KiB |
Before Width: | Height: | Size: 10 KiB |