FIXED issue: settings worked, but exchanges didn't
This commit is contained in:
parent
a8202fe91b
commit
bb47d11cf9
|
|
@ -1,117 +1,63 @@
|
||||||
package com.example.dcav2gui;//package com.example.dcav2gui;
|
package com.example.dcav2gui;//package com.example.dcav2gui;
|
||||||
//
|
|
||||||
//import android.os.Bundle;
|
|
||||||
//import android.view.View;
|
|
||||||
//import android.view.Menu;
|
|
||||||
//
|
|
||||||
//import com.google.android.material.snackbar.Snackbar;
|
|
||||||
//import com.google.android.material.navigation.NavigationView;
|
|
||||||
//
|
|
||||||
//import androidx.navigation.NavController;
|
|
||||||
//import androidx.navigation.Navigation;
|
|
||||||
//import androidx.navigation.ui.AppBarConfiguration;
|
|
||||||
//import androidx.navigation.ui.NavigationUI;
|
|
||||||
//import androidx.drawerlayout.widget.DrawerLayout;
|
|
||||||
//import androidx.appcompat.app.AppCompatActivity;
|
|
||||||
//
|
|
||||||
//import com.example.dcav2gui.databinding.ActivityMainBinding;
|
|
||||||
//
|
|
||||||
//public class MainActivity extends AppCompatActivity {
|
|
||||||
//
|
|
||||||
// private AppBarConfiguration mAppBarConfiguration;
|
|
||||||
// private ActivityMainBinding binding;
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// protected void onCreate(Bundle savedInstanceState) {
|
|
||||||
// super.onCreate(savedInstanceState);
|
|
||||||
//
|
|
||||||
// binding = ActivityMainBinding.inflate(getLayoutInflater());
|
|
||||||
// setContentView(binding.getRoot());
|
|
||||||
//
|
|
||||||
// setSupportActionBar(binding.appBarMain.toolbar);
|
|
||||||
// binding.appBarMain.fab.setOnClickListener(new View.OnClickListener() {
|
|
||||||
// @Override
|
|
||||||
// public void onClick(View view) {
|
|
||||||
// Snackbar.make(view, "General commands", Snackbar.LENGTH_LONG)
|
|
||||||
// .setAction("Action", null)
|
|
||||||
// .setAnchorView(R.id.fab).show();
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
//
|
|
||||||
// DrawerLayout drawer = binding.drawerLayout;
|
|
||||||
// NavigationView navigationView = binding.navView;
|
|
||||||
// // Passing each menu ID as a set of Ids because each
|
|
||||||
// // menu should be considered as top level destinations.
|
|
||||||
// mAppBarConfiguration = new AppBarConfiguration.Builder(
|
|
||||||
// R.id.nav_home,
|
|
||||||
// R.id.nav_binance,
|
|
||||||
// R.id.nav_gateio,
|
|
||||||
// R.id.nav_kucoin,
|
|
||||||
// R.id.nav_okx
|
|
||||||
// )
|
|
||||||
// .setOpenableLayout(drawer)
|
|
||||||
// .build();
|
|
||||||
// NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment_content_main);
|
|
||||||
// NavigationUI.setupActionBarWithNavController(this, navController, mAppBarConfiguration);
|
|
||||||
// NavigationUI.setupWithNavController(navigationView, navController);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public boolean onCreateOptionsMenu(Menu menu) {
|
|
||||||
// // Inflate the menu; this adds items to the action bar if it is present.
|
|
||||||
// getMenuInflater().inflate(R.menu.main, menu);
|
|
||||||
// return true;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public boolean onSupportNavigateUp() {
|
|
||||||
// NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment_content_main);
|
|
||||||
// return NavigationUI.navigateUp(navController, mAppBarConfiguration)
|
|
||||||
// || super.onSupportNavigateUp();
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
// app/src/main/java/com/example/dcav2gui/MainActivity.java
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.view.Menu;
|
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.navigation.NavController;
|
||||||
import androidx.appcompat.widget.Toolbar;
|
import androidx.navigation.Navigation;//
|
||||||
import androidx.drawerlayout.widget.DrawerLayout;
|
import android.os.Bundle;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.Menu;
|
||||||
|
|
||||||
|
import com.google.android.material.snackbar.Snackbar;
|
||||||
|
import com.google.android.material.navigation.NavigationView;
|
||||||
|
|
||||||
import androidx.navigation.NavController;
|
import androidx.navigation.NavController;
|
||||||
import androidx.navigation.Navigation;
|
import androidx.navigation.Navigation;
|
||||||
import androidx.navigation.ui.AppBarConfiguration;
|
import androidx.navigation.ui.AppBarConfiguration;
|
||||||
import androidx.navigation.ui.NavigationUI;
|
import androidx.navigation.ui.NavigationUI;
|
||||||
|
import androidx.drawerlayout.widget.DrawerLayout;
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
import com.example.dcav2gui.R;
|
|
||||||
import com.example.dcav2gui.databinding.ActivityMainBinding;
|
import com.example.dcav2gui.databinding.ActivityMainBinding;
|
||||||
import com.google.android.material.navigation.NavigationView;
|
|
||||||
|
|
||||||
public class MainActivity extends AppCompatActivity {
|
public class MainActivity extends AppCompatActivity {
|
||||||
|
|
||||||
private AppBarConfiguration mAppBarConfiguration;
|
private AppBarConfiguration mAppBarConfiguration;
|
||||||
|
private ActivityMainBinding binding;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_main);
|
|
||||||
|
|
||||||
Toolbar toolbar = findViewById(R.id.toolbar);
|
binding = ActivityMainBinding.inflate(getLayoutInflater());
|
||||||
setSupportActionBar(toolbar);
|
setContentView(binding.getRoot());
|
||||||
|
|
||||||
DrawerLayout drawer = findViewById(R.id.drawer_layout);
|
setSupportActionBar(binding.appBarMain.toolbar);
|
||||||
//NavigationView navigationView = binding.navView;
|
binding.appBarMain.fab.setOnClickListener(new View.OnClickListener() {
|
||||||
NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment_content_main);
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
Snackbar.make(view, "General commands", Snackbar.LENGTH_LONG)
|
||||||
|
.setAction("Action", null)
|
||||||
|
.setAnchorView(R.id.fab).show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
DrawerLayout drawer = binding.drawerLayout;
|
||||||
|
NavigationView navigationView = binding.navView;
|
||||||
|
// Passing each menu ID as a set of Ids because each
|
||||||
|
// menu should be considered as top level destinations.
|
||||||
mAppBarConfiguration = new AppBarConfiguration.Builder(
|
mAppBarConfiguration = new AppBarConfiguration.Builder(
|
||||||
R.id.nav_home,
|
R.id.nav_home,
|
||||||
R.id.nav_binance,
|
R.id.nav_binance,
|
||||||
R.id.nav_gateio,
|
R.id.nav_gateio,
|
||||||
R.id.nav_kucoin,
|
R.id.nav_kucoin,
|
||||||
R.id.nav_okx)
|
R.id.nav_okx
|
||||||
|
)
|
||||||
.setOpenableLayout(drawer)
|
.setOpenableLayout(drawer)
|
||||||
.build();
|
.build();
|
||||||
|
NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment_content_main);
|
||||||
NavigationUI.setupActionBarWithNavController(this, navController, mAppBarConfiguration);
|
NavigationUI.setupActionBarWithNavController(this, navController, mAppBarConfiguration);
|
||||||
//NavigationUI.setupWithNavController(navigationView, navController);
|
NavigationUI.setupWithNavController(navigationView, navController);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -121,8 +67,8 @@ public class MainActivity extends AppCompatActivity {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
// Handle action bar item clicks here. The action bar will
|
// Handle action bar item clicks here. The action bar will
|
||||||
// automatically handle clicks on the Home/Up button, so long
|
// automatically handle clicks on the Home/Up button, so long
|
||||||
// as you specify a parent activity in AndroidManifest.xml.
|
// as you specify a parent activity in AndroidManifest.xml.
|
||||||
|
|
@ -136,8 +82,7 @@ public class MainActivity extends AppCompatActivity {
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.onOptionsItemSelected(item);
|
return super.onOptionsItemSelected(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onSupportNavigateUp() {
|
public boolean onSupportNavigateUp() {
|
||||||
NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment_content_main);
|
NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment_content_main);
|
||||||
|
|
@ -145,3 +90,81 @@ public class MainActivity extends AppCompatActivity {
|
||||||
|| super.onSupportNavigateUp();
|
|| super.onSupportNavigateUp();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// app/src/main/java/com/example/dcav2gui/MainActivity.java
|
||||||
|
//import android.os.Bundle;
|
||||||
|
//import android.view.Menu;
|
||||||
|
//import android.view.MenuItem;
|
||||||
|
//
|
||||||
|
//import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
//import androidx.appcompat.widget.Toolbar;
|
||||||
|
//import androidx.drawerlayout.widget.DrawerLayout;
|
||||||
|
//import androidx.navigation.NavController;
|
||||||
|
//import androidx.navigation.Navigation;
|
||||||
|
//import androidx.navigation.ui.AppBarConfiguration;
|
||||||
|
//import androidx.navigation.ui.NavigationUI;
|
||||||
|
//
|
||||||
|
//import com.example.dcav2gui.R;
|
||||||
|
//import com.example.dcav2gui.databinding.ActivityMainBinding;
|
||||||
|
//import com.google.android.material.navigation.NavigationView;
|
||||||
|
//
|
||||||
|
//public class MainActivity extends AppCompatActivity {
|
||||||
|
//
|
||||||
|
// private AppBarConfiguration mAppBarConfiguration;
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
// super.onCreate(savedInstanceState);
|
||||||
|
// setContentView(R.layout.activity_main);
|
||||||
|
//
|
||||||
|
// Toolbar toolbar = findViewById(R.id.toolbar);
|
||||||
|
// setSupportActionBar(toolbar);
|
||||||
|
//
|
||||||
|
// DrawerLayout drawer = findViewById(R.id.drawer_layout);
|
||||||
|
// //NavigationView navigationView = binding.navView;
|
||||||
|
// NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment_content_main);
|
||||||
|
// mAppBarConfiguration = new AppBarConfiguration.Builder(
|
||||||
|
// R.id.nav_home,
|
||||||
|
// R.id.nav_binance,
|
||||||
|
// R.id.nav_gateio,
|
||||||
|
// R.id.nav_kucoin,
|
||||||
|
// R.id.nav_okx)
|
||||||
|
// .setOpenableLayout(drawer)
|
||||||
|
// .build();
|
||||||
|
// NavigationUI.setupActionBarWithNavController(this, navController, mAppBarConfiguration);
|
||||||
|
// NavigationUI.setupWithNavController(navigationView, navController);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
|
// // Inflate the menu; this adds items to the action bar if it is present.
|
||||||
|
// getMenuInflater().inflate(R.menu.main, menu);
|
||||||
|
// return true;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
// // Handle action bar item clicks here. The action bar will
|
||||||
|
// // automatically handle clicks on the Home/Up button, so long
|
||||||
|
// // as you specify a parent activity in AndroidManifest.xml.
|
||||||
|
// int id = item.getItemId();
|
||||||
|
//
|
||||||
|
// if (id == R.id.action_settings) {
|
||||||
|
// // Navigate to the SettingsFragment
|
||||||
|
// NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment_content_main);
|
||||||
|
// navController.navigate(R.id.nav_settings);
|
||||||
|
// return true;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// return super.onOptionsItemSelected(item);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public boolean onSupportNavigateUp() {
|
||||||
|
// NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment_content_main);
|
||||||
|
// return NavigationUI.navigateUp(navController, mAppBarConfiguration)
|
||||||
|
// || super.onSupportNavigateUp();
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue