Posts

Showing posts from May, 2019

Scrollable TabLayout in Sketchware - Sketchware Codes

Image
The example provided below shows how to create a simple scrollable TabLayout and add a TabLayout.OnTabSelectedListener to it in Sketchware. 1. In VIEW area of main.xml add a Linear Vertical  linear1  with width and height as match_parent. Inside it add a Linear Horizontal  linear2 . 2. Switch On AppCompat and design. 3. In  onCreate  event, use an add source directly block and put following codes. // Create a TabLayout (tabLayout) android.support.design.widget.TabLayout tabLayout = new android.support.design.widget.TabLayout(this); // Make TabLayout scrollable tabLayout.setTabMode(android.support.design.widget.TabLayout.MODE_SCROLLABLE); // Add Tabs to the TabLayout tabLayout.addTab(tabLayout.newTab().setText("Sunday")); tabLayout.addTab(tabLayout.newTab().setText("Monday")); tabLayout.addTab(tabLayout.newTab().setText("Tuesday")); tabLayout.addTab(tabLayout.newTab().setText("Wednesday")); tabLayout.addTab(tabLayout.newTab().setText("Thursda...

Use of Intent to Mail, SMS, MMS and Call - Sketchware Codes

Image
In Sketchware, the uses of Intent activity are limited as it contains only three setAction options: ACTION_VIEW, ACTION_DIAL, and ACTION_CALL. Here I mention the logic/codes for a few uses of Intent. 1. Open a Url in mobile browser. Intent  (name)  setAction   ACTION_VIEW Intent  (name)  setData   http:// xyz.com StartActivity  (name) 2. Open mobile contacts. Intent  (name)  setAction   ACTION_VIEW Intent  (name)  setData   content://contacts/people/ StartActivity  (name) 3. Open mobile dialer. Intent  (name)  setAction   ACTION_DIAL Intent  (name)  setData   tel: 894...... StartActivity  (name) Also, Intent  (name)  setAction   ACTION_VIEW Intent  (name)  setData   tel: 894...... StartActivity  (name) 4. Call a number. Intent  (name)  setAction   ACTION_CALL Intent  (name)  setData   tel: 894...... StartActivity  ...