In your app's source package, create a new class. We are going to define a custom View class in which the drawing will take place. The values for dimension and integer at each size are the same, so that the UI indicates the brush size as it will function when the user draws with it. We need to define the size for each as both a dimension and an integer value so that we can use these measurements in both the XML layout and drawable resources and the Java code: ![]() We are going to use three possible brush/eraser sizes: small, medium, and large. If Eclipse created the file, there may be some values in it already. In your app's "res/values" folder, if Eclipse has not already created it, add the "dimens.xml" file - if it is already there you can simply add new values to it. ![]() Add the following to your Activity element opening tag, forcing the app only to use portrait:Īndroid:screenOrientation="portrait" Step 3īefore we start building the interface, let's define some numbers we will use throughout the series. Your Activity and SDK levels should already be set. Open your project Manifest file and switch to the XML editing tab. Let Android Studio create a blank main Activity and layout - you can use the default names. We are using a minimum API level of 15 for the code in this tutorial. ![]() Start a new Android project in Android Studio, choosing application and package names. ![]() Download Download View Paint with android on GitHub Paint with Android
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |