TextView getGravity - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for TextView getGravity method.

This code example shows how to use the following methods:setOnChronometerTickListener, getGravity
        super.addView(child, index, params);
         
        int childId = child.getId();
        if (childId == CHRONOMETER_ID && child instanceof Chronometer) {
            mChronometer = (Chronometer) child;
            mChronometer.setOnChronometerTickListener(this);
             
            // Check if Chronometer should move with with ProgressBar  
            mChronometerFollow = (params.width == ViewGroup.LayoutParams.WRAP_CONTENT);
            mChronometerGravity = (mChronometer.getGravity() &
                    Gravity.RELATIVE_HORIZONTAL_GRAVITY_MASK);
             
        } else if (childId == PROGRESSBAR_ID && child instanceof ProgressBar) {
            mProgressBar = (ProgressBar) child;
        } 
    } 
 
    /** 
     * Set the expected termination time of the running {@link Chronometer}. 
     * This value is used to adjust the {@link ProgressBar} against the elapsed 
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setOnChronometerTickListener, getGravity
        super.addView(child, index, params);
         
        int childId = child.getId();
        if (childId == CHRONOMETER_ID && child instanceof Chronometer) {
            mChronometer = (Chronometer) child;
            mChronometer.setOnChronometerTickListener(this);
             
            // Check if Chronometer should move with with ProgressBar  
            mChronometerFollow = (params.width == ViewGroup.LayoutParams.WRAP_CONTENT);
            mChronometerGravity = (mChronometer.getGravity() &
                    Gravity.RELATIVE_HORIZONTAL_GRAVITY_MASK);
             
        } else if (childId == PROGRESSBAR_ID && child instanceof ProgressBar) {
            mProgressBar = (ProgressBar) child;
        } 
    } 
 
    /** 
     * Set the expected termination time of the running {@link Chronometer}. 
     * This value is used to adjust the {@link ProgressBar} against the elapsed 
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setOnChronometerTickListener, getGravity
		super.addView(child, index, params);
 
		int childId = child.getId();
		if (childId == CHRONOMETER_ID && child instanceof Chronometer) {
			mChronometer = (Chronometer) child;
			mChronometer.setOnChronometerTickListener(this);
 
			// Check if Chronometer should move with with ProgressBar 
			mChronometerFollow = (params.width == ViewGroup.LayoutParams.WRAP_CONTENT);
			mChronometerGravity = (mChronometer.getGravity() & Gravity.HORIZONTAL_GRAVITY_MASK);
 
		} else if (childId == PROGRESSBAR_ID && child instanceof ProgressBar) {
			mProgressBar = (ProgressBar) child;
		} 
	} 
 
	public void setDurationBase(long durationBase) {
		mDurationBase = durationBase;
 
		if (mProgressBar == null || mChronometer == null) {
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setOnChronometerTickListener, getGravity
		super.addView(child, index, params);
 
		int childId = child.getId();
		if (childId == CHRONOMETER_ID && child instanceof Chronometer) {
			mChronometer = (Chronometer) child;
			mChronometer.setOnChronometerTickListener(this);
 
			// Check if Chronometer should move with with ProgressBar 
			mChronometerFollow = (params.width == ViewGroup.LayoutParams.WRAP_CONTENT);
			mChronometerGravity = (mChronometer.getGravity() & Gravity.HORIZONTAL_GRAVITY_MASK);
 
		} else if (childId == PROGRESSBAR_ID && child instanceof ProgressBar) {
			mProgressBar = (ProgressBar) child;
		} 
	} 
 
	public void setDurationBase(long durationBase) {
		mDurationBase = durationBase;
 
		if (mProgressBar == null || mChronometer == null) {
4
CodeRank
Experience pair programming with AI  Get Codota for Java

Related TextView getGravity Questions & Answers:

getGravity Method Overview
Returns the horizontal and vertical alignment of this TextView.
See Code Examples for other Android TextView Methods: