/*
* Copyright (C) 2009 codemobiles.com.
* http://www.codemobiles.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* author: Chaiyasit Tayabovorn
* email: chaiyasit.t@gmail.com
*/
package com.codemobiles.droidslator_tattoo.activity;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;
import android.view.Window;
import android.view.View.OnTouchListener;
import android.widget.ImageView;
import com.codemobiles.droidslator_tattoo.R;
public class ContactUsActivity extends Activity {
private ImageView imgBanner;
private ImageView backBtn;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
setContentView(R.layout.contact);
getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE,
R.layout.custom_title);
imgBanner = (ImageView) findViewById(R.id.imgBanner);
backBtn = (ImageView) findViewById(R.id.imgBack);
imgBanner.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Uri uri = Uri.parse(getString(R.string.our_website));
startActivity(new Intent(Intent.ACTION_VIEW, uri));
}
});
backBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
backBtn.setOnTouchListener(new OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
// TODO Auto-generated method stub
int eventaction = event.getAction();
switch (eventaction) {
case MotionEvent.ACTION_DOWN:
backBtn.setImageResource(R.drawable.button_back_touch);
break;
case MotionEvent.ACTION_MOVE:
break;
case MotionEvent.ACTION_UP:
backBtn.setImageResource(R.drawable.button_back);
break;
}
return false;
}
});
}
}
|