Skip to content

Commit

Permalink
#76 create profile screen
Browse files Browse the repository at this point in the history
  • Loading branch information
DariaZubkova authored Jul 16, 2020
1 parent 86c2662 commit 1dc1920
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions app/src/main/java/com/example/ubercoffee/ProfileActivity.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package com.example.ubercoffee;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.text.SpannableString;
import android.text.Spanned;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class ProfileActivity extends AppCompatActivity {

private String phone;
private Button buttonShops;
private Button buttonProfile;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_profile);

buttonShops = findViewById(R.id.listOfShops);
buttonProfile = findViewById(R.id.profile);

buttonShops.setAlpha(0.7f);
buttonProfile.setAlpha(1f);

phone = getIntent().getStringExtra("phone_number");

TextView tvPhone= (TextView) findViewById(R.id.phone);
//передаем строкой адрес
int sizePhone = phone.length();
String new_phone = "<u> " + phone.substring(0, sizePhone) + " </u>";
Spanned textSpan = android.text.Html.fromHtml(new_phone);
tvPhone.setText(textSpan);

buttonShops.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//buttonShops.setAlpha(1f);
//buttonProfile.setAlpha(0.7f);
finish();
//Intent intentShops = new Intent(ProfileActivity.this, ListOfShopsActivity.class);
//startActivity(intentShops);
}
});


}

}

0 comments on commit 1dc1920

Please sign in to comment.