use of com.polito.mad17.madmax.activities.DetailFragment in project MadMax by deviz92.
the class GroupDetailActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.app_bar_main);
databaseReference = FirebaseDatabase.getInstance().getReference();
Intent intent = getIntent();
groupID = intent.getStringExtra("groupID");
userID = intent.getStringExtra("userID");
Log.d(TAG, "onCreate di GroupDetailActivity. Group: " + groupID);
Bundle bundle = new Bundle();
bundle.putString("groupID", groupID);
bundle.putString("userID", userID);
if (findViewById(R.id.collapsed_content) != null) {
Log.d(TAG, groupID);
barDetailFragment.setArguments(bundle);
getSupportFragmentManager().beginTransaction().replace(R.id.collapsed_content, barDetailFragment).commit();
}
if (findViewById(R.id.main) != null) {
Log.d(TAG, groupID);
DetailFragment detailFragment = new DetailFragment();
detailFragment.setArguments(bundle);
getSupportFragmentManager().beginTransaction().replace(R.id.main, detailFragment).commit();
}
}
use of com.polito.mad17.madmax.activities.DetailFragment in project MadMax by deviz92.
the class FriendDetailActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.app_bar_main);
fab = (FloatingActionButton) findViewById(R.id.fab);
updateFab(0);
Log.d(TAG, "onCreate di FriendDetailActivity");
// ID dell'amico di cui sto guardando il dettaglio
Intent intent = getIntent();
friendID = intent.getStringExtra("friendID");
userID = intent.getStringExtra("userID");
if (findViewById(R.id.collapsed_content) != null) {
Bundle bundle = new Bundle();
bundle.putString("friendID", friendID);
Log.d(TAG, friendID);
BarDetailFragment barDetailFragment = new BarDetailFragment();
barDetailFragment.setArguments(bundle);
getSupportFragmentManager().beginTransaction().replace(R.id.collapsed_content, barDetailFragment).commit();
DetailFragment detailFragment = new DetailFragment();
detailFragment.setArguments(bundle);
getSupportFragmentManager().beginTransaction().replace(R.id.main, detailFragment).commit();
}
}
use of com.polito.mad17.madmax.activities.DetailFragment in project MadMax by deviz92.
the class DetailFragment method updateFab.
private void updateFab(int position) {
switch(position) {
case 0:
// expenses fragment
Log.d(TAG, "fab 0");
fab.setImageResource(android.R.drawable.ic_input_add);
fab.setVisibility(View.VISIBLE);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent myIntent = new Intent(getActivity(), NewExpenseActivity.class);
myIntent.putExtra("groupID", groupID);
myIntent.putExtra("userID", MainActivity.getCurrentUID());
myIntent.putExtra("callingActivity", "DetailFragment");
myIntent.putExtra("newPending", false);
startActivity(myIntent);
}
});
break;
case 1:
// members fragment
Log.d(TAG, "fab 1");
fab.setImageResource(R.drawable.user_add);
fab.setVisibility(View.VISIBLE);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(getContext(), NewMemberActivity.class);
intent.putExtra("groupID", groupID);
intent.putExtra("groupName", groupName);
startActivity(intent);
}
});
break;
case 2:
// history fragment
Log.d(TAG, "fab 2");
// lo storico non si tocca
fab.setVisibility(View.GONE);
break;
}
}
Aggregations