Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions TesteBuildbox/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures
.externalNativeBuild
18 changes: 18 additions & 0 deletions TesteBuildbox/.idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 33 additions & 0 deletions TesteBuildbox/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions TesteBuildbox/.idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions TesteBuildbox/.idea/runConfigurations.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions TesteBuildbox/app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
36 changes: 36 additions & 0 deletions TesteBuildbox/app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 26
defaultConfig {
applicationId "com.testebuildbox.testebuildbox"
minSdkVersion 22
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:design:26.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
implementation 'com.android.support:support-annotations:27.1.1'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.android.support:cardview-v7:26.1.0'
implementation 'com.android.support:recyclerview-v7:26.1.0'

}
21 changes: 21 additions & 0 deletions TesteBuildbox/app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.testebuildbox.testebuildbox;

import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;

import org.junit.Test;
import org.junit.runner.RunWith;

import static org.junit.Assert.*;

/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();

assertEquals("com.testebuildbox.testebuildbox", appContext.getPackageName());
}
}
27 changes: 27 additions & 0 deletions TesteBuildbox/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.testebuildbox.testebuildbox">

<uses-permission android:name="android.permission.INTERNET" />

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name=".Activityes.MainActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".Activityes.GaleriaInfoActivityDetails"></activity>
</application>

</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
package com.testebuildbox.testebuildbox.Activityes;

import android.content.Intent;
import android.media.Image;
import android.net.Uri;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.MenuItem;
import android.view.View;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.TextView;

import com.squareup.picasso.Picasso;
import com.testebuildbox.testebuildbox.R;
import com.testebuildbox.testebuildbox.model.GaleriaInfo;
import com.testebuildbox.testebuildbox.model.User;

public class GaleriaInfoActivityDetails extends AppCompatActivity {

private ImageView imgPerfil;
private TextView nomeUser;
private TextView local;
private TextView instagram;
private TextView youtube;
private ImageView instagramIcon;
private ImageView youtubeIcon;
private ProgressBar progressPerfil;

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

getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeButtonEnabled(true);
getSupportActionBar().setTitle("Perfil");


imgPerfil = findViewById(R.id.imgPerfil);
nomeUser = findViewById(R.id.nomeUser);
local = findViewById(R.id.local);
imgPerfil = findViewById(R.id.imgPerfil);
youtube = findViewById(R.id.youtube);
instagram = findViewById(R.id.instagram);
instagramIcon = findViewById(R.id.instagramIcon);
youtubeIcon = findViewById(R.id.youtubeIcon);
progressPerfil = findViewById(R.id.progressPerfil);


Intent intent = getIntent();

if(intent != null){
//Recupera os dados que veio no Intent
final User user = getIntent().getExtras().getParcelable("UserInfo");
if(user != null){

//Deixa invisivel os botões das redes sociais caso venha nulo
if(user.getInstagram_username() == null){
instagram.setVisibility(View.GONE);
instagramIcon.setVisibility(View.GONE);
}
if(user.getPortfolio_url() == null){
youtube.setVisibility(View.GONE);
youtubeIcon.setVisibility(View.GONE);
}

//Insere a foto do pefil no imageView
Picasso.get()
.load(user.getProfile_image().getLarge())
.resize(200, 200)
.centerCrop()
.into(imgPerfil);

//Seta os dados nos respectivos componentes
nomeUser.setText(user.getName());
local.setText(user.getLocation());
instagram.setText(user.getInstagram_username());
youtube.setText("Portifolio");

youtube.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String url = user.getPortfolio_url();
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
startActivity(i);
}
});

instagram.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String url = "https://www.instagram.com/"+user.getInstagram_username();
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
startActivity(i);
}
});
}
}
progressPerfil.setVisibility(View.GONE);
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {

switch (item.getItemId()){
case android.R.id.home:{
finish();
break;
}
}

return super.onOptionsItemSelected(item);
}
}
Loading