├── androidTest
└── java
│ └── com
│ └── nopalyer
│ └── newsapp
│ └── ExampleInstrumentedTest.java
├── main
├── AndroidManifest.xml
├── java
│ └── com
│ │ └── nopalyer
│ │ └── newsapp
│ │ ├── Adapter.java
│ │ ├── ApiClient.java
│ │ ├── ApiInterface.java
│ │ ├── Detailed.java
│ │ ├── MainActivity.java
│ │ ├── Model
│ │ ├── Articles.java
│ │ ├── Headlines.java
│ │ └── Source.java
│ │ └── SplashScreen.java
└── res
│ ├── drawable-v24
│ ├── circle_logo.png
│ ├── ic_launcher_foreground.xml
│ ├── img.jpg
│ └── logo.png
│ ├── drawable
│ ├── black_background.xml
│ ├── gradient.xml
│ ├── ic_close_black_24dp.xml
│ ├── ic_dot_24dp.xml
│ ├── ic_launcher_background.xml
│ └── ic_search_black_24dp.xml
│ ├── font
│ ├── g_bold.otf
│ └── g_light.otf
│ ├── layout
│ ├── about_us_pop_up.xml
│ ├── activity_detailed.xml
│ ├── activity_main.xml
│ ├── activity_splash_screen.xml
│ └── items.xml
│ ├── mipmap-anydpi-v26
│ ├── ic_launcher.xml
│ └── ic_launcher_round.xml
│ ├── mipmap-hdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-mdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-xhdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-xxhdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-xxxhdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ └── values
│ ├── colors.xml
│ ├── strings.xml
│ └── styles.xml
└── test
└── java
└── com
└── nopalyer
└── newsapp
└── ExampleUnitTest.java
/androidTest/java/com/nopalyer/newsapp/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.nopalyer.newsapp;
2 |
3 | import android.content.Context;
4 |
5 | import androidx.test.platform.app.InstrumentationRegistry;
6 | import androidx.test.ext.junit.runners.AndroidJUnit4;
7 |
8 | import org.junit.Test;
9 | import org.junit.runner.RunWith;
10 |
11 | import static org.junit.Assert.*;
12 |
13 | /**
14 | * Instrumented test, which will execute on an Android device.
15 | *
16 | * @see Testing documentation
17 | */
18 | @RunWith(AndroidJUnit4.class)
19 | public class ExampleInstrumentedTest {
20 | @Test
21 | public void useAppContext() {
22 | // Context of the app under test.
23 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
24 |
25 | assertEquals("com.nopalyer.newsapp", appContext.getPackageName());
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/main/java/com/nopalyer/newsapp/Adapter.java:
--------------------------------------------------------------------------------
1 | package com.nopalyer.newsapp;
2 |
3 | import android.content.Context;
4 | import android.content.Intent;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 | import android.widget.ImageView;
9 | import android.widget.TextView;
10 |
11 | import androidx.annotation.NonNull;
12 | import androidx.cardview.widget.CardView;
13 | import androidx.recyclerview.widget.RecyclerView;
14 |
15 | import com.nopalyer.newsapp.Model.Articles;
16 | import com.nopalyer.newsapp.Model.Source;
17 | import com.squareup.picasso.Picasso;
18 |
19 | import org.ocpsoft.prettytime.PrettyTime;
20 | import org.ocpsoft.prettytime.format.SimpleTimeFormat;
21 |
22 | import java.text.ParseException;
23 | import java.text.SimpleDateFormat;
24 | import java.util.Date;
25 | import java.util.List;
26 | import java.util.Locale;
27 |
28 | public class Adapter extends RecyclerView.Adapter {
29 |
30 | Context context;
31 | List articles;
32 |
33 |
34 | public Adapter(Context context, List articles) {
35 | this.context = context;
36 | this.articles = articles;
37 | }
38 |
39 | @NonNull
40 | @Override
41 | public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
42 | View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.items,parent,false);
43 | return new ViewHolder(view);
44 | }
45 |
46 | @Override
47 | public void onBindViewHolder(@NonNull final ViewHolder holder, int position) {
48 |
49 |
50 | final Articles a = articles.get(position);
51 |
52 | String imageUrl = a.getUrlToImage();
53 | String url = a.getUrl();
54 |
55 | Picasso.with(context).load(imageUrl).into(holder.imageView);
56 |
57 | holder.tvTitle.setText(a.getTitle());
58 | holder.tvSource.setText(a.getSource().getName());
59 | holder.tvDate.setText("\u2022"+dateTime(a.getPublishedAt()));
60 |
61 | holder.cardView.setOnClickListener(new View.OnClickListener() {
62 | @Override
63 | public void onClick(View v) {
64 | Intent intent = new Intent(context,Detailed.class);
65 | intent.putExtra("title",a.getTitle());
66 | intent.putExtra("source",a.getSource().getName());
67 | intent.putExtra("time",dateTime(a.getPublishedAt()));
68 | intent.putExtra("desc",a.getDescription());
69 | intent.putExtra("imageUrl",a.getUrlToImage());
70 | intent.putExtra("url",a.getUrl());
71 | context.startActivity(intent);
72 | }
73 | });
74 |
75 | }
76 |
77 | @Override
78 | public int getItemCount() {
79 | return articles.size();
80 | }
81 |
82 | public class ViewHolder extends RecyclerView.ViewHolder {
83 | TextView tvTitle,tvSource,tvDate;
84 | ImageView imageView;
85 | CardView cardView;
86 |
87 | public ViewHolder(@NonNull View itemView) {
88 | super(itemView);
89 |
90 | tvTitle = itemView.findViewById(R.id.tvTitle);
91 | tvSource = itemView.findViewById(R.id.tvSource);
92 | tvDate = itemView.findViewById(R.id.tvDate);
93 | imageView = itemView.findViewById(R.id.image);
94 | cardView = itemView.findViewById(R.id.cardView);
95 |
96 | }
97 | }
98 |
99 |
100 | public String dateTime(String t){
101 | PrettyTime prettyTime = new PrettyTime(new Locale(getCountry()));
102 | String time = null;
103 | try {
104 | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:",Locale.ENGLISH);
105 | Date date = simpleDateFormat.parse(t);
106 | time = prettyTime.format(date);
107 | }catch (ParseException e) {
108 | e.printStackTrace();
109 | }
110 | return time;
111 |
112 | }
113 |
114 | public String getCountry(){
115 | Locale locale = Locale.getDefault();
116 | String country = locale.getCountry();
117 | return country.toLowerCase();
118 | }
119 | }
120 |
--------------------------------------------------------------------------------
/main/java/com/nopalyer/newsapp/ApiClient.java:
--------------------------------------------------------------------------------
1 | package com.nopalyer.newsapp;
2 |
3 | import retrofit2.Retrofit;
4 | import retrofit2.converter.gson.GsonConverterFactory;
5 |
6 | public class ApiClient {
7 | private static final String BASE_URL = "https://newsapi.org/v2/";
8 | private static ApiClient apiClient;
9 | private static Retrofit retrofit;
10 |
11 | private ApiClient(){
12 | retrofit = new Retrofit.Builder().baseUrl(BASE_URL).addConverterFactory(GsonConverterFactory.create()).build();
13 | }
14 |
15 | public static synchronized ApiClient getInstance(){
16 | if (apiClient == null){
17 | apiClient = new ApiClient();
18 | }
19 | return apiClient;
20 | }
21 |
22 |
23 | public ApiInterface getApi(){
24 | return retrofit.create(ApiInterface.class);
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/main/java/com/nopalyer/newsapp/ApiInterface.java:
--------------------------------------------------------------------------------
1 | package com.nopalyer.newsapp;
2 |
3 | import com.nopalyer.newsapp.Model.Headlines;
4 |
5 | import retrofit2.Call;
6 | import retrofit2.http.GET;
7 | import retrofit2.http.Query;
8 |
9 | public interface ApiInterface {
10 |
11 |
12 | @GET("top-headlines")
13 | Call getHeadlines(
14 | @Query("country") String country,
15 | @Query("apiKey") String apiKey
16 | );
17 |
18 | @GET("everything")
19 | Call getSpecificData(
20 | @Query("q") String query,
21 | @Query("apiKey") String apiKey
22 | );
23 |
24 |
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/main/java/com/nopalyer/newsapp/Detailed.java:
--------------------------------------------------------------------------------
1 | package com.nopalyer.newsapp;
2 |
3 | import androidx.appcompat.app.AppCompatActivity;
4 |
5 | import android.content.Intent;
6 | import android.os.Bundle;
7 | import android.view.View;
8 | import android.webkit.WebView;
9 | import android.webkit.WebViewClient;
10 | import android.widget.ImageView;
11 | import android.widget.ProgressBar;
12 | import android.widget.TextView;
13 |
14 | import com.squareup.picasso.Picasso;
15 |
16 | public class Detailed extends AppCompatActivity {
17 |
18 | TextView tvTitle,tvSource,tvTime,tvDesc;
19 | ImageView imageView;
20 | WebView webView;
21 | ProgressBar loader;
22 |
23 | @Override
24 | protected void onCreate(Bundle savedInstanceState) {
25 | super.onCreate(savedInstanceState);
26 | setContentView(R.layout.activity_detailed);
27 |
28 | tvTitle = findViewById(R.id.tvTitle);
29 | tvSource = findViewById(R.id.tvSource);
30 | tvTime = findViewById(R.id.tvDate);
31 | tvDesc = findViewById(R.id.tvDesc);
32 |
33 | imageView = findViewById(R.id.imageView);
34 |
35 | webView = findViewById(R.id.webView);
36 |
37 | loader = findViewById(R.id.webViewLoader);
38 | loader.setVisibility(View.VISIBLE);
39 |
40 | Intent intent = getIntent();
41 | String title = intent.getStringExtra("title");
42 | String source = intent.getStringExtra("source");
43 | String time = intent.getStringExtra("time");
44 | String desc = intent.getStringExtra("desc");
45 | String imageUrl = intent.getStringExtra("imageUrl");
46 | String url = intent.getStringExtra("url");
47 |
48 |
49 | tvTitle.setText(title);
50 | tvSource.setText(source);
51 | tvTime.setText(time);
52 | tvDesc.setText(desc);
53 |
54 | Picasso.with(Detailed.this).load(imageUrl).into(imageView);
55 |
56 | webView.getSettings().setDomStorageEnabled(true);
57 | webView.getSettings().setJavaScriptEnabled(true);
58 | webView.getSettings().setLoadsImagesAutomatically(true);
59 | webView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
60 | webView.setWebViewClient(new WebViewClient());
61 | webView.loadUrl(url);
62 | if (webView.isShown()){
63 | loader.setVisibility(View.INVISIBLE);
64 | }
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/main/java/com/nopalyer/newsapp/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.nopalyer.newsapp;
2 |
3 | import androidx.appcompat.app.AppCompatActivity;
4 | import androidx.recyclerview.widget.LinearLayoutManager;
5 | import androidx.recyclerview.widget.RecyclerView;
6 | import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
7 |
8 | import android.app.Dialog;
9 | import android.os.Bundle;
10 | import android.view.View;
11 | import android.widget.Button;
12 | import android.widget.EditText;
13 | import android.widget.ProgressBar;
14 | import android.widget.Toast;
15 |
16 | import com.nopalyer.newsapp.Model.Articles;
17 | import com.nopalyer.newsapp.Model.Headlines;
18 |
19 | import java.util.ArrayList;
20 | import java.util.List;
21 | import java.util.Locale;
22 |
23 | import retrofit2.Call;
24 | import retrofit2.Callback;
25 | import retrofit2.Response;
26 |
27 | public class MainActivity extends AppCompatActivity {
28 |
29 | RecyclerView recyclerView;
30 | SwipeRefreshLayout swipeRefreshLayout;
31 | EditText etQuery;
32 | Button btnSearch,btnAboutUs;
33 | Dialog dialog;
34 | final String API_KEY = "YOUR API KEY";
35 | Adapter adapter;
36 | List articles = new ArrayList<>();
37 | @Override
38 | protected void onCreate(Bundle savedInstanceState) {
39 | super.onCreate(savedInstanceState);
40 | setContentView(R.layout.activity_main);
41 |
42 | swipeRefreshLayout = findViewById(R.id.swipeRefresh);
43 | recyclerView = findViewById(R.id.recyclerView);
44 |
45 | etQuery = findViewById(R.id.etQuery);
46 | btnSearch = findViewById(R.id.btnSearch);
47 | btnAboutUs = findViewById(R.id.aboutUs);
48 | dialog = new Dialog(MainActivity.this);
49 |
50 | recyclerView.setLayoutManager(new LinearLayoutManager(this));
51 | final String country = getCountry();
52 |
53 |
54 | swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
55 | @Override
56 | public void onRefresh() {
57 | retrieveJson("",country,API_KEY);
58 | }
59 | });
60 | retrieveJson("",country,API_KEY);
61 |
62 | btnSearch.setOnClickListener(new View.OnClickListener() {
63 | @Override
64 | public void onClick(View v) {
65 | if (!etQuery.getText().toString().equals("")){
66 | swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
67 | @Override
68 | public void onRefresh() {
69 | retrieveJson(etQuery.getText().toString(),country,API_KEY);
70 | }
71 | });
72 | retrieveJson(etQuery.getText().toString(),country,API_KEY);
73 | }else{
74 | swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
75 | @Override
76 | public void onRefresh() {
77 | retrieveJson("",country,API_KEY);
78 | }
79 | });
80 | retrieveJson("",country,API_KEY);
81 | }
82 | }
83 | });
84 |
85 | btnAboutUs.setOnClickListener(new View.OnClickListener() {
86 | @Override
87 | public void onClick(View v) {
88 | showDialog();
89 | }
90 | });
91 |
92 |
93 |
94 |
95 |
96 |
97 | }
98 |
99 | public void retrieveJson(String query ,String country, String apiKey){
100 |
101 |
102 | swipeRefreshLayout.setRefreshing(true);
103 | Call call;
104 | if (!etQuery.getText().toString().equals("")){
105 | call= ApiClient.getInstance().getApi().getSpecificData(query,apiKey);
106 | }else{
107 | call= ApiClient.getInstance().getApi().getHeadlines(country,apiKey);
108 | }
109 |
110 | call.enqueue(new Callback() {
111 | @Override
112 | public void onResponse(Call call, Response response) {
113 | if (response.isSuccessful() && response.body().getArticles() != null){
114 | swipeRefreshLayout.setRefreshing(false);
115 | articles.clear();
116 | articles = response.body().getArticles();
117 | adapter = new Adapter(MainActivity.this,articles);
118 | recyclerView.setAdapter(adapter);
119 | }
120 | }
121 |
122 | @Override
123 | public void onFailure(Call call, Throwable t) {
124 | swipeRefreshLayout.setRefreshing(false);
125 | Toast.makeText(MainActivity.this, t.getLocalizedMessage(), Toast.LENGTH_SHORT).show();
126 | }
127 | });
128 | }
129 |
130 | public String getCountry(){
131 | Locale locale = Locale.getDefault();
132 | String country = locale.getCountry();
133 | return country.toLowerCase();
134 | }
135 |
136 | public void showDialog(){
137 | Button btnClose;
138 | dialog.setContentView(R.layout.about_us_pop_up);
139 | dialog.show();
140 | btnClose = dialog.findViewById(R.id.close);
141 |
142 | btnClose.setOnClickListener(new View.OnClickListener() {
143 | @Override
144 | public void onClick(View v) {
145 | dialog.dismiss();
146 | }
147 | });
148 | }
149 | }
150 |
--------------------------------------------------------------------------------
/main/java/com/nopalyer/newsapp/Model/Articles.java:
--------------------------------------------------------------------------------
1 | package com.nopalyer.newsapp.Model;
2 | import com.google.gson.annotations.Expose;
3 | import com.google.gson.annotations.SerializedName;
4 |
5 | public class Articles {
6 |
7 |
8 | @SerializedName("source")
9 | @Expose
10 | private Source source;
11 |
12 | @SerializedName("author")
13 | @Expose
14 | private String author;
15 |
16 | @SerializedName("title")
17 | @Expose
18 | private String title;
19 |
20 | @SerializedName("description")
21 | @Expose
22 | private String description;
23 |
24 | @SerializedName("url")
25 | @Expose
26 | private String url;
27 |
28 | public String getUrl() {
29 | return url;
30 | }
31 |
32 | public void setUrl(String url) {
33 | this.url = url;
34 | }
35 |
36 | @SerializedName("urlToImage")
37 | @Expose
38 | private String urlToImage;
39 |
40 | @SerializedName("publishedAt")
41 | @Expose
42 | private String publishedAt;
43 |
44 |
45 |
46 | public Source getSource() {
47 | return source;
48 | }
49 |
50 | public void setSource(Source source) {
51 | this.source = source;
52 | }
53 |
54 | public String getAuthor() {
55 | return author;
56 | }
57 |
58 | public void setAuthor(String author) {
59 | this.author = author;
60 | }
61 |
62 | public String getTitle() {
63 | return title;
64 | }
65 |
66 | public void setTitle(String title) {
67 | this.title = title;
68 | }
69 |
70 | public String getDescription() {
71 | return description;
72 | }
73 |
74 | public void setDescription(String description) {
75 | this.description = description;
76 | }
77 |
78 | public String getUrlToImage() {
79 | return urlToImage;
80 | }
81 |
82 | public void setUrlToImage(String urlToImage) {
83 | this.urlToImage = urlToImage;
84 | }
85 |
86 | public String getPublishedAt() {
87 | return publishedAt;
88 | }
89 |
90 | public void setPublishedAt(String publishedAt) {
91 | this.publishedAt = publishedAt;
92 | }
93 | }
94 |
--------------------------------------------------------------------------------
/main/java/com/nopalyer/newsapp/Model/Headlines.java:
--------------------------------------------------------------------------------
1 | package com.nopalyer.newsapp.Model;
2 |
3 | import com.google.gson.annotations.Expose;
4 | import com.google.gson.annotations.SerializedName;
5 |
6 | import java.util.List;
7 |
8 | public class Headlines {
9 |
10 | @SerializedName("status")
11 | @Expose
12 | private String status;
13 |
14 | @SerializedName("totalResults")
15 | @Expose
16 | private String totalResults;
17 |
18 | @SerializedName("articles")
19 | @Expose
20 | private List articles;
21 |
22 | public String getStatus() {
23 | return status;
24 | }
25 |
26 | public void setStatus(String status) {
27 | this.status = status;
28 | }
29 |
30 | public String getTotalResults() {
31 | return totalResults;
32 | }
33 |
34 | public void setTotalResults(String totalResults) {
35 | this.totalResults = totalResults;
36 | }
37 |
38 | public List getArticles() {
39 | return articles;
40 | }
41 |
42 | public void setArticles(List articles) {
43 | this.articles = articles;
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/main/java/com/nopalyer/newsapp/Model/Source.java:
--------------------------------------------------------------------------------
1 | package com.nopalyer.newsapp.Model;
2 |
3 | import com.google.gson.annotations.Expose;
4 | import com.google.gson.annotations.SerializedName;
5 |
6 | public class Source {
7 |
8 | @SerializedName("id")
9 | @Expose
10 | private String id;
11 |
12 | @SerializedName("name")
13 | @Expose
14 | private String name;
15 |
16 | public String getId() {
17 | return id;
18 | }
19 |
20 | public void setId(String id) {
21 | this.id = id;
22 | }
23 |
24 | public String getName() {
25 | return name;
26 | }
27 |
28 | public void setName(String name) {
29 | this.name = name;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/main/java/com/nopalyer/newsapp/SplashScreen.java:
--------------------------------------------------------------------------------
1 | package com.nopalyer.newsapp;
2 |
3 | import androidx.appcompat.app.AppCompatActivity;
4 |
5 | import android.content.Intent;
6 | import android.os.Bundle;
7 |
8 | import static java.lang.Thread.sleep;
9 |
10 | public class SplashScreen extends AppCompatActivity {
11 |
12 | @Override
13 | protected void onCreate(Bundle savedInstanceState) {
14 | super.onCreate(savedInstanceState);
15 | setContentView(R.layout.activity_splash_screen);
16 |
17 | final Thread thread = new Thread(new Runnable() {
18 | @Override
19 | public void run() {
20 | try {
21 | sleep(1500);
22 | Intent intent = new Intent(SplashScreen.this,MainActivity.class);
23 | startActivity(intent);
24 | finish();
25 | }catch (InterruptedException e){
26 | e.printStackTrace();
27 | }
28 | }
29 | });thread.start();
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/main/res/drawable-v24/circle_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coding-with-me/NewsApp/2e00161d8d2612c99f50bd91bc059017b13676fa/main/res/drawable-v24/circle_logo.png
--------------------------------------------------------------------------------
/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
12 |
13 |
19 |
22 |
25 |
26 |
27 |
28 |
34 |
35 |
--------------------------------------------------------------------------------
/main/res/drawable-v24/img.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coding-with-me/NewsApp/2e00161d8d2612c99f50bd91bc059017b13676fa/main/res/drawable-v24/img.jpg
--------------------------------------------------------------------------------
/main/res/drawable-v24/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coding-with-me/NewsApp/2e00161d8d2612c99f50bd91bc059017b13676fa/main/res/drawable-v24/logo.png
--------------------------------------------------------------------------------
/main/res/drawable/black_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/main/res/drawable/gradient.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/main/res/drawable/ic_close_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/main/res/drawable/ic_dot_24dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/main/res/drawable/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
15 |
20 |
25 |
30 |
35 |
40 |
45 |
50 |
55 |
60 |
65 |
70 |
75 |
80 |
85 |
90 |
95 |
100 |
105 |
110 |
115 |
120 |
125 |
130 |
135 |
140 |
145 |
150 |
155 |
160 |
165 |
170 |
171 |
--------------------------------------------------------------------------------
/main/res/drawable/ic_search_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/main/res/font/g_bold.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coding-with-me/NewsApp/2e00161d8d2612c99f50bd91bc059017b13676fa/main/res/font/g_bold.otf
--------------------------------------------------------------------------------
/main/res/font/g_light.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coding-with-me/NewsApp/2e00161d8d2612c99f50bd91bc059017b13676fa/main/res/font/g_light.otf
--------------------------------------------------------------------------------
/main/res/layout/about_us_pop_up.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
17 |
22 |
23 |
30 |
31 |
39 |
40 |
41 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/main/res/layout/activity_detailed.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
13 |
14 |
18 |
19 |
24 |
25 |
29 |
30 |
31 |
32 |
35 |
36 |
37 |
42 |
43 |
48 |
49 |
50 |
51 |
55 |
56 |
57 |
58 |
64 |
65 |
73 |
74 |
83 |
84 |
85 |
86 |
95 |
96 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
118 |
119 |
124 |
125 |
129 |
130 |
131 |
132 |
133 |
134 |
--------------------------------------------------------------------------------
/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
15 |
16 |
27 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
50 |
51 |
66 |
67 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
87 |
88 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
--------------------------------------------------------------------------------
/main/res/layout/activity_splash_screen.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
18 |
19 |
--------------------------------------------------------------------------------
/main/res/layout/items.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
15 |
16 |
17 |
18 |
21 |
22 |
23 |
28 |
29 |
34 |
35 |
36 |
37 |
41 |
42 |
51 |
52 |
58 |
59 |
67 |
68 |
77 |
78 |
79 |
80 |
81 |
82 |
--------------------------------------------------------------------------------
/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coding-with-me/NewsApp/2e00161d8d2612c99f50bd91bc059017b13676fa/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coding-with-me/NewsApp/2e00161d8d2612c99f50bd91bc059017b13676fa/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coding-with-me/NewsApp/2e00161d8d2612c99f50bd91bc059017b13676fa/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coding-with-me/NewsApp/2e00161d8d2612c99f50bd91bc059017b13676fa/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coding-with-me/NewsApp/2e00161d8d2612c99f50bd91bc059017b13676fa/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coding-with-me/NewsApp/2e00161d8d2612c99f50bd91bc059017b13676fa/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coding-with-me/NewsApp/2e00161d8d2612c99f50bd91bc059017b13676fa/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coding-with-me/NewsApp/2e00161d8d2612c99f50bd91bc059017b13676fa/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coding-with-me/NewsApp/2e00161d8d2612c99f50bd91bc059017b13676fa/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coding-with-me/NewsApp/2e00161d8d2612c99f50bd91bc059017b13676fa/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #f7f6f9
4 | #191819
5 | #191819
6 |
7 | #eeefee
8 | #CE0700
9 | #191819
10 | #f7f6f9
11 |
12 |
--------------------------------------------------------------------------------
/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | News App
3 |
4 |
--------------------------------------------------------------------------------
/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/test/java/com/nopalyer/newsapp/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.nopalyer.newsapp;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------