use of android.widget.RelativeLayout in project Taskzilla by CMPUT301W18T05.
the class ProfileFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
// Inflate the layout for this fragment
final RelativeLayout mRelativeLayout = (RelativeLayout) inflater.inflate(R.layout.fragment_profile, container, false);
ImageButton mButton = mRelativeLayout.findViewById(R.id.EditButton);
mButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
editProfileClicked();
}
});
return mRelativeLayout;
}
use of android.widget.RelativeLayout in project weiui by kuaifan.
the class UCropActivity method addBlockingView.
/**
* Adds view that covers everything below the Toolbar.
* When it's clickable - user won't be able to click/touch anything below the Toolbar.
* Need to block user input while loading and cropping an image.
*/
private void addBlockingView() {
if (mBlockingView == null) {
mBlockingView = new View(this);
RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
lp.addRule(RelativeLayout.BELOW, R.id.toolbar);
mBlockingView.setLayoutParams(lp);
mBlockingView.setClickable(true);
}
((RelativeLayout) findViewById(R.id.ucrop_photobox)).addView(mBlockingView);
}
use of android.widget.RelativeLayout in project Bro by 2BAB.
the class DefaultActivity method generateDefaultView.
private View generateDefaultView(Context context, String errorHint) {
RelativeLayout root = new RelativeLayout(context);
TextView notice = new TextView(context);
if (errorHint == null) {
notice.setText("?");
} else {
notice.setText(errorHint);
}
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
layoutParams.addRule(RelativeLayout.CENTER_IN_PARENT, RelativeLayout.TRUE);
root.addView(notice, layoutParams);
return root;
}
use of android.widget.RelativeLayout in project mytarget-android by myTargetSDK.
the class FeedAdapter method getView.
@Override
public View getView(int position, View convertView, ViewGroup parent) {
if (convertView == null) {
if (getItemViewType(position) == 1) {
RelativeLayout relativeLayout = new RelativeLayout(context);
LayoutParams layoutParams = new LayoutParams(getPx(380), ViewGroup.LayoutParams.WRAP_CONTENT);
layoutParams.addRule(RelativeLayout.CENTER_HORIZONTAL, RelativeLayout.TRUE);
View adView = getAdView();
adView.setLayoutParams(layoutParams);
nativeAd.registerView(adView);
relativeLayout.addView(adView);
convertView = relativeLayout;
} else {
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView = inflater.inflate(R.layout.feed_item_text, parent, false);
}
}
return convertView;
}
use of android.widget.RelativeLayout in project scroball by peterjosling.
the class MainActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
application = (ScroballApplication) getApplication();
application.startListenerService();
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
// Create the adapter that will return a fragment for each of the three
// primary sections of the activity.
mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager());
// Set up the ViewPager with the sections adapter.
mViewPager = findViewById(R.id.container);
mViewPager.setAdapter(mSectionsPagerAdapter);
TabLayout tabLayout = findViewById(R.id.tabs);
tabLayout.setupWithViewPager(mViewPager);
// Initial tab may have been specified in the intent.
int initialTab = getIntent().getIntExtra(EXTRA_INITIAL_TAB, TAB_NOW_PLAYING);
mViewPager.setCurrentItem(initialTab);
this.adsRemoved = application.getSharedPreferences().getBoolean(REMOVE_ADS_SKU, false);
adView = findViewById(R.id.adView);
if (this.adsRemoved) {
RelativeLayout parent = (RelativeLayout) adView.getParent();
if (parent != null) {
parent.removeView(adView);
}
} else {
AdRequest adRequest = new AdRequest.Builder().addTestDevice("86193DC9EBC8E1C3873178900C9FCCFC").build();
adView.loadAd(adRequest);
}
}
Aggregations