Search in sources :

Example 1 with NativeAdFragment

use of com.my.targetDemoApp.fragments.NativeAdFragment in project mytarget-android by myTargetSDK.

the class NativeAdActivity method onCreate.

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_native_ads);
    toolbar = findViewById(R.id.toolbar);
    topContainer = findViewById(R.id.top_container);
    setSupportActionBar(toolbar);
    if (getSupportActionBar() != null) {
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        getSupportActionBar().setDisplayShowHomeEnabled(true);
    }
    bottomNavigationView = findViewById(R.id.bottom_navigation);
    if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
        hideBottomView();
    }
    bottomNavigationView.setOnNavigationItemSelectedListener(this);
    ArrayList<View> touchables = bottomNavigationView.getTouchables();
    for (int i = 0; i < touchables.size(); i++) {
        View view = touchables.get(i);
        view.setContentDescription("Bottom_" + i);
    }
    fragmentManager = getSupportFragmentManager();
    FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
    NativeAdFragment nativeAdFragment = NativeAdFragment.newInstance(slotId, R.id.action_native_static);
    fragmentTransaction.add(R.id.fragment_container, nativeAdFragment);
    fragmentTransaction.commit();
}
Also used : FragmentTransaction(android.support.v4.app.FragmentTransaction) NativeAdFragment(com.my.targetDemoApp.fragments.NativeAdFragment) BottomNavigationView(android.support.design.widget.BottomNavigationView) View(android.view.View)

Aggregations

BottomNavigationView (android.support.design.widget.BottomNavigationView)1 FragmentTransaction (android.support.v4.app.FragmentTransaction)1 View (android.view.View)1 NativeAdFragment (com.my.targetDemoApp.fragments.NativeAdFragment)1