Category : layout

public class FreeLine extends AppCompatActivity { private MyView vw; ArrayList<Vertex> arVertex; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); vw = new MyView(this); setContentView(vw); arVertex = new ArrayList<Vertex>(); } protected class MyView extends View { public MyView(Context context) { super(context); mPaint = new Paint(); mPaint.setColor(Color.BLACK); mPaint.setStrokeWidth(3); mPaint.setAntiAlias(true); } //code… } } This is my PaintClass. and ..

Read more

This is my paintClass without .xml file. public class FreeLine extends AppCompatActivity { private MyView vw; ArrayList<Vertex> arVertex; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); vw = new MyView(this); LinearLayout.LayoutParams params( //code.. ); LinearLayout layout = new LinearLayout(this); layout.setOrientation(LinearLayout.VERTICAL); Button exitButton = new Button(this); exitButton.setText(R.string.exit); exitButton.setLayoutParams(params); layout.addView(exitButton); setContentView(vw); arVertex = new ArrayList<Vertex>(); } //Vertex code… ..

Read more

I’m using API 28 and all of my TextViews with property android:justificationMode="inter_word" display just fine (justified). However, when the android:text property contains a link (example: <string name="strIntro">This is some <u>text</u> that displays just fine,n including all tags and the <a href="www.google.com">link</a>, but not justifiedn</string> ), the text gets aligned to the left side – and ..

Read more

I a following this course on Pluralsight: https://app.pluralsight.com/library/courses/getting-started-android-development/table-of-contents and when I create my project with the "Basic Activity", My activity_main looks completely different than his. The first one is mine and the second one is his: He only has a constraint layout with a Text view, but I have a coordinator layout and a app ..

Read more

I have a dialog widget with navigation bar contains title and close button. I want to put the title in centre of the device, and put the close button in the end of layout. However when the title is long, then it will overlap with the close button. Here is my code: <androidx.constraintlayout.widget.ConstraintLayout android:layout_width="match_parent" android:layout_height="wrap_content"> ..

Read more