Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start arc from left to right #2

Open
SaranyaSanmugam opened this issue Apr 3, 2018 · 1 comment
Open

Start arc from left to right #2

SaranyaSanmugam opened this issue Apr 3, 2018 · 1 comment

Comments

@SaranyaSanmugam
Copy link

Couldn't set the arc starting point from left to right

@hirenderswami
Copy link

hello.... i found a way to starting point from both side left to right and right to left....
you have to follow this...
xml file

    <EditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/txt"
        android:inputType="number"
        android:imeOptions="actionDone"
        android:hint="Number"/>

    <Button
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/txt"
        android:text="right"
        android:id="@+id/but"/>
    <Button
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/but"
        android:text="left"
        android:id="@+id/but1"/>


    <com.goodiebag.protractorview.ProtractorView
        android:layout_width="wrap_content"
        android:layout_below="@+id/but1"
        android:layout_height="wrap_content"
        app:arcColor="#00000000"
        app:arcProgressColor="#00ff0000"
        app:tickColor="#606060"
        android:id="@+id/Protractor"
        app:tickProgressColor="#ff8929"
        app:textColor="#00000000"
        app:textProgressColor="#00000000"
        app:tickIntervals="2"
        app:tickLength="20dp"
        app:progressWidth="10dp"
        app:thumb="@drawable/progres"
        app:ticksBetweenLabel="one"
        app:roundEdges="true" />

    <com.goodiebag.protractorview.ProtractorView
        android:layout_width="wrap_content"
        android:layout_below="@+id/but1"
        android:layout_height="wrap_content"
        app:arcColor="#00000000"
        app:arcProgressColor="#00ff0000"
        app:tickColor="#ff8929"
        android:id="@+id/Protractor1"
        android:visibility="gone"
        app:tickProgressColor="#606060"
        app:textColor="#00000000"
        app:textProgressColor="#00000000"
        app:tickIntervals="2"
        app:tickLength="20dp"
        app:progressWidth="10dp"
        app:thumb="@drawable/progres"
        app:ticksBetweenLabel="one"
        app:roundEdges="true" />


   
</RelativeLayout>

java file cord....

public class MainActivity extends AppCompatActivity {

ProtractorView protractorView,protractorView1;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);


    final EditText editText = (EditText) findViewById(R.id.txt);

    Button right = (Button) findViewById(R.id.but);
    Button left = (Button) findViewById(R.id.but1);


    right.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {


            protractorView1.setVisibility(View.GONE);
            protractorView.setVisibility(View.VISIBLE);


            int ng = Integer.parseInt(editText.getText().toString());


            protractorView.setAngle(ng);


        }
    });

    left.setOnClickListener(new View.OnClickListener() {
        @TargetApi(Build.VERSION_CODES.M)
        @RequiresApi(api = Build.VERSION_CODES.M)
        @Override
        public void onClick(View view) {

            int ng = Integer.parseInt(editText.getText().toString());
            protractorView.setVisibility(View.GONE);
            protractorView1.setVisibility(View.VISIBLE);

            protractorView1.setAngle(180-ng);

        }
    });


    protractorView = (ProtractorView) findViewById(R.id.Protractor);

    protractorView1 = (ProtractorView) findViewById(R.id.Protractor1);

//you can remove this cord if you want to move youe seekbar
protractorView.setEnabled(false);
protractorView1.setEnabled(false);

}

}

i hop it help you....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants