-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fb74d5f
commit 78bf28e
Showing
9 changed files
with
213 additions
and
64 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 |
---|---|---|
|
@@ -12,13 +12,21 @@ | |
import androidx.recyclerview.widget.RecyclerView; | ||
|
||
import com.arjun.weather.Model.FiveDaysWeather; | ||
import com.arjun.weather.Model.ItemHourly; | ||
import com.arjun.weather.R; | ||
import com.bumptech.glide.Glide; | ||
|
||
import java.security.Permission; | ||
|
||
public class MainAdapter extends RecyclerView.Adapter<MainAdapter.ViewHolder> { | ||
|
||
FiveDaysWeather fiveDaysWeather; | ||
public static final String data ="Data"; | ||
Context context; | ||
interface setDataActivity{ | ||
void setPosition(int position); | ||
|
||
} | ||
|
||
public MainAdapter(FiveDaysWeather itemHourlyList, Context context){ | ||
this.fiveDaysWeather = itemHourlyList; | ||
|
@@ -34,13 +42,17 @@ public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { | |
return new ViewHolder(view); | ||
} | ||
|
||
|
||
@Override | ||
public void onBindViewHolder(@NonNull ViewHolder holder, int position) { | ||
Glide.with(context) | ||
.load("https://openweathermap.org/img/wn/[email protected]") | ||
.into(holder.icon1); | ||
holder.tempmin.setText("22"); | ||
holder.tempmax.setText("23"); | ||
|
||
Log.e(data, "onBindViewHolder: "+fiveDaysWeather.getCity().getName().toString() ); | ||
//If position only 8,16,24,32,40 | ||
holder.tempmin.setText(String.valueOf(fiveDaysWeather.getList().get(position).getMain().getTempMin())); | ||
holder.tempmax.setText(String.valueOf(fiveDaysWeather.getList().get(position).getMain().getTempMax())); | ||
} | ||
|
||
@Override | ||
|
This file contains 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
Oops, something went wrong.