This file contains hidden or 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
| package com.example.android.bakingapp; | |
| import android.content.Context; | |
| import android.content.SharedPreferences; | |
| import android.support.v4.app.FragmentManager; | |
| import android.os.Bundle; | |
| import android.support.v7.app.AppCompatActivity; | |
| import android.view.Menu; | |
| import android.view.MenuInflater; | |
| import android.view.MenuItem; |
This file contains hidden or 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
| import android.annotation.SuppressLint; | |
| import android.net.Uri; | |
| import android.os.Bundle; | |
| import android.support.v7.app.AppCompatActivity; | |
| import android.view.View; | |
| import com.google.android.exoplayer2.DefaultLoadControl; | |
| import com.google.android.exoplayer2.DefaultRenderersFactory; | |
| import com.google.android.exoplayer2.ExoPlayerFactory; | |
| import com.google.android.exoplayer2.SimpleExoPlayer; | |
| import com.google.android.exoplayer2.extractor.DefaultExtractorsFactory; |
This file contains hidden or 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
| /* | |
| * Como estamos utilizando um Cursor neste exemplo, é necessário implementar a persistência dos ingredientes | |
| * na base de dados para que consigamos acessar na classe WidgetRemoteViewsFactory. | |
| */ | |
| private void sendWidgeUpdate() { | |
| Intent intent = new Intent(this, BakingWidgetProvider.class); | |
| intent.setAction(AppWidgetManager.ACTION_APPWIDGET_UPDATE); | |
| ComponentName thisAppWidget = new ComponentName(this, BakingWidgetProvider.class); |
This file contains hidden or 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
| @Override | |
| public boolean onCreateOptionsMenu(Menu menu) { | |
| getMenuInflater().inflate(R.menu.main_menu, menu); | |
| return true; | |
| } | |
| @Override | |
| public boolean onOptionsItemSelected(MenuItem item) { | |
| int id = item.getItemId(); | |
| switch (id){ |
This file contains hidden or 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
| import android.support.v7.app.AppCompatActivity; | |
| import android.os.Bundle; | |
| import android.widget.Toast; | |
| import com.udacity.learn.android.BuildConfig; | |
| import com.udacity.learn.android.R; | |
| public class MainActivity extends AppCompatActivity { | |
| @Override |
This file contains hidden or 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
| package com.udacity.education.newsapp.requester; | |
| import android.content.AsyncTaskLoader; | |
| import android.content.Context; | |
| import android.os.AsyncTask; | |
| import android.util.Log; | |
| import com.udacity.education.newsapp.domain.Feed; | |
| import com.udacity.education.newsapp.processor.FeedProcessor; | |
| import com.udacity.education.newsapp.util.Utils; |
This file contains hidden or 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
| public class OperationType{ | |
| public static final int POPULAR_MOVIES = 0; | |
| public static final int TOP_RATED = 1; | |
| } |
This file contains hidden or 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
| /** | |
| * Created by dhiegoabrantes on 13/11/16. | |
| */ | |
| public class Feed { | |
| private String mTitle; | |
| private String mSectionName; | |
| private String mThumbnail; | |
| private String mUrl; |
This file contains hidden or 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
| /** | |
| * Created by dhiegoabrantes on 20/09/16. | |
| */ | |
| public class FeedProcessor { | |
| public static List<Feed> process(String input) { | |
| List<Feed> feeds = new ArrayList<>(); | |
| if(input != null && input.startsWith("{")){ | |
| try { |
This file contains hidden or 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
| package com.udacity.education.newsapp.adapter; | |
| import android.content.Context; | |
| import android.content.Intent; | |
| import android.graphics.Bitmap; | |
| import android.net.Uri; | |
| import android.support.v4.graphics.drawable.RoundedBitmapDrawable; | |
| import android.support.v4.graphics.drawable.RoundedBitmapDrawableFactory; | |
| import android.support.v7.widget.RecyclerView; | |
| import android.view.LayoutInflater; |
NewerOlder