Search in sources :

Example 1 with BarDetailFragment

use of com.polito.mad17.madmax.activities.BarDetailFragment 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();
    }
}
Also used : Bundle(android.os.Bundle) Intent(android.content.Intent) DetailFragment(com.polito.mad17.madmax.activities.DetailFragment) BarDetailFragment(com.polito.mad17.madmax.activities.BarDetailFragment)

Example 2 with BarDetailFragment

use of com.polito.mad17.madmax.activities.BarDetailFragment 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();
    }
}
Also used : Bundle(android.os.Bundle) BarDetailFragment(com.polito.mad17.madmax.activities.BarDetailFragment) Intent(android.content.Intent) DetailFragment(com.polito.mad17.madmax.activities.DetailFragment) BarDetailFragment(com.polito.mad17.madmax.activities.BarDetailFragment)

Aggregations

Intent (android.content.Intent)2 Bundle (android.os.Bundle)2 BarDetailFragment (com.polito.mad17.madmax.activities.BarDetailFragment)2 DetailFragment (com.polito.mad17.madmax.activities.DetailFragment)2