Skip to content

Commit c68e6e2

Browse files
committed
Merge pull request buckyroberts#51 from GiTweeker/master
Master
2 parents ce04b0e + 0923353 commit c68e6e2

File tree

178 files changed

+8899
-4
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

178 files changed

+8899
-4
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.idea/.name
2+
.idea/compiler.xml
3+
.idea/dictionaries/Bucky.xml
4+
*.iml
5+
.idea/misc.xml
6+
*.xml
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
package com.apps.gabothekiller.myapplication;
2+
3+
import android.support.v7.app.ActionBarActivity;
4+
import android.os.Bundle;
5+
import android.view.Menu;
6+
import android.view.MenuItem;
7+
import android.util.Log;
8+
9+
public class MainActivity extends ActionBarActivity {
10+
11+
private static final String TAG = "buckysMessage";
12+
13+
@Override
14+
protected void onCreate(Bundle savedInstanceState) {
15+
super.onCreate(savedInstanceState);
16+
setContentView(R.layout.activity_main);
17+
Log.i(TAG, "onCreate");
18+
}
19+
20+
@Override
21+
protected void onStart() {
22+
super.onStart();
23+
Log.i(TAG, "onStart");
24+
}
25+
26+
27+
@Override
28+
protected void onResume() {
29+
super.onResume();
30+
Log.i(TAG, "onResume");
31+
}
32+
33+
34+
@Override
35+
protected void onPause() {
36+
super.onPause();
37+
Log.i(TAG, "onPause");
38+
}
39+
40+
41+
@Override
42+
protected void onStop() {
43+
super.onStop();
44+
Log.i(TAG, "onStop");
45+
}
46+
47+
48+
@Override
49+
protected void onRestart() {
50+
super.onRestart();
51+
Log.i(TAG, "onRestart");
52+
}
53+
54+
55+
@Override
56+
protected void onDestroy() {
57+
super.onDestroy();
58+
Log.i(TAG, "onDestroy");
59+
}
60+
61+
62+
@Override
63+
protected void onSaveInstanceState(Bundle outState) {
64+
super.onSaveInstanceState(outState);
65+
Log.i(TAG, "onSaveInstanceState");
66+
}
67+
68+
69+
@Override
70+
protected void onRestoreInstanceState(Bundle savedInstanceState) {
71+
super.onRestoreInstanceState(savedInstanceState);
72+
Log.i(TAG, "onRestoreInstanceState");
73+
}
74+
75+
76+
@Override
77+
public boolean onCreateOptionsMenu(Menu menu) {
78+
// Inflate the menu; this adds items to the action bar if it is present.
79+
getMenuInflater().inflate(R.menu.menu_main, menu);
80+
return true;
81+
}
82+
83+
@Override
84+
public boolean onOptionsItemSelected(MenuItem item) {
85+
// Handle action bar item clicks here. The action bar will
86+
// automatically handle clicks on the Home/Up button, so long
87+
// as you specify a parent activity in AndroidManifest.xml.
88+
int id = item.getItemId();
89+
90+
//noinspection SimplifiableIfStatement
91+
if (id == R.id.action_settings) {
92+
return true;
93+
}
94+
95+
return super.onOptionsItemSelected(item);
96+
}
97+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
2+
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
3+
android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
4+
android:paddingRight="@dimen/activity_horizontal_margin"
5+
android:paddingTop="@dimen/activity_vertical_margin"
6+
android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".MainActivity"
7+
android:id="@+id/sadfasd"
8+
android:background="#2334ff">
9+
10+
<TextView
11+
android:layout_width="wrap_content"
12+
android:layout_height="wrap_content"
13+
android:textAppearance="?android:attr/textAppearanceLarge"
14+
android:text="the new boston"
15+
android:id="@+id/textView"
16+
android:layout_centerVertical="true"
17+
android:layout_centerHorizontal="true"
18+
android:textColor="#FFFFFF" />
19+
20+
</RelativeLayout>
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
package com.thenewboston.swiperdiaper;
2+
3+
import android.support.v7.app.ActionBarActivity;
4+
import android.os.Bundle;
5+
import android.view.Menu;
6+
import android.view.MenuItem;
7+
import android.widget.TextView;
8+
import android.view.MotionEvent;
9+
import android.view.GestureDetector;
10+
import android.support.v4.view.GestureDetectorCompat;
11+
12+
13+
public class MainActivity extends ActionBarActivity implements GestureDetector.OnGestureListener,
14+
GestureDetector.OnDoubleTapListener {
15+
private TextView buckysMessage;
16+
private GestureDetectorCompat gestureDetector;
17+
18+
@Override
19+
protected void onCreate(Bundle savedInstanceState) {
20+
super.onCreate(savedInstanceState);
21+
setContentView(R.layout.activity_main);
22+
23+
buckysMessage = (TextView) findViewById(R.id.buckysMessage);
24+
this.gestureDetector = new GestureDetectorCompat(this, this);
25+
gestureDetector.setOnDoubleTapListener(this);
26+
}
27+
28+
///////// GESTURE METHODS //////////
29+
@Override
30+
public boolean onSingleTapConfirmed(MotionEvent e) {
31+
buckysMessage.setText("onSingleTapConfirmed");
32+
return true;
33+
}
34+
35+
@Override
36+
public boolean onDoubleTap(MotionEvent e) {
37+
buckysMessage.setText("onDoubleTap");
38+
return true;
39+
}
40+
41+
@Override
42+
public boolean onDoubleTapEvent(MotionEvent e) {
43+
buckysMessage.setText("onDoubleTapEvent");
44+
return true;
45+
}
46+
47+
@Override
48+
public boolean onDown(MotionEvent e) {
49+
buckysMessage.setText("onDown");
50+
return true;
51+
}
52+
53+
@Override
54+
public void onShowPress(MotionEvent e) {
55+
buckysMessage.setText("onShowPress");
56+
57+
}
58+
59+
@Override
60+
public boolean onSingleTapUp(MotionEvent e) {
61+
buckysMessage.setText("onSingleTapUp");
62+
return true;
63+
}
64+
65+
@Override
66+
public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) {
67+
buckysMessage.setText("onScroll");
68+
return true;
69+
}
70+
71+
@Override
72+
public void onLongPress(MotionEvent e) {
73+
buckysMessage.setText("onLongPress");
74+
75+
}
76+
77+
@Override
78+
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
79+
buckysMessage.setText("onFling");
80+
return true;
81+
}
82+
83+
///////// GESTURE METHODS //////////
84+
85+
86+
@Override
87+
public boolean onTouchEvent(MotionEvent event) {
88+
this.gestureDetector.onTouchEvent(event);
89+
return super.onTouchEvent(event);
90+
}
91+
92+
@Override
93+
public boolean onCreateOptionsMenu(Menu menu) {
94+
// Inflate the menu; this adds items to the action bar if it is present.
95+
getMenuInflater().inflate(R.menu.menu_main, menu);
96+
return true;
97+
}
98+
99+
@Override
100+
public boolean onOptionsItemSelected(MenuItem item) {
101+
// Handle action bar item clicks here. The action bar will
102+
// automatically handle clicks on the Home/Up button, so long
103+
// as you specify a parent activity in AndroidManifest.xml.
104+
int id = item.getItemId();
105+
106+
//noinspection SimplifiableIfStatement
107+
if (id == R.id.action_settings) {
108+
return true;
109+
}
110+
111+
return super.onOptionsItemSelected(item);
112+
}
113+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
2+
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
3+
android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
4+
android:paddingRight="@dimen/activity_horizontal_margin"
5+
android:paddingTop="@dimen/activity_vertical_margin"
6+
android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".MainActivity">
7+
8+
<TextView
9+
android:layout_width="wrap_content"
10+
android:layout_height="wrap_content"
11+
android:textAppearance="?android:attr/textAppearanceLarge"
12+
android:text="hello"
13+
android:id="@+id/buckysMessage"
14+
android:layout_centerVertical="true"
15+
android:layout_centerHorizontal="true" />
16+
</RelativeLayout>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package aybars.arslan.fragments;
2+
3+
import android.os.Bundle;
4+
import android.support.annotation.Nullable;
5+
import android.support.v4.app.Fragment;
6+
import android.view.LayoutInflater;
7+
import android.view.View;
8+
import android.view.ViewGroup;
9+
import android.widget.TextView;
10+
11+
12+
public class BottomPictureFragment extends Fragment {
13+
14+
private static TextView txtTop;
15+
private static TextView txtBottom;
16+
17+
@Override
18+
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
19+
View view = inflater.inflate(R.layout.bottom_picture_fragment, container, false);
20+
txtTop = (TextView)view.findViewById(R.id.txtTop);
21+
txtBottom = (TextView)view.findViewById(R.id.txtBottom);
22+
return view;
23+
}
24+
25+
public void setClickedText(String top, String bottom){
26+
txtTop.setText(top);
27+
txtBottom.setText(bottom);
28+
}
29+
30+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
package aybars.arslan.fragments;
2+
3+
import android.support.v7.app.ActionBarActivity;
4+
import android.os.Bundle;
5+
import android.view.Menu;
6+
import android.view.MenuItem;
7+
8+
9+
10+
public class MainActivity extends ActionBarActivity implements TopSectionFragment.TopSectionListener {
11+
12+
@Override
13+
protected void onCreate(Bundle savedInstanceState) {
14+
super.onCreate(savedInstanceState);
15+
setContentView(R.layout.activity_main);
16+
}
17+
18+
//This code called by the Top Fragment called when the user clicked the button
19+
@Override
20+
public void createClick(String top, String bottom) {
21+
BottomPictureFragment bottomFragment = (BottomPictureFragment)getSupportFragmentManager().findFragmentById(R.id.fragment2);
22+
bottomFragment.setClickedText(top, bottom);
23+
}
24+
25+
@Override
26+
public boolean onCreateOptionsMenu(Menu menu) {
27+
// Inflate the menu; this adds items to the action bar if it is present.
28+
getMenuInflater().inflate(R.menu.menu_main, menu);
29+
return true;
30+
}
31+
32+
@Override
33+
public boolean onOptionsItemSelected(MenuItem item) {
34+
// Handle action bar item clicks here. The action bar will
35+
// automatically handle clicks on the Home/Up button, so long
36+
// as you specify a parent activity in AndroidManifest.xml.
37+
int id = item.getItemId();
38+
39+
//noinspection SimplifiableIfStatement
40+
if (id == R.id.action_settings) {
41+
return true;
42+
}
43+
44+
return super.onOptionsItemSelected(item);
45+
}
46+
47+
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
package aybars.arslan.fragments;
2+
3+
import android.os.Bundle;
4+
import android.support.annotation.Nullable;
5+
import android.support.v4.app.Fragment;
6+
import android.view.LayoutInflater;
7+
import android.view.View;
8+
import android.view.ViewGroup;
9+
import android.app.Activity;
10+
import android.widget.Button;
11+
import android.widget.EditText;
12+
13+
public class TopSectionFragment extends Fragment {
14+
15+
private static EditText etTopTextInput;
16+
private static EditText etBottomTextInput;
17+
18+
TopSectionListener activityCommander;
19+
20+
public interface TopSectionListener{
21+
public void createClick(String top, String bottom);
22+
}
23+
24+
@Override
25+
public void onAttach(Activity activity) {
26+
super.onAttach(activity);
27+
try{
28+
activityCommander = (TopSectionListener) activity;
29+
}catch (ClassCastException e){
30+
throw new ClassCastException(activity.toString());
31+
}
32+
}
33+
34+
@Override
35+
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
36+
View view = inflater.inflate(R.layout.top_section_fragment, container, false);
37+
38+
etTopTextInput = (EditText)view. findViewById(R.id.etTopTextInput);
39+
etBottomTextInput = (EditText)view.findViewById(R.id.etBottomTextInput);
40+
41+
final Button button = (Button)view.findViewById(R.id.btn);
42+
43+
button.setOnClickListener(
44+
new View.OnClickListener(){
45+
46+
@Override
47+
public void onClick(View v) {
48+
buttonClicked(v);
49+
}
50+
}
51+
);
52+
53+
return view;
54+
}
55+
56+
//Calls this when button clicked
57+
public void buttonClicked(View view){
58+
activityCommander.createClick(etTopTextInput.getText().toString(), etBottomTextInput.getText().toString());
59+
}
60+
}

0 commit comments

Comments
 (0)