earn details in settings
This commit is contained in:
parent
f35b552e38
commit
61e2d5b5d6
|
|
@ -5,6 +5,8 @@ public class SettingsData {
|
||||||
public String profileName;
|
public String profileName;
|
||||||
public String apiUrl;
|
public String apiUrl;
|
||||||
public String apiKey;
|
public String apiKey;
|
||||||
|
public boolean useEarn;
|
||||||
|
public String earnApiKey;
|
||||||
public boolean useTelegram;
|
public boolean useTelegram;
|
||||||
public String botToken;
|
public String botToken;
|
||||||
public String chatId;
|
public String chatId;
|
||||||
|
|
@ -16,6 +18,8 @@ public class SettingsData {
|
||||||
String profileName,
|
String profileName,
|
||||||
String apiUrl,
|
String apiUrl,
|
||||||
String apiKey,
|
String apiKey,
|
||||||
|
boolean useEarn,
|
||||||
|
String earnApiKey,
|
||||||
boolean useTelegram,
|
boolean useTelegram,
|
||||||
String botToken,
|
String botToken,
|
||||||
String chatId,
|
String chatId,
|
||||||
|
|
@ -26,6 +30,8 @@ public class SettingsData {
|
||||||
this.profileName = profileName;
|
this.profileName = profileName;
|
||||||
this.apiUrl = apiUrl;
|
this.apiUrl = apiUrl;
|
||||||
this.apiKey = apiKey;
|
this.apiKey = apiKey;
|
||||||
|
this.useEarn = useEarn;
|
||||||
|
this.earnApiKey = earnApiKey;
|
||||||
this.useTelegram = useTelegram;
|
this.useTelegram = useTelegram;
|
||||||
this.botToken = botToken;
|
this.botToken = botToken;
|
||||||
this.chatId = chatId;
|
this.chatId = chatId;
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,8 @@ public class SettingsFragment extends Fragment {
|
||||||
EditText editProfileName = root.findViewById(R.id.editProfileName);
|
EditText editProfileName = root.findViewById(R.id.editProfileName);
|
||||||
EditText editApiUrl = root.findViewById(R.id.editApiUrl);
|
EditText editApiUrl = root.findViewById(R.id.editApiUrl);
|
||||||
EditText editApiKey = root.findViewById(R.id.editApiKey);
|
EditText editApiKey = root.findViewById(R.id.editApiKey);
|
||||||
|
CheckBox useEarn = root.findViewById(R.id.useEarn);
|
||||||
|
EditText editEarnApiKey = root.findViewById(R.id.earnApiKey);
|
||||||
CheckBox checkBox = root.findViewById(R.id.useTelegram);
|
CheckBox checkBox = root.findViewById(R.id.useTelegram);
|
||||||
EditText editBotToken = root.findViewById(R.id.editBotToken);
|
EditText editBotToken = root.findViewById(R.id.editBotToken);
|
||||||
EditText editChatId = root.findViewById(R.id.editChatId);
|
EditText editChatId = root.findViewById(R.id.editChatId);
|
||||||
|
|
@ -46,6 +48,8 @@ public class SettingsFragment extends Fragment {
|
||||||
editProfileName.setText(settingsData.profileName);
|
editProfileName.setText(settingsData.profileName);
|
||||||
editApiUrl.setText(settingsData.apiUrl);
|
editApiUrl.setText(settingsData.apiUrl);
|
||||||
editApiKey.setText(settingsData.apiKey);
|
editApiKey.setText(settingsData.apiKey);
|
||||||
|
useEarn.setChecked(settingsData.useEarn);
|
||||||
|
editEarnApiKey.setText(settingsData.earnApiKey);
|
||||||
checkBox.setChecked(settingsData.useTelegram);
|
checkBox.setChecked(settingsData.useTelegram);
|
||||||
editBotToken.setText(settingsData.botToken);
|
editBotToken.setText(settingsData.botToken);
|
||||||
editChatId.setText(settingsData.chatId);
|
editChatId.setText(settingsData.chatId);
|
||||||
|
|
@ -72,6 +76,8 @@ public class SettingsFragment extends Fragment {
|
||||||
String profileName = editProfileName.getText().toString();
|
String profileName = editProfileName.getText().toString();
|
||||||
String apiUrl = editApiUrl.getText().toString();
|
String apiUrl = editApiUrl.getText().toString();
|
||||||
String apiKey = editApiKey.getText().toString();
|
String apiKey = editApiKey.getText().toString();
|
||||||
|
boolean useEarn = checkBox.isChecked();
|
||||||
|
String earnApiKey = editEarnApiKey.getText().toString();
|
||||||
boolean useTelegram = checkBox.isChecked();
|
boolean useTelegram = checkBox.isChecked();
|
||||||
String botToken = editBotToken.getText().toString();
|
String botToken = editBotToken.getText().toString();
|
||||||
String chatId = editChatId.getText().toString();
|
String chatId = editChatId.getText().toString();
|
||||||
|
|
@ -119,6 +125,8 @@ public class SettingsFragment extends Fragment {
|
||||||
profileName,
|
profileName,
|
||||||
apiUrl,
|
apiUrl,
|
||||||
apiKey,
|
apiKey,
|
||||||
|
useEarn,
|
||||||
|
earnApiKey,
|
||||||
useTelegram,
|
useTelegram,
|
||||||
botToken,
|
botToken,
|
||||||
chatId,
|
chatId,
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,8 @@ public class SettingsViewModel extends ViewModel {
|
||||||
public String profileName;
|
public String profileName;
|
||||||
public String apiUrl;
|
public String apiUrl;
|
||||||
public String apiKey;
|
public String apiKey;
|
||||||
|
public boolean useEarn;
|
||||||
|
public String earnApiKey;
|
||||||
public boolean useTelegram;
|
public boolean useTelegram;
|
||||||
public String botToken;
|
public String botToken;
|
||||||
public String chatId;
|
public String chatId;
|
||||||
|
|
@ -29,6 +31,8 @@ public class SettingsViewModel extends ViewModel {
|
||||||
String profileName,
|
String profileName,
|
||||||
String apiUrl,
|
String apiUrl,
|
||||||
String apiKey,
|
String apiKey,
|
||||||
|
boolean useEarn,
|
||||||
|
String earnApiKey,
|
||||||
boolean useTelegram,
|
boolean useTelegram,
|
||||||
String botToken,
|
String botToken,
|
||||||
String chatId,
|
String chatId,
|
||||||
|
|
@ -41,6 +45,8 @@ public class SettingsViewModel extends ViewModel {
|
||||||
this.profileName = profileName;
|
this.profileName = profileName;
|
||||||
this.apiUrl = apiUrl;
|
this.apiUrl = apiUrl;
|
||||||
this.apiKey = apiKey;
|
this.apiKey = apiKey;
|
||||||
|
this.useEarn = useEarn;
|
||||||
|
this.earnApiKey = earnApiKey;
|
||||||
this.useTelegram = useTelegram;
|
this.useTelegram = useTelegram;
|
||||||
this.botToken = botToken;
|
this.botToken = botToken;
|
||||||
this.chatId = chatId;
|
this.chatId = chatId;
|
||||||
|
|
@ -54,6 +60,8 @@ public class SettingsViewModel extends ViewModel {
|
||||||
profileName,
|
profileName,
|
||||||
apiUrl,
|
apiUrl,
|
||||||
apiKey,
|
apiKey,
|
||||||
|
useEarn,
|
||||||
|
earnApiKey,
|
||||||
useTelegram,
|
useTelegram,
|
||||||
botToken,
|
botToken,
|
||||||
chatId,
|
chatId,
|
||||||
|
|
|
||||||
|
|
@ -69,6 +69,20 @@
|
||||||
android:inputType="text"
|
android:inputType="text"
|
||||||
android:textSize="16sp"/>
|
android:textSize="16sp"/>
|
||||||
|
|
||||||
|
<CheckBox
|
||||||
|
android:id="@+id/useEarn"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Earn" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/earnApiKey"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:hint="@string/earn_key_hint"
|
||||||
|
android:textStyle="italic"
|
||||||
|
android:inputType="text"
|
||||||
|
android:textSize="16sp"/>
|
||||||
|
|
||||||
<CheckBox
|
<CheckBox
|
||||||
android:id="@+id/useTelegram"
|
android:id="@+id/useTelegram"
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,8 @@
|
||||||
|
|
||||||
<string name="profile_name_hint">Enter the profile name</string>
|
<string name="profile_name_hint">Enter the profile name</string>
|
||||||
<string name="api_url_hint">Enter the API URL</string>
|
<string name="api_url_hint">Enter the API URL</string>
|
||||||
<string name="api_key_hint">Enter the API Key</string>
|
<string name="api_key_hint">Enter the API key</string>
|
||||||
|
<string name="earn_key_hint">Enter the Earn API key</string>
|
||||||
<string name="use_telegram">Use Telegram</string>
|
<string name="use_telegram">Use Telegram</string>
|
||||||
<string name="bot_token_hint">Enter the bot token</string>
|
<string name="bot_token_hint">Enter the bot token</string>
|
||||||
<string name="chat_id_hint">Enter the chat ID</string>
|
<string name="chat_id_hint">Enter the chat ID</string>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue