Search in sources :

Example 86 with RelativeLayout

use of android.widget.RelativeLayout in project cuddly-octo-fortnight by prpr894.

the class AdvancedPlayActivity method initOtherUI.

private void initOtherUI() {
    // header
    final ImageButton ibBack = this.findViewById(R.id.ibtn_back);
    ibBack.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            finish();
        }
    });
    RelativeLayout rlback = this.findViewById(R.id.rl_back);
    rlback.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            ibBack.performClick();
        }
    });
    TextView tvTitle = this.findViewById(R.id.tv_top_title);
    tvTitle.setText(mLiveRoomItemDataBean.getNickname());
    final ImageButton ibScreen = this.findViewById(R.id.ibtn_screen_control);
    ibScreen.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            if (isFullScreen) {
                setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
                FullScreenUtils.toggleHideyBar(AdvancedPlayActivity.this);
                // to mini size, to portrait
                fullHeaderRl.removeAllViews();
                fullControllerRl.removeAllViews();
                normalHeaderRl.addView(headerBar);
                normalControllerRl.addView(mediaController);
                isFullScreen = false;
                ibScreen.setBackgroundResource(R.drawable.btn_to_fullscreen);
            } else {
                setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
                FullScreenUtils.toggleHideyBar(AdvancedPlayActivity.this);
                normalHeaderRl.removeAllViews();
                normalControllerRl.removeAllViews();
                fullHeaderRl.addView(headerBar);
                fullControllerRl.addView(mediaController);
                isFullScreen = true;
                ibScreen.setBackgroundResource(R.drawable.btn_to_mini);
                hideOuterAfterFiveSeconds();
            }
        }
    });
    if (!SharedPrefsStore.isDefaultPortrait(this)) {
        ibScreen.performClick();
    }
}
Also used : ImageButton(android.widget.ImageButton) RelativeLayout(android.widget.RelativeLayout) OnClickListener(android.view.View.OnClickListener) TextView(android.widget.TextView) BDCloudVideoView(com.baidu.cloud.videoplayer.widget.BDCloudVideoView) TextView(android.widget.TextView) View(android.view.View)

Example 87 with RelativeLayout

use of android.widget.RelativeLayout in project NetGuard by M66B.

the class ActivityMain method enableAds.

private void enableAds() {
    RelativeLayout rlAd = findViewById(R.id.rlAd);
    LinearLayout llAd = findViewById(R.id.llAd);
    final AdView adView = findViewById(R.id.adView);
    rlAd.setVisibility(View.VISIBLE);
    llAd.setVisibility(View.VISIBLE);
    Handler handler = new Handler();
    handler.postDelayed(new Runnable() {

        @Override
        public void run() {
            try {
                AdRequest adRequest = new AdRequest.Builder().addTestDevice(getString(R.string.ad_test_device_id)).build();
                adView.loadAd(adRequest);
            } catch (Throwable ex) {
                Log.e(TAG, ex.toString() + "\n" + Log.getStackTraceString(ex));
            }
        }
    }, 1000);
}
Also used : AdRequest(com.google.android.gms.ads.AdRequest) RelativeLayout(android.widget.RelativeLayout) Handler(android.os.Handler) AdView(com.google.android.gms.ads.AdView) LinearLayout(android.widget.LinearLayout)

Example 88 with RelativeLayout

use of android.widget.RelativeLayout in project platform_packages_apps_Settings by BlissRoms.

the class DashboardAdapterTest method setupSuggestions.

private void setupSuggestions(List<Tile> suggestions) {
    mDashboardAdapter.setCategoriesAndSuggestions(null, /* category */
    suggestions);
    final Context context = RuntimeEnvironment.application;
    mSuggestionHolder = new DashboardAdapter.SuggestionAndConditionHeaderHolder(LayoutInflater.from(context).inflate(R.layout.suggestion_condition_header, new RelativeLayout(context), true));
}
Also used : Context(android.content.Context) RelativeLayout(android.widget.RelativeLayout)

Example 89 with RelativeLayout

use of android.widget.RelativeLayout in project Stylish-Widget-for-Android by shiburagi.

the class MessageBox method init.

public void init(AttributeSet attrs) {
    TypedArray a = getContext().obtainStyledAttributes(attrs, R.styleable.propertiesAttr);
    RelativeLayout layout = (RelativeLayout) LayoutInflater.from(getContext()).inflate(R.layout.layout_messagebox, null);
    int background;
    try {
        background = a.getColor(R.styleable.propertiesAttr_sw_boxBackground, getResources().getColor(R.color.colorAccent));
    } catch (Exception e) {
        background = getResources().getColor(R.color.colorAccent);
    }
    setBackgroundColor(background);
    String message;
    try {
        message = a.getString(R.styleable.propertiesAttr_sw_message);
    } catch (Exception e) {
        message = "";
    }
    int padding, topPadding, bottomPadding, leftPadding, rightPadding;
    try {
        padding = a.getDimensionPixelSize(R.styleable.propertiesAttr_sw_innerPadding, layout.getPaddingBottom());
    } catch (Exception e) {
        padding = layout.getPaddingBottom();
    }
    try {
        leftPadding = a.getDimensionPixelSize(R.styleable.propertiesAttr_sw_innerLeftPadding, padding);
    } catch (Exception e) {
        leftPadding = padding;
    }
    try {
        rightPadding = a.getDimensionPixelSize(R.styleable.propertiesAttr_sw_innerRightPadding, padding);
    } catch (Exception e) {
        rightPadding = padding;
    }
    try {
        topPadding = a.getDimensionPixelSize(R.styleable.propertiesAttr_sw_innerTopPadding, padding);
    } catch (Exception e) {
        topPadding = padding;
    }
    try {
        bottomPadding = a.getDimensionPixelSize(R.styleable.propertiesAttr_sw_innerBottomPadding, padding);
    } catch (Exception e) {
        bottomPadding = padding;
    }
    int drawablePadding;
    try {
        drawablePadding = a.getDimensionPixelSize(R.styleable.propertiesAttr_sw_innerBottomPadding, padding);
    } catch (Exception e) {
        drawablePadding = padding;
    }
    Drawable drawable;
    try {
        drawable = a.getDrawable(R.styleable.propertiesAttr_sw_drawable);
    } catch (Exception e) {
        drawable = null;
    }
    a.recycle();
    layout.setPadding(leftPadding, topPadding, rightPadding, bottomPadding);
    a = getContext().obtainStyledAttributes(attrs, R.styleable.textAttr);
    int textStyle;
    try {
        textStyle = a.getInt(R.styleable.textAttr_sw_textStyle, Typeface.NORMAL);
    } catch (Exception e) {
        textStyle = Typeface.NORMAL;
    }
    a.recycle();
    try {
        textView = (ATextView) layout.findViewById(R.id.textView_message);
        textView.setText(message);
        textView.setTextStyle(textStyle);
        if (drawable != null) {
            textView.setCompoundDrawablesWithIntrinsicBounds(drawable, null, null, null);
            textView.setCompoundDrawablePadding(drawablePadding);
        }
    } catch (Exception e) {
    }
    button = (Button) layout.findViewById(R.id.button_action);
    imageView = (ImageView) layout.findViewById(R.id.imageView_close);
    addView(layout);
    setCloseButton(new OnClickListener() {

        @Override
        public void onClick(View view) {
        }
    });
}
Also used : TypedArray(android.content.res.TypedArray) RelativeLayout(android.widget.RelativeLayout) Drawable(android.graphics.drawable.Drawable) ImageView(android.widget.ImageView) View(android.view.View)

Example 90 with RelativeLayout

use of android.widget.RelativeLayout in project edx-app-android by edx.

the class CourseUnitNavigationActivity method onCreate.

protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    RelativeLayout insertPoint = (RelativeLayout) findViewById(R.id.fragment_container);
    LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View v = inflater.inflate(R.layout.view_course_unit_pager, null);
    insertPoint.addView(v, 0, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
    pager = (DisableableViewPager) findViewById(R.id.pager);
    pagerAdapter = new CourseUnitPagerAdapter(getSupportFragmentManager(), environment.getConfig(), unitList, courseData, this);
    pager.setAdapter(pagerAdapter);
    pager.setOnPageChangeListener(new ViewPager.OnPageChangeListener() {

        @Override
        public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
        }

        @Override
        public void onPageSelected(int position) {
        }

        @Override
        public void onPageScrollStateChanged(int state) {
            if (state == ViewPager.SCROLL_STATE_DRAGGING) {
                int curIndex = pager.getCurrentItem();
                PageViewStateCallback curView = (PageViewStateCallback) pagerAdapter.instantiateItem(pager, curIndex);
                if (curView != null)
                    curView.onPageDisappear();
            }
            if (state == ViewPager.SCROLL_STATE_IDLE) {
                int curIndex = pager.getCurrentItem();
                PageViewStateCallback curView = (PageViewStateCallback) pagerAdapter.instantiateItem(pager, curIndex);
                if (curView != null)
                    curView.onPageShow();
                tryToUpdateForEndOfSequential();
            }
        }
    });
    findViewById(R.id.course_unit_nav_bar).setVisibility(View.VISIBLE);
    mPreviousBtn.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            navigatePreviousComponent();
        }
    });
    mNextBtn.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            navigateNextComponent();
        }
    });
}
Also used : ViewGroup(android.view.ViewGroup) PageViewStateCallback(org.edx.mobile.view.common.PageViewStateCallback) View(android.view.View) InjectView(roboguice.inject.InjectView) TextView(android.widget.TextView) DisableableViewPager(org.edx.mobile.view.custom.DisableableViewPager) ViewPager(android.support.v4.view.ViewPager) CourseUnitPagerAdapter(org.edx.mobile.view.adapters.CourseUnitPagerAdapter) LayoutInflater(android.view.LayoutInflater) RelativeLayout(android.widget.RelativeLayout)

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