-
-
Notifications
You must be signed in to change notification settings - Fork 105
contributors name added to about page #375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
aniket691
wants to merge
3
commits into
adeekshith:main
Choose a base branch
from
aniket691:repo-contributors-display-on-about-page
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
83 changes: 83 additions & 0 deletions
83
app/src/main/java/com/parishod/watomatic/activity/about/AboutActivity.java
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| package com.parishod.watomatic.activity.about; | ||
|
|
||
|
adeekshith marked this conversation as resolved.
|
||
| import android.content.Intent; | ||
| import android.net.Uri; | ||
| import android.os.Bundle; | ||
| import android.view.View; | ||
| import android.widget.TextView; | ||
| import android.widget.Toast; | ||
|
|
||
| import androidx.appcompat.app.AppCompatActivity; | ||
|
|
||
| import com.parishod.watomatic.R; | ||
| import com.parishod.watomatic.model.githubUesrsResponse.GithubUsersResponse; | ||
| import com.parishod.watomatic.network.GetGitUserInterface; | ||
| import com.parishod.watomatic.network.RetrofitInstance; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| import retrofit2.Call; | ||
| import retrofit2.Callback; | ||
| import retrofit2.Response; | ||
| import retrofit2.Retrofit; | ||
|
|
||
| public class AboutActivity extends AppCompatActivity implements View.OnClickListener { | ||
|
|
||
| private TextView text_view; | ||
| private String all_contributers = ""; | ||
| private TextView privacy_policy; | ||
| private TextView developer_link; | ||
|
|
||
| @Override | ||
| protected void onCreate(Bundle savedInstanceState) { | ||
| super.onCreate(savedInstanceState); | ||
| setContentView(R.layout.activity_about); | ||
|
|
||
| text_view = findViewById(R.id.contributers); | ||
| privacy_policy = findViewById(R.id.privacyPolicyLabel); | ||
| developer_link = findViewById(R.id.developerLink); | ||
|
|
||
| privacy_policy.setOnClickListener(this); | ||
| developer_link.setOnClickListener(this); | ||
| Retrofit retrofit = RetrofitInstance.getRetrofitInstance(); | ||
| GetGitUserInterface getGitUserInterface = retrofit.create(GetGitUserInterface.class); | ||
|
|
||
| Call<List<GithubUsersResponse>> call = getGitUserInterface.getContriUsers(); | ||
| call.enqueue(new Callback<List<GithubUsersResponse>>() { | ||
| @Override | ||
| public void onResponse(Call<List<GithubUsersResponse>> call, Response<List<GithubUsersResponse>> response) { | ||
| if (response.isSuccessful()) { | ||
| List<GithubUsersResponse> list = response.body(); | ||
| for (GithubUsersResponse i : list) { | ||
| all_contributers += i.getLogin() + ", "; | ||
| } | ||
| text_view.setText(all_contributers); | ||
| } | ||
| } | ||
|
|
||
| @Override | ||
| public void onFailure(Call<List<GithubUsersResponse>> call, Throwable t) { | ||
| Toast.makeText(getApplicationContext(), t.getMessage(), Toast.LENGTH_SHORT).show(); | ||
|
|
||
| } | ||
| }); | ||
|
|
||
| } | ||
|
|
||
| @Override | ||
| public void onClick(View view) { | ||
| if (view.getId() == R.id.privacyPolicyLabel) { | ||
| String url = "https://adeekshith.github.io/watomatic/#/privacy-policy.md"; | ||
| Intent i = new Intent(Intent.ACTION_VIEW); | ||
| i.setData(Uri.parse(url)); | ||
| startActivity(i); | ||
| } | ||
|
|
||
| if (view.getId() == R.id.developerLink) { | ||
| String url = "https://twitter.com/adeekshith"; | ||
| Intent i = new Intent(Intent.ACTION_VIEW); | ||
| i.setData(Uri.parse(url)); | ||
| startActivity(i); | ||
| } | ||
| } | ||
| } | ||
36 changes: 0 additions & 36 deletions
36
app/src/main/java/com/parishod/watomatic/activity/about/AboutActivity.kt
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @aniket691,
I have never used this library, but without using this also we can get the required response.
Is it really needed? What are the advantages of this can you please explain.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can remove it.
It just helps give different names in model class. And we annotate and map
variable names with json object variable names.
#####################
But it helps to create response class fast.
https://www.jsonschema2pojo.org/
This tool requires this library.
And it helps to create a pojo class directly with json response in very
fast.
Just with one click.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @aniket691 we are already using Gson library in this project for JSON parsing. Can the same be used here instead of Jackson? Nothing against Jackson but just want to limit external dependencies.
But this is a great contribution. Thanks for that. We may want to improve the UI a little bit but can do in further iterations 😊
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
I have removed the library jackson
we are now only using gson