add button added
This commit is contained in:
parent
ba9dcf4680
commit
079c78407b
|
|
@ -8,6 +8,7 @@ import androidx.navigation.Navigation;//
|
|||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.view.Menu;
|
||||
import android.widget.Button;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.example.dcav2gui.ui.home.HomeFragment;
|
||||
|
|
@ -33,6 +34,7 @@ public class MainActivity extends AppCompatActivity {
|
|||
|
||||
private AppBarConfiguration mAppBarConfiguration;
|
||||
private ActivityMainBinding binding;
|
||||
private Button addButton;
|
||||
public static SettingsData globalSettings;
|
||||
public HomeFragment.HomeCache homeViewCache;
|
||||
public static InstanceInterface.ExchangeStatsData binanceCache;
|
||||
|
|
@ -80,6 +82,7 @@ public class MainActivity extends AppCompatActivity {
|
|||
setContentView(binding.getRoot());
|
||||
|
||||
setSupportActionBar(binding.appBarMain.toolbar);
|
||||
addButton = findViewById(R.id.action_add);
|
||||
// binding.appBarMain.fab.setOnClickListener(new View.OnClickListener() {
|
||||
// @Override
|
||||
// public void onClick(View view) {
|
||||
|
|
@ -112,6 +115,13 @@ public class MainActivity extends AppCompatActivity {
|
|||
Toast.makeText(this, "Please enter your credentials in the settings menu", Toast.LENGTH_LONG).show();
|
||||
}
|
||||
|
||||
navController.addOnDestinationChangedListener((controller, destination, arguments) -> {
|
||||
if (destination.getId() == R.id.nav_home) {
|
||||
addButton.setVisibility(View.GONE);
|
||||
} else {
|
||||
addButton.setVisibility(View.VISIBLE);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,14 @@
|
|||
// BinanceFragment.java
|
||||
package com.example.dcav2gui.ui.exchanges;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
|
@ -56,6 +59,7 @@ public class BinanceFragment extends Fragment {
|
|||
}
|
||||
});
|
||||
|
||||
|
||||
return root;
|
||||
}
|
||||
|
||||
|
|
|
|||
Binary file not shown.
|
After Width: | Height: | Size: 9.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 5.0 KiB |
|
|
@ -16,7 +16,19 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="?attr/colorPrimary"
|
||||
app:popupTheme="@style/Theme.DCAv2GUI.PopupOverlay" />
|
||||
app:popupTheme="@style/Theme.DCAv2GUI.PopupOverlay">
|
||||
|
||||
<Button
|
||||
android:id="@+id/action_add"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="80dp"
|
||||
android:gravity="center_horizontal"
|
||||
android:text="+"
|
||||
android:textSize="20dp"
|
||||
android:layout_gravity="end"
|
||||
android:padding="10dp"/>
|
||||
|
||||
</androidx.appcompat.widget.Toolbar>
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue