-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
45 changed files
with
540 additions
and
58 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
37 changes: 0 additions & 37 deletions
37
JoinEvents/app/src/main/java/pmv02/ppr/yuichi10/github/com/joinevents/Home.java
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
app/src/main/java/pmv02/ppr/yuichi10/github/com/joinevents/BitmapAdapter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package pmv02.ppr.yuichi10.github.com.joinevents; | ||
|
||
import android.content.Context; | ||
import android.graphics.Bitmap; | ||
import android.view.LayoutInflater; | ||
import android.view.View; | ||
import android.view.ViewGroup; | ||
import android.widget.ArrayAdapter; | ||
import android.widget.ImageView; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
/** | ||
* Created by yuichi on 8/20/15. | ||
*/ | ||
public class BitmapAdapter extends ArrayAdapter<Bitmap> { | ||
|
||
private int resourceId; | ||
|
||
public BitmapAdapter(Context context, int resource, int textViewResourceId, List<Bitmap> objects) { | ||
super(context, resource, textViewResourceId, objects); | ||
this.resourceId = resource; | ||
} | ||
|
||
public BitmapAdapter(Context context, int resource, List<Bitmap> objects) { | ||
super(context, resource, objects); | ||
resourceId = resource; | ||
} | ||
|
||
@Override | ||
public View getView(int position, View convertView, ViewGroup parent) { | ||
|
||
if (convertView == null) { | ||
LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); | ||
convertView = inflater.inflate(resourceId, null); | ||
} | ||
|
||
ImageView view = (ImageView) convertView; | ||
view.setImageBitmap(getItem(position)); | ||
|
||
return view; | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
app/src/main/java/pmv02/ppr/yuichi10/github/com/joinevents/Home.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package pmv02.ppr.yuichi10.github.com.joinevents; | ||
|
||
import android.app.Activity; | ||
import android.content.Intent; | ||
import android.os.Bundle; | ||
import android.util.Log; | ||
import android.widget.TextView; | ||
|
||
/** | ||
* Created by yuichi on 8/20/15. | ||
*/ | ||
public class Home extends Activity{ | ||
@Override | ||
public void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.home); | ||
Log.d("Intent", "success"); | ||
Intent intent = getIntent(); | ||
|
||
TextView tv = (TextView)findViewById(R.id.homeText); | ||
} | ||
} |
110 changes: 110 additions & 0 deletions
110
app/src/main/java/pmv02/ppr/yuichi10/github/com/joinevents/SignIn.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
package pmv02.ppr.yuichi10.github.com.joinevents; | ||
|
||
import android.content.Intent; | ||
import android.support.v7.app.ActionBarActivity; | ||
import android.os.Bundle; | ||
import android.util.Log; | ||
import android.view.Menu; | ||
import android.view.MenuItem; | ||
import android.view.View; | ||
import android.widget.Button; | ||
import android.widget.EditText; | ||
|
||
import java.security.MessageDigest; | ||
import java.security.NoSuchAlgorithmException; | ||
|
||
public class SignIn extends ActionBarActivity implements View.OnClickListener{ | ||
EditText idSignIn; | ||
EditText passwordSignIn; | ||
static String packageName = "pmv02.ppr.yuichi10.github.com.joinevents"; | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_sign_in); | ||
//get the edit text for sign in | ||
idSignIn = (EditText)findViewById(R.id.idSignIn); | ||
passwordSignIn = (EditText)findViewById(R.id.passwordSignIn); | ||
//button for sign in | ||
Button doSignIn = (Button)findViewById(R.id.doSignIn); | ||
doSignIn.setOnClickListener(this); | ||
//button for sign up | ||
Button doSignUp = (Button)findViewById(R.id.doSignUp); | ||
doSignUp.setOnClickListener(this); | ||
} | ||
|
||
@Override | ||
public boolean onCreateOptionsMenu(Menu menu) { | ||
// Inflate the menu; this adds items to the action bar if it is present. | ||
getMenuInflater().inflate(R.menu.menu_sign_in, menu); | ||
return true; | ||
} | ||
|
||
@Override | ||
public boolean onOptionsItemSelected(MenuItem item) { | ||
// Handle action bar item clicks here. The action bar will | ||
// automatically handle clicks on the Home/Up button, so long | ||
// as you specify a parent activity in AndroidManifest.xml. | ||
int id = item.getItemId(); | ||
|
||
//noinspection SimplifiableIfStatement | ||
if (id == R.id.action_settings) { | ||
return true; | ||
} | ||
|
||
return super.onOptionsItemSelected(item); | ||
} | ||
|
||
@Override | ||
public void onClick(View v) { | ||
|
||
Intent intent = new Intent(); | ||
switch (v.getId()){ | ||
case R.id.doSignIn: | ||
String strID = idSignIn.getText().toString(); | ||
String strPass = passwordSignIn.getText().toString(); | ||
strPass = encodePassdigiest(strPass); | ||
Log.d("Intent","push button"); | ||
intent.setClassName(packageName, packageName + ".Home"); | ||
startActivity(intent); | ||
break; | ||
case R.id.doSignUp: | ||
intent.setClassName(packageName, packageName + ".SignUP"); | ||
startActivity(intent); | ||
break; | ||
} | ||
} | ||
|
||
|
||
|
||
public String encodePassdigiest(String password){ | ||
byte[] enclyptedHash=null; | ||
// MD5で暗号化したByte型配列を取得する | ||
MessageDigest md5; | ||
try { | ||
md5 = MessageDigest.getInstance("MD5"); | ||
md5.update(password.getBytes()); | ||
enclyptedHash = md5.digest(); | ||
|
||
// 暗号化されたByte型配列を、16進数表記文字列に変換する | ||
} catch (NoSuchAlgorithmException e) { | ||
// TODO Auto-generated catch block | ||
e.printStackTrace(); | ||
} | ||
return bytesToHexString(enclyptedHash); | ||
} | ||
|
||
private String bytesToHexString(byte[] fromByte) { | ||
|
||
StringBuilder hexStrBuilder = new StringBuilder(); | ||
for (int i = 0; i < fromByte.length; i++) { | ||
|
||
// 16進数表記で1桁数値だった場合、2桁目を0で埋める | ||
if ((fromByte[i] & 0xff) < 0x10) { | ||
hexStrBuilder.append("0"); | ||
} | ||
hexStrBuilder.append(Integer.toHexString(0xff & fromByte[i])); | ||
} | ||
return hexStrBuilder.toString(); | ||
} | ||
} |
47 changes: 47 additions & 0 deletions
47
app/src/main/java/pmv02/ppr/yuichi10/github/com/joinevents/SignUP.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package pmv02.ppr.yuichi10.github.com.joinevents; | ||
|
||
import android.app.Activity; | ||
import android.content.Intent; | ||
import android.os.Bundle; | ||
import android.util.Log; | ||
import android.view.View; | ||
import android.widget.Button; | ||
import android.widget.TextView; | ||
|
||
/** | ||
* Created by yuichi on 8/20/15. | ||
*/ | ||
public class SignUP extends Activity implements View.OnClickListener{ | ||
static int mRequestCode = 1001; | ||
@Override | ||
public void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.sign_up); | ||
Log.d("Intent", "success"); | ||
Intent intent = getIntent(); | ||
|
||
Button thumbnail = (Button)findViewById(R.id.signUpGetImage); | ||
thumbnail.setOnClickListener(this); | ||
} | ||
|
||
public void onActivityResult( int requestCode, int resultCode, Intent intent ){ | ||
if(requestCode == this.mRequestCode){ | ||
if(resultCode == Activity.RESULT_OK){ | ||
// 返却されてきたintentから値を取り出す | ||
String str = intent.getStringExtra( "key" ); | ||
Log.d("aa",str); | ||
} | ||
} | ||
} | ||
|
||
@Override | ||
public void onClick(View v) { | ||
switch (v.getId()){ | ||
case R.id.signUpGetImage: | ||
Intent intent = new Intent(); | ||
intent.setClassName(SignIn.packageName, SignIn.packageName + ".ThumbnailImage"); | ||
startActivityForResult(intent,this.mRequestCode); | ||
break; | ||
} | ||
} | ||
} |
Oops, something went wrong.