Search in sources :

Example 51 with RelativeLayout

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;
}
Also used : ImageButton(android.widget.ImageButton) RelativeLayout(android.widget.RelativeLayout) TextView(android.widget.TextView) View(android.view.View)

Example 52 with RelativeLayout

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);
}
Also used : RelativeLayout(android.widget.RelativeLayout) GestureCropImageView(com.yalantis.ucrop.weiui.library.view.GestureCropImageView) ImageView(android.widget.ImageView) TransformImageView(com.yalantis.ucrop.weiui.library.view.TransformImageView) OverlayView(com.yalantis.ucrop.weiui.library.view.OverlayView) HorizontalProgressWheelView(com.yalantis.ucrop.weiui.library.view.widget.HorizontalProgressWheelView) UCropView(com.yalantis.ucrop.weiui.library.view.UCropView) View(android.view.View) CropImageView(com.yalantis.ucrop.weiui.library.view.CropImageView) TextView(android.widget.TextView) AspectRatioTextView(com.yalantis.ucrop.weiui.library.view.widget.AspectRatioTextView)

Example 53 with RelativeLayout

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;
}
Also used : RelativeLayout(android.widget.RelativeLayout) TextView(android.widget.TextView)

Example 54 with RelativeLayout

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;
}
Also used : LayoutParams(android.widget.RelativeLayout.LayoutParams) LayoutInflater(android.view.LayoutInflater) RelativeLayout(android.widget.RelativeLayout) ChatListAdView(com.my.target.nativeads.views.ChatListAdView) ContentStreamAdView(com.my.target.nativeads.views.ContentStreamAdView) NewsFeedAdView(com.my.target.nativeads.views.NewsFeedAdView) View(android.view.View)

Example 55 with RelativeLayout

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);
    }
}
Also used : AdRequest(com.google.android.gms.ads.AdRequest) TabLayout(android.support.design.widget.TabLayout) RelativeLayout(android.widget.RelativeLayout) Toolbar(android.support.v7.widget.Toolbar)

Aggregations

RelativeLayout (android.widget.RelativeLayout)396 TextView (android.widget.TextView)180 View (android.view.View)164 ImageView (android.widget.ImageView)109 LinearLayout (android.widget.LinearLayout)67 ViewGroup (android.view.ViewGroup)61 Intent (android.content.Intent)31 AdapterView (android.widget.AdapterView)29 Button (android.widget.Button)29 FrameLayout (android.widget.FrameLayout)28 SuppressLint (android.annotation.SuppressLint)26 LayoutInflater (android.view.LayoutInflater)22 OnClickListener (android.view.View.OnClickListener)22 ScrollView (android.widget.ScrollView)22 Paint (android.graphics.Paint)20 CardView (android.support.v7.widget.CardView)19 Context (android.content.Context)18 Point (android.graphics.Point)18 ListView (android.widget.ListView)18 RadioButton (android.widget.RadioButton)17