Skip to content

Commit ef388cd

Browse files
committed
meow commit
0 parents  commit ef388cd

File tree

27 files changed

+665
-0
lines changed

27 files changed

+665
-0
lines changed

app/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

app/build.gradle

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
apply plugin: 'com.android.application'
2+
3+
android {
4+
compileSdkVersion 26
5+
defaultConfig {
6+
applicationId "id.kataponcoe.rotgridview"
7+
minSdkVersion 14
8+
targetSdkVersion 26
9+
versionCode 1
10+
versionName "1.0"
11+
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
12+
}
13+
buildTypes {
14+
release {
15+
minifyEnabled false
16+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
17+
}
18+
}
19+
}
20+
21+
dependencies {
22+
implementation fileTree(dir: 'libs', include: ['*.jar'])
23+
implementation 'com.android.support:appcompat-v7:26.1.0'
24+
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
25+
testImplementation 'junit:junit:4.12'
26+
androidTestImplementation 'com.android.support.test:runner:0.5'
27+
androidTestImplementation 'com.android.support.test.espresso:espresso-core:2.2.2'
28+
}

app/proguard-rules.pro

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package id.kataponcoe.rotgridview;
2+
3+
import android.content.Context;
4+
import android.support.test.InstrumentationRegistry;
5+
import android.support.test.runner.AndroidJUnit4;
6+
7+
import org.junit.Test;
8+
import org.junit.runner.RunWith;
9+
10+
import static org.junit.Assert.*;
11+
12+
/**
13+
* Instrumented test, which will execute on an Android device.
14+
*
15+
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
16+
*/
17+
@RunWith(AndroidJUnit4.class)
18+
public class ExampleInstrumentedTest {
19+
@Test
20+
public void useAppContext() throws Exception {
21+
// Context of the app under test.
22+
Context appContext = InstrumentationRegistry.getTargetContext();
23+
24+
assertEquals("id.kataponcoe.rotgridview", appContext.getPackageName());
25+
}
26+
}

app/src/main/AndroidManifest.xml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="id.kataponcoe.rotgridview"
4+
android:installLocation="preferExternal">
5+
6+
<uses-feature
7+
android:glEsVersion="0x00020000"
8+
android:required="true" />
9+
10+
<supports-screens
11+
android:anyDensity="true"
12+
android:largeScreens="true"
13+
android:normalScreens="true"
14+
android:smallScreens="true"
15+
android:xlargeScreens="true" />
16+
17+
<uses-permission android:name="android.permission.INTERNET" />
18+
19+
<application
20+
android:allowBackup="true"
21+
android:icon="@mipmap/ic_launcher"
22+
android:label="@string/app_name"
23+
android:roundIcon="@mipmap/ic_launcher_round"
24+
android:supportsRtl="true"
25+
android:theme="@style/AppTheme">
26+
<activity android:name=".MainActivity">
27+
<intent-filter>
28+
<action android:name="android.intent.action.MAIN" />
29+
30+
<category android:name="android.intent.category.LAUNCHER" />
31+
</intent-filter>
32+
</activity>
33+
</application>
34+
35+
</manifest>
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
package id.kataponcoe.rotgridview;
2+
3+
import android.content.Context;
4+
import android.view.LayoutInflater;
5+
import android.view.View;
6+
import android.view.ViewGroup;
7+
import android.widget.BaseAdapter;
8+
import android.widget.ImageView;
9+
import android.widget.TextView;
10+
11+
/**
12+
* Created by Poncoe on 17/11/17.
13+
*/
14+
15+
public class GridAdapter extends BaseAdapter {
16+
17+
// Declare Variables
18+
Context context;
19+
String[] Version;
20+
int[] image;
21+
LayoutInflater inflater;
22+
23+
public GridAdapter(Context context, String[] version, int[] image) {
24+
this.context = context;
25+
this.Version = version;
26+
this.image = image;
27+
}
28+
29+
@Override
30+
public int getCount() {
31+
return Version.length;
32+
}
33+
34+
@Override
35+
public Object getItem(int position) {
36+
return null;
37+
}
38+
39+
@Override
40+
public long getItemId(int position) {
41+
return 0;
42+
}
43+
44+
public View getView(int position, View convertView, ViewGroup parent) {
45+
46+
// Declare Variables
47+
TextView gridtext;
48+
ImageView gridimage;
49+
50+
inflater = (LayoutInflater) context
51+
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
52+
53+
View itemView = inflater.inflate(R.layout.grid_item, parent, false);
54+
// Locate the TextViews in listview_item.xml
55+
gridtext = (TextView) itemView.findViewById(R.id.griditem_text);
56+
// Locate the ImageView in listview_item.xml
57+
gridimage = (ImageView) itemView.findViewById(R.id.griditem_image);
58+
// Capture position and set to the TextViews
59+
gridtext.setText(Version[position]);
60+
// Capture position and set to the ImageView
61+
gridimage.setImageResource(image[position]);
62+
return itemView;
63+
}
64+
}
Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
package id.kataponcoe.rotgridview;
2+
3+
import android.app.AlertDialog;
4+
import android.content.Context;
5+
import android.content.DialogInterface;
6+
import android.content.Intent;
7+
import android.net.ConnectivityManager;
8+
import android.net.NetworkInfo;
9+
import android.net.Uri;
10+
import android.support.v7.app.AppCompatActivity;
11+
import android.os.Bundle;
12+
import android.view.MenuItem;
13+
import android.view.View;
14+
import android.view.Window;
15+
import android.widget.AdapterView;
16+
import android.widget.GridView;
17+
import android.widget.TextView;
18+
19+
public class MainActivity extends AppCompatActivity {
20+
21+
private static final String TAG = MainActivity.class.getSimpleName();
22+
23+
final String Email = "poncoe4mac@gmail.com";
24+
25+
GridView grid; //Grid
26+
GridAdapter adapter; //grid
27+
String[] Judul; // grid
28+
int[] image; // grid
29+
private TextView messageView;
30+
31+
@Override
32+
public void onCreate(Bundle savedInstanceState) {
33+
super.onCreate(savedInstanceState);
34+
35+
requestWindowFeature(Window.FEATURE_NO_TITLE);
36+
setContentView(R.layout.activity_main);
37+
38+
// GridView Awal
39+
40+
Judul = new String[]{"Situs Resmi", "Letak Lokasi", "Official Kaskus", "Official Twitter", "Telesandi News", "Situs Tomcat",
41+
"Tels Radio", "Telesandi Art", "Telesandi Services", "English Club",
42+
"Osis Telesandi", "Official Telesandi", "Telesandi Futsal", "Angklung Tels", "Ultras Telkom74",
43+
"Ultras Telkom74", "Tomcat Telesandi", "Osis Telesandi", "Paskibra Telesandi",
44+
"Brigatels", "Traditels", "Rohis Telesandi", "Pramuka Telesandi", "Seni Media"};
45+
46+
image = new int[]{R.mipmap.ic_launcher, R.mipmap.ic_launcher, R.mipmap.ic_launcher, R.mipmap.ic_launcher, R.mipmap.ic_launcher, R.mipmap.ic_launcher,
47+
R.mipmap.ic_launcher, R.mipmap.ic_launcher, R.mipmap.ic_launcher, R.mipmap.ic_launcher,
48+
R.mipmap.ic_launcher, R.mipmap.ic_launcher, R.mipmap.ic_launcher, R.mipmap.ic_launcher, R.mipmap.ic_launcher,
49+
R.mipmap.ic_launcher, R.mipmap.ic_launcher, R.mipmap.ic_launcher, R.mipmap.ic_launcher,
50+
R.mipmap.ic_launcher, R.mipmap.ic_launcher, R.mipmap.ic_launcher, R.mipmap.ic_launcher, R.mipmap.ic_launcher};
51+
52+
grid = (GridView) findViewById(R.id.gridview);
53+
adapter = new GridAdapter(getApplicationContext(), Judul, image);
54+
grid.setAdapter(adapter);
55+
56+
// kasih fungsi jika diklik
57+
grid.setOnItemClickListener(new AdapterView.OnItemClickListener() {
58+
59+
@Override
60+
public void onItemClick(AdapterView<?> parent, View view,
61+
int position, long id) {
62+
63+
/* KETERANGAN!!
64+
65+
kalo di gridview mau dikasih activity / intent pake kodingan ini :
66+
67+
myIntent = new Intent(view.getContext(), SitusSekolah.class);
68+
69+
cuma kalo mau main ACTION_VIEW silahkan pake ini :
70+
71+
myIntent = new Intent (Intent.ACTION_VIEW, Uri.parse("https://twitter.com/official_Tels"));
72+
73+
sesuain kebutuhan aja..
74+
75+
--> image & judul bisa kalian ubah, intinya 1 gridview itu 1 judul & image.
76+
77+
*/
78+
79+
Intent myIntent = null;
80+
if (position == 0) {
81+
//myIntent = new Intent(view.getContext(), SitusSekolah.class); <!-- contoh Kalo Mau Kasih Intent -->
82+
myIntent = new Intent (Intent.ACTION_VIEW, Uri.parse("https://twitter.com/official_Tels"));
83+
}
84+
if (position == 1) {
85+
//myIntent = new Intent(view.getContext(), LetakSekolah.class); <!-- contoh Kalo Mau Kasih Intent -->
86+
myIntent = new Intent (Intent.ACTION_VIEW, Uri.parse("https://twitter.com/official_Tels"));
87+
}
88+
if (position == 2) {
89+
myIntent = new Intent (Intent.ACTION_VIEW, Uri.parse("http://www.kaskus.co.id/thread/56a6e4cc529a45cc398b4568/official-smk-telekomunikasi-telesandi-bekasi-tempat-ngobrolsharing--berkumpul"));
90+
}
91+
if (position == 3) {
92+
myIntent = new Intent (Intent.ACTION_VIEW, Uri.parse("https://twitter.com/official_Tels"));
93+
}
94+
if (position == 4) {
95+
// myIntent = new Intent(view.getContext(), TelsNews.class); <!-- contoh Kalo Mau Kasih Intent -->
96+
myIntent = new Intent (Intent.ACTION_VIEW, Uri.parse("https://twitter.com/official_Tels"));
97+
}
98+
if (position == 5) {
99+
//myIntent = new Intent(view.getContext(), SitusTomcat.class); <!-- contoh Kalo Mau Kasih Intent -->
100+
myIntent = new Intent (Intent.ACTION_VIEW, Uri.parse("https://twitter.com/official_Tels"));
101+
}
102+
103+
104+
if (position == 6) {
105+
myIntent = new Intent (Intent.ACTION_VIEW, Uri.parse("https://www.instagram.com/telsradio/"));
106+
}
107+
if (position == 7) {
108+
myIntent = new Intent (Intent.ACTION_VIEW, Uri.parse("https://www.instagram.com/tels_art/"));
109+
}
110+
if (position == 8) {
111+
myIntent = new Intent (Intent.ACTION_VIEW, Uri.parse("https://www.instagram.com/telservices/"));
112+
}
113+
if (position == 9) {
114+
myIntent = new Intent (Intent.ACTION_VIEW, Uri.parse("https://www.instagram.com/ec.tels/"));
115+
}
116+
117+
118+
if (position == 10) {
119+
myIntent = new Intent (Intent.ACTION_VIEW, Uri.parse("https://www.instagram.com/osistels/"));
120+
}
121+
if (position == 11) {
122+
myIntent = new Intent (Intent.ACTION_VIEW, Uri.parse("https://www.instagram.com/officialtels/"));
123+
}
124+
if (position == 12) {
125+
myIntent = new Intent (Intent.ACTION_VIEW, Uri.parse("https://www.instagram.com/futsaltels2008/"));
126+
}
127+
if (position == 13) {
128+
myIntent = new Intent (Intent.ACTION_VIEW, Uri.parse("https://www.instagram.com/angklungtels/"));
129+
}
130+
if (position == 14) {
131+
myIntent = new Intent (Intent.ACTION_VIEW, Uri.parse("https://www.instagram.com/ultrastelkom74/"));
132+
}
133+
134+
135+
if (position == 15) {
136+
myIntent = new Intent (Intent.ACTION_VIEW, Uri.parse("https://twitter.com/ultrastelkom74"));
137+
}
138+
if (position == 16) {
139+
myIntent = new Intent (Intent.ACTION_VIEW, Uri.parse("https://twitter.com/TomcatSquad_"));
140+
}
141+
if (position == 17) {
142+
myIntent = new Intent (Intent.ACTION_VIEW, Uri.parse("https://twitter.com/Osis_Tels"));
143+
}
144+
if (position == 18) {
145+
myIntent = new Intent (Intent.ACTION_VIEW, Uri.parse("https://twitter.com/Brigastels_CGE"));
146+
}
147+
148+
149+
if (position == 19) {
150+
myIntent = new Intent (Intent.ACTION_VIEW, Uri.parse("https://www.instagram.com/brigastels/"));
151+
}
152+
if (position == 20) {
153+
myIntent = new Intent (Intent.ACTION_VIEW, Uri.parse("https://www.instagram.com/traditels/"));
154+
}
155+
if (position == 21) {
156+
myIntent = new Intent (Intent.ACTION_VIEW, Uri.parse("https://www.instagram.com/rohistels89/"));
157+
}
158+
if (position == 22) {
159+
myIntent = new Intent (Intent.ACTION_VIEW, Uri.parse("https://www.instagram.com/aljawira/"));
160+
}
161+
if (position == 23) {
162+
myIntent = new Intent (Intent.ACTION_VIEW, Uri.parse("https://www.instagram.com/senimedia_/"));
163+
}
164+
165+
startActivity(myIntent);
166+
167+
}
168+
169+
});
170+
}
171+
172+
//GridView Akhir
173+
174+
public void onBackPressed() {
175+
finish();//Pergi ke method exit
176+
}
177+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
xmlns:aapt="http://schemas.android.com/aapt"
3+
android:width="108dp"
4+
android:height="108dp"
5+
android:viewportHeight="108"
6+
android:viewportWidth="108">
7+
<path
8+
android:fillType="evenOdd"
9+
android:pathData="M32,64C32,64 38.39,52.99 44.13,50.95C51.37,48.37 70.14,49.57 70.14,49.57L108.26,87.69L108,109.01L75.97,107.97L32,64Z"
10+
android:strokeColor="#00000000"
11+
android:strokeWidth="1">
12+
<aapt:attr name="android:fillColor">
13+
<gradient
14+
android:endX="78.5885"
15+
android:endY="90.9159"
16+
android:startX="48.7653"
17+
android:startY="61.0927"
18+
android:type="linear">
19+
<item
20+
android:color="#44000000"
21+
android:offset="0.0" />
22+
<item
23+
android:color="#00000000"
24+
android:offset="1.0" />
25+
</gradient>
26+
</aapt:attr>
27+
</path>
28+
<path
29+
android:fillColor="#FFFFFF"
30+
android:fillType="nonZero"
31+
android:pathData="M66.94,46.02L66.94,46.02C72.44,50.07 76,56.61 76,64L32,64C32,56.61 35.56,50.11 40.98,46.06L36.18,41.19C35.45,40.45 35.45,39.3 36.18,38.56C36.91,37.81 38.05,37.81 38.78,38.56L44.25,44.05C47.18,42.57 50.48,41.71 54,41.71C57.48,41.71 60.78,42.57 63.68,44.05L69.11,38.56C69.84,37.81 70.98,37.81 71.71,38.56C72.44,39.3 72.44,40.45 71.71,41.19L66.94,46.02ZM62.94,56.92C64.08,56.92 65,56.01 65,54.88C65,53.76 64.08,52.85 62.94,52.85C61.8,52.85 60.88,53.76 60.88,54.88C60.88,56.01 61.8,56.92 62.94,56.92ZM45.06,56.92C46.2,56.92 47.13,56.01 47.13,54.88C47.13,53.76 46.2,52.85 45.06,52.85C43.92,52.85 43,53.76 43,54.88C43,56.01 43.92,56.92 45.06,56.92Z"
32+
android:strokeColor="#00000000"
33+
android:strokeWidth="1" />
34+
</vector>

0 commit comments

Comments
 (0)