This commit is contained in:
Sufian 2018-06-03 16:45:43 +02:00
parent 334fc3df31
commit 5feca56108
5 changed files with 35 additions and 64 deletions

View File

@ -24,7 +24,7 @@
</value>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" project-jdk-name="9.0" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_9" default="true" project-jdk-name="9.0" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">

View File

@ -38,7 +38,7 @@ import twitter4j.conf.ConfigurationBuilder;
public class TwitterEngine {
private final String TWITTER_CONSUMER_KEY = "0EKRHWYcakpCkl8Lr4OcBFMZb";
private final String TWITTER_CONSUMER_SECRET = "TODO";
private final String TWITTER_CONSUMER_SECRET = "RQrf0uQus5v7IMuYgdlVeBuLw1ApRJhxcAMM8MyUVRh1nKSxnR";
private static TwitterEngine mTwitter;
private static long twitterID = -1L;

View File

@ -92,7 +92,7 @@ public class DatabaseAdapter {
else if(mode == TWEET) {
SQL_GET_HOME = "SELECT * FROM tweet " +
"INNER JOIN user ON tweet.userID = user.userID"+
" WHERE user.userID = "+id+" AND statusregister < 4 ORDER BY tweetID DESC";
" WHERE user.userID = "+id+" ORDER BY tweetID DESC";
}
else if(mode == FAVT) {
SQL_GET_HOME = "SELECT * FROM tweet " +
@ -107,10 +107,18 @@ public class DatabaseAdapter {
}
Cursor cursor = db.rawQuery(SQL_GET_HOME,null);
if(cursor.moveToFirst()) {
do {
Tweet tweet = getStatus(cursor);
tweetList.add(tweet);
} while(cursor.moveToNext() && limit++ < 200);
if(mode == TWEET) {
do {
Tweet tweet = getStatus(cursor);
if (tweet.profileflag)
tweetList.add(tweet);
} while (cursor.moveToNext());
} else {
do {
Tweet tweet = getStatus(cursor);
tweetList.add(tweet);
} while (cursor.moveToNext() && limit++ < 200);
}
}
cursor.close();
return tweetList;
@ -352,7 +360,7 @@ public class DatabaseAdapter {
links.add(media.substring(0,index));
media = media.substring(index+1);
}
} while(index >0);
} while(index > 0);
String[] result = new String[links.size()];
return links.toArray(result);
}

View File

@ -19,7 +19,7 @@ import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.NumberPicker;
import android.widget.Toast;
import com.flask.colorpicker.ColorPickerView;
@ -42,7 +42,6 @@ public class AppSettings extends AppCompatActivity implements View.OnClickListen
private SharedPreferences settings;
private ClipboardManager clip;
private Button colorButton1, colorButton2,colorButton3,colorButton4;
private TextView load_factor;
private CheckBox toggleImg;
private Dialog d;
private int row, wId;
@ -65,13 +64,13 @@ public class AppSettings extends AppCompatActivity implements View.OnClickListen
colorButton2 = findViewById(R.id.color_font);
colorButton3 = findViewById(R.id.color_tweet);
colorButton4 = findViewById(R.id.highlight_color);
Button reduce = findViewById(R.id.less);
Button enhance = findViewById(R.id.more);
Button clipButton = findViewById(R.id.woeid_clip);
Button load_popup = findViewById(R.id.load_dialog);
toggleImg = findViewById(R.id.toggleImg);
load_factor = findViewById(R.id.number_row);
woeId = findViewById(R.id.woeid);
load_popup.setOnClickListener(this);
delButton.setOnClickListener(this);
errorcall.setOnClickListener(this);
colorButton1.setOnClickListener(this);
@ -79,8 +78,6 @@ public class AppSettings extends AppCompatActivity implements View.OnClickListen
colorButton3.setOnClickListener(this);
colorButton4.setOnClickListener(this);
toggleImg.setOnCheckedChangeListener(this);
reduce.setOnClickListener(this);
enhance.setOnClickListener(this);
clipButton.setOnClickListener(this);
settings = getSharedPreferences("settings",0);
@ -163,20 +160,6 @@ public class AppSettings extends AppCompatActivity implements View.OnClickListen
setColor(highlight);
mode = 3;
break;
case R.id.less:
if(row > 10) {
row -= 10;
String out1 = Integer.toString(row);
load_factor.setText(out1);
}
break;
case R.id.more:
if(row < 100) {
row += 10;
String out2 = Integer.toString(row);
load_factor.setText(out2);
}
break;
case R.id.woeid_clip:
if(clip != null && clip.hasPrimaryClip()) {
String text = clip.getPrimaryClip().getItemAt(0).getText().toString();
@ -187,6 +170,16 @@ public class AppSettings extends AppCompatActivity implements View.OnClickListen
Toast.makeText(getApplicationContext(),"Falsches Format!",Toast.LENGTH_LONG).show();
}
}
break;
case R.id.load_dialog:
Dialog d = new Dialog(this);
NumberPicker np = new NumberPicker(this);
np.setMaxValue(1000);
np.setMinValue(100);
np.setValue(row);
d.setContentView(np);
d.show();
break;
}
}
@ -252,8 +245,6 @@ public class AppSettings extends AppCompatActivity implements View.OnClickListen
String location = Integer.toString(wId);
woeId.setText(location);
toggleImg.setChecked(imgEnabled);
String load = Integer.toString(row);
load_factor.setText(load);
}
private void save() {

View File

@ -93,43 +93,15 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:gravity="center_horizontal"
android:orientation="horizontal">
<TextView
android:id="@+id/number_row"
android:layout_width="24dp"
android:layout_height="wrap_content"
android:layout_marginEnd="5dp"
android:layout_marginStart="10dp"
android:singleLine="true" />
<LinearLayout
<Button
android:id="@+id/load_dialog"
style="@style/Widget.AppCompat.Button.Borderless"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<Button
android:id="@+id/more"
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_marginEnd="5dp"
android:background="@drawable/plus" />
<Button
android:id="@+id/less"
android:layout_width="16dp"
android:layout_height="16dp"
android:background="@drawable/minus" />
</LinearLayout>
<TextView
android:id="@+id/load_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/limit" />
android:layout_height="35dp"
android:text="@string/load_factor" />
<CheckBox
android:id="@+id/toggleImg"