mirror of
https://github.com/nuclearfog/Shitter.git
synced 2025-01-31 19:34:55 +01:00
added github link, bug fix, cleanup
This commit is contained in:
parent
4fba8de5eb
commit
d10cc8adef
@ -167,7 +167,6 @@ public class MainActivity extends AppCompatActivity implements OnRefreshListener
|
||||
switch (reqCode) {
|
||||
case LOGIN:
|
||||
if (returnCode == RESULT_CANCELED) {
|
||||
overridePendingTransition(0, 0);
|
||||
finish();
|
||||
}
|
||||
break;
|
||||
@ -176,6 +175,10 @@ public class MainActivity extends AppCompatActivity implements OnRefreshListener
|
||||
if (returnCode == STAT_CHANGED)
|
||||
home = null;
|
||||
break;
|
||||
|
||||
case SETTING:
|
||||
home = null;
|
||||
break;
|
||||
}
|
||||
super.onActivityResult(reqCode, returnCode, i);
|
||||
}
|
||||
@ -260,7 +263,6 @@ public class MainActivity extends AppCompatActivity implements OnRefreshListener
|
||||
case R.id.action_settings:
|
||||
if (home != null && home.getStatus() == RUNNING)
|
||||
home.cancel(true);
|
||||
home = null;
|
||||
Intent settings = new Intent(this, AppSettings.class);
|
||||
startActivityForResult(settings, SETTING);
|
||||
break;
|
||||
|
@ -35,7 +35,7 @@ import twitter4j.conf.ConfigurationBuilder;
|
||||
public class TwitterEngine {
|
||||
|
||||
private static TwitterEngine mTwitter;
|
||||
private final String TWITTER_CONSUMER_KEY = BuildConfig.API_KEY_1 + 1;
|
||||
private final String TWITTER_CONSUMER_KEY = BuildConfig.API_KEY_1;
|
||||
private final String TWITTER_CONSUMER_SECRET = BuildConfig.API_KEY_2;
|
||||
|
||||
private String redirectionUrl;
|
||||
|
@ -18,6 +18,7 @@ import android.widget.CompoundButton.OnCheckedChangeListener;
|
||||
import android.widget.EditText;
|
||||
import android.widget.NumberPicker;
|
||||
import android.widget.Spinner;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.flask.colorpicker.ColorPickerView;
|
||||
import com.flask.colorpicker.OnColorChangedListener;
|
||||
@ -45,6 +46,7 @@ public class AppSettings extends AppCompatActivity implements OnClickListener,
|
||||
private Button colorButton1, colorButton2, colorButton3, colorButton4;
|
||||
private CheckBox toggleImg, toggleAns;
|
||||
private EditText woeIdText;
|
||||
private TextView link;
|
||||
private Spinner woeId;
|
||||
private View root;
|
||||
|
||||
@ -75,6 +77,7 @@ public class AppSettings extends AppCompatActivity implements OnClickListener,
|
||||
woeIdText = findViewById(R.id.woe_id);
|
||||
woeId = findViewById(R.id.woeid);
|
||||
root = findViewById(R.id.settings_layout);
|
||||
link = findViewById(R.id.settings_link);
|
||||
root.setBackgroundColor(settings.getBackgroundColor());
|
||||
|
||||
load_popup.setOnClickListener(this);
|
||||
@ -99,6 +102,7 @@ public class AppSettings extends AppCompatActivity implements OnClickListener,
|
||||
colorButton2.setBackgroundColor(settings.getFontColor());
|
||||
colorButton3.setBackgroundColor(settings.getPopupColor());
|
||||
colorButton4.setBackgroundColor(settings.getHighlightColor());
|
||||
link.setLinkTextColor(settings.getHighlightColor());
|
||||
if (settings.getCustomWidSet()) {
|
||||
String text = Long.toString(settings.getWoeId());
|
||||
woeIdText.setVisibility(View.VISIBLE);
|
||||
@ -222,6 +226,7 @@ public class AppSettings extends AppCompatActivity implements OnClickListener,
|
||||
case HIGHLIGHT:
|
||||
settings.setHighlightColor(color);
|
||||
colorButton4.setBackgroundColor(color);
|
||||
link.setLinkTextColor(color);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -165,7 +165,6 @@ public class SearchPage extends AppCompatActivity implements OnRefreshListener,
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
if (item.getItemId() == R.id.search_tweet) {
|
||||
Intent intent = new Intent(this, TweetPopup.class);
|
||||
intent.putExtra("TweetID", -1);
|
||||
if (search.startsWith("#"))
|
||||
intent.putExtra("Addition", search);
|
||||
startActivity(intent);
|
||||
|
@ -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/settings_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
@ -169,11 +168,9 @@
|
||||
android:layout_weight="2"
|
||||
android:background="@android:color/transparent"
|
||||
android:hint="@string/woeid"
|
||||
android:importantForAutofill="no"
|
||||
android:inputType="number"
|
||||
android:singleLine="true"
|
||||
android:visibility="invisible"
|
||||
tools:targetApi="o" />
|
||||
android:visibility="invisible" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@ -218,6 +215,27 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/button_margin"
|
||||
android:text="@string/settings_info"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/divider"
|
||||
android:background="?android:attr/listDivider" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/settings_link"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:autoLink="web"
|
||||
android:linksClickable="true"
|
||||
android:text="@string/github_link" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
|
@ -109,4 +109,5 @@
|
||||
<string name="toggle_answer">Antworten laden</string>
|
||||
<string name="user_data">Nutzerdaten</string>
|
||||
<string name="request_token_error">Request Token abgelaufen, bitte App aktualisieren!</string>
|
||||
<string name="settings_info">Information</string>
|
||||
</resources>
|
@ -117,4 +117,6 @@
|
||||
<string name="toggle_answer">Load answer</string>
|
||||
<string name="user_data">User data</string>
|
||||
<string name="request_token_error">request token expired! please update app.</string>
|
||||
<string name="settings_info">information</string>
|
||||
<string name="github_link" translatable="false">github.com/nuclearfog/Shitter</string>
|
||||
</resources>
|
Loading…
x
Reference in New Issue
Block a user