mirror of
https://github.com/hmalik144/EasyCC-Legacy-.git
synced 2026-03-17 23:16:06 +00:00
Add files via upload
This commit is contained in:
@@ -11,6 +11,7 @@ import android.util.Log;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.AdapterView;
|
import android.widget.AdapterView;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
|
import android.widget.ProgressBar;
|
||||||
import android.widget.Spinner;
|
import android.widget.Spinner;
|
||||||
import android.widget.AdapterView.OnItemSelectedListener;
|
import android.widget.AdapterView.OnItemSelectedListener;
|
||||||
|
|
||||||
@@ -35,6 +36,7 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
Spinner spinnerTop;
|
Spinner spinnerTop;
|
||||||
Spinner spinnerBottom;
|
Spinner spinnerBottom;
|
||||||
double conversionRateOne;
|
double conversionRateOne;
|
||||||
|
ProgressBar spinner;
|
||||||
|
|
||||||
private String URL = "https://free.currencyconverterapi.com/api/v3/convert?";
|
private String URL = "https://free.currencyconverterapi.com/api/v3/convert?";
|
||||||
|
|
||||||
@@ -52,7 +54,8 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
currencyOneEditText.addTextChangedListener(TextWatcherClass);
|
currencyOneEditText.addTextChangedListener(TextWatcherClass);
|
||||||
currencyTwoEditText.addTextChangedListener(TextWatcherClass2);
|
currencyTwoEditText.addTextChangedListener(TextWatcherClass2);
|
||||||
|
|
||||||
|
spinner = (ProgressBar) findViewById(R.id.progressBar);
|
||||||
|
spinner.setVisibility(View.GONE);
|
||||||
|
|
||||||
addListenerOnSpinnerItemSelection();
|
addListenerOnSpinnerItemSelection();
|
||||||
|
|
||||||
@@ -283,6 +286,7 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
protected Double doInBackground(String... urlString) {
|
protected Double doInBackground(String... urlString) {
|
||||||
String jsonResponse = null;
|
String jsonResponse = null;
|
||||||
|
|
||||||
if (urlString.length < 1 || urlString[0] == null) {
|
if (urlString.length < 1 || urlString[0] == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -299,11 +303,18 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onPreExecute() {
|
||||||
|
super.onPreExecute();
|
||||||
|
spinner.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPostExecute(Double result) {
|
protected void onPostExecute(Double result) {
|
||||||
super.onPostExecute(result);
|
super.onPostExecute(result);
|
||||||
|
|
||||||
conversionRateOne = result;
|
conversionRateOne = result;
|
||||||
|
spinner.setVisibility(View.GONE);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user