kandi background
Explore Kits

SuperTextView | a super textview for android | Frontend Framework library

 by   lygttpod Java Version: 2.4.6 License: No License

 by   lygttpod Java Version: 2.4.6 License: No License

Download this library from

kandi X-RAY | SuperTextView Summary

SuperTextView is a Java library typically used in User Interface, Frontend Framework applications. SuperTextView has no vulnerabilities, it has build file available and it has medium support. However SuperTextView has 1 bugs. You can download it from GitHub.
a super textview for android
Support
Support
Quality
Quality
Security
Security
License
License
Reuse
Reuse

kandi-support Support

  • SuperTextView has a medium active ecosystem.
  • It has 3464 star(s) with 570 fork(s). There are 67 watchers for this library.
  • It had no major release in the last 12 months.
  • There are 18 open issues and 169 have been closed. On average issues are closed in 91 days. There are no pull requests.
  • It has a neutral sentiment in the developer community.
  • The latest version of SuperTextView is 2.4.6
SuperTextView Support
Best in #Frontend Framework
Average in #Frontend Framework
SuperTextView Support
Best in #Frontend Framework
Average in #Frontend Framework

quality kandi Quality

  • SuperTextView has 1 bugs (0 blocker, 0 critical, 1 major, 0 minor) and 190 code smells.
SuperTextView Quality
Best in #Frontend Framework
Average in #Frontend Framework
SuperTextView Quality
Best in #Frontend Framework
Average in #Frontend Framework

securitySecurity

  • SuperTextView has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
  • SuperTextView code analysis shows 0 unresolved vulnerabilities.
  • There are 1 security hotspots that need review.
SuperTextView Security
Best in #Frontend Framework
Average in #Frontend Framework
SuperTextView Security
Best in #Frontend Framework
Average in #Frontend Framework

license License

  • SuperTextView does not have a standard license declared.
  • Check the repository for any license declaration and review the terms closely.
  • Without a license, all rights are reserved, and you cannot use the library in your applications.
SuperTextView License
Best in #Frontend Framework
Average in #Frontend Framework
SuperTextView License
Best in #Frontend Framework
Average in #Frontend Framework

buildReuse

  • SuperTextView releases are available to install and integrate.
  • Build file is available. You can build the component from source.
  • Installation instructions are not available. Examples and code snippets are available.
  • SuperTextView saves you 3526 person hours of effort in developing the same functionality from scratch.
  • It has 7546 lines of code, 436 functions and 76 files.
  • It has high code complexity. Code complexity directly impacts maintainability of the code.
SuperTextView Reuse
Best in #Frontend Framework
Average in #Frontend Framework
SuperTextView Reuse
Best in #Frontend Framework
Average in #Frontend Framework
Top functions reviewed by kandi - BETA

kandi has reviewed SuperTextView and discovered the below as its top functions. This is intended to give you an instant insight into SuperTextView implemented functionality, and help decide if they suit your requirements.

  • Get the attribute values
  • Initializes the text of the right edit text .
  • Callback method .
  • Initializes the view .
  • Setup the bitmap
  • Set gravity .
  • Sets the maxEms .
  • On refresh .
  • Get screen width
  • Initializes the view .

SuperTextView Key Features

a super textview for android

3.1、Android Studio导入方法,添加Gradle依赖

copy iconCopydownload iconDownload
     allprojects {
         repositories {
            ...
            maven { url "https://jitpack.io" }
        }
    }

3.2、项目中如何使用

copy iconCopydownload iconDownload
            <com.allen.library.SuperTextView
                android:layout_width="match_parent"
                android:layout_height="80dp"
                stv:sCenterBottomTextColor="@color/colorAccent"
                stv:sCenterBottomTextString="限额说明>>"
                stv:sCenterTopTextString=" "
                stv:sCenterViewGravity="left_center"
                stv:sLeftBottomTextString="招商银行(8888)"
                stv:sLeftIconRes="@drawable/bank_zhao_shang"
                stv:sLeftTopTextString="银行卡支付"
                stv:sLeftViewGravity="left_center"
                stv:sRightCheckBoxRes="@drawable/circular_check_bg"
                stv:sRightViewType="checkbox" />
        注意:
                1、上下的线可以通过   sDividerLineType 设置  有四种显示方式 none,top,bottom,both
                2、通过设置 sUseRipple=true 开启水波效果

License

copy iconCopydownload iconDownload
         Copyright 2016 Allen

        Licensed under the Apache License, Version 2.0 (the "License");
        you may not use this file except in compliance with the License.
        You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

        Unless required by applicable law or agreed to in writing, software
        distributed under the License is distributed on an "AS IS" BASIS,
        WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
        See the License for the specific language governing permissions and
        limitations under the License.

Community Discussions

Trending Discussions on SuperTextView
  • RecyclerView overdraws items
Trending Discussions on SuperTextView

QUESTION

RecyclerView overdraws items

Asked 2017-Nov-01 at 11:36

I'm facing a pretty odd issue with all the RecyclerView in my application. It's not the first time that I use RecyclerView but that's the first time it happens. I think the best way to explain this is with a photo:

The list is constantly updated so the notify methods are called often. The code is a bit too complicated to be posted but I'm sure that everything is called from the UI thread.

As requested here are the code and the layout.

Code:

public class PlayersAdapter extends RecyclerView.Adapter<PlayersAdapter.ViewHolder> {
    private final List<GameInfo.Player> players;
    private final LayoutInflater inflater;

    public PlayersAdapter(Context context, List<GameInfo.Player> players) {
        this.inflater = LayoutInflater.from(context);
        this.players = players;
        setHasStableIds(true);
    }

    @Override
    public long getItemId(int position) {
        return players.get(position).name.hashCode();
    }

    @Override
    public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        return new ViewHolder(parent);
    }

    @Override
    public void onBindViewHolder(ViewHolder holder, int position) {
        GameInfo.Player player = players.get(position);
        holder.name.setText(player.name);
        holder.update(player);
    }

    @Override
    public void onBindViewHolder(ViewHolder holder, int position, List<Object> payloads) {
        if (payloads.isEmpty()) {
            onBindViewHolder(holder, position);
        } else {
            holder.update((GameInfo.Player) payloads.get(0));
        }
    }

    @Override
    public int getItemCount() {
        return players.size();
    }

    public void notifyItemChanged(GameInfo.Player player) {
        int pos = players.indexOf(player);
        if (pos != -1) {
            players.set(pos, player);
            notifyItemChanged(pos, player);
        }
    }

    public void notifyDataSetChanged(List<GameInfo.Player> players) {
        this.players.clear();
        this.players.addAll(players);
        notifyDataSetChanged();
    }

    public class ViewHolder extends RecyclerView.ViewHolder {
        final TextView name;
        final SuperTextView score;
        final ImageView status;

        ViewHolder(ViewGroup parent) {
            super(inflater.inflate(R.layout.player_item, parent, false));
            setIsRecyclable(false);

            name = itemView.findViewById(R.id.playerItem_name);
            score = itemView.findViewById(R.id.playerItem_score);
            status = itemView.findViewById(R.id.playerItem_status);
        }

        void update(GameInfo.Player player) {
            score.setHtml(R.string.score, player.score);

            switch (player.status) {
                case HOST:
                    status.setImageResource(R.drawable.ic_person_black_48dp);
                    break;
                case IDLE:
                    status.setImageResource(R.drawable.ic_access_time_black_48dp);
                    break;
                case JUDGING:
                case JUDGE:
                    status.setImageResource(R.drawable.ic_gavel_black_48dp);
                    break;
                case PLAYING:
                    status.setImageResource(R.drawable.ic_hourglass_empty_black_48dp);
                    break;
                case WINNER:
                    status.setImageResource(R.drawable.ic_star_black_48dp);
                    break;
                case SPECTATOR:
                    status.setImageResource(R.drawable.ic_remove_red_eye_black_48dp);
                    break;
            }
        }
    }
}

The GameInfo.Player class:

public static class Player {
        public final String name;
        public final int score;
        public final PlayerStatus status;

        public Player(JSONObject obj) throws JSONException {
            name = obj.getString("N");
            score = obj.getInt("sc");
            status = PlayerStatus.parse(obj.getString("st"));
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;
            Player player = (Player) o;
            return name.equals(player.name);
        }
    }

Custom item layout (R.layout.player_item):

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:gravity="center_vertical"
    android:orientation="horizontal"
    android:padding="4dp">

    <ImageView
        android:id="@+id/playerItem_status"
        android:layout_width="32dp"
        android:layout_height="32dp"
        android:alpha="0.54"
        android:padding="4dp"
        android:scaleType="fitCenter" />

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:paddingStart="8dp">

        <TextView
            android:id="@+id/playerItem_name"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:ellipsize="end"
            android:lines="1"
            android:textColor="@android:color/primary_text_light"
            android:textSize="14sp" />

        <com.gianlu.commonutils.SuperTextView
            android:id="@+id/playerItem_score"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />
    </LinearLayout>
</LinearLayout>

EDIT: Removing the onBindViewHolder(ViewHolder holder, int position, List<Object> payloads) method fixes the issue only if I use notifyItemChanged(pos, player), the issue remains with notifyItemChanged(pos). Would be nice to know why it happens.

ANSWER

Answered 2017-Nov-01 at 11:36

I've fixed the issue by removing the onBindViewHolder(ViewHolder holder, int position, List<Object> payloads) method, using notifyItemChanged(pos) instead of notifyItemChanged(pos, player) and setting the ViewHolder recyclable with setIsRecyclable(true). Thanks to @RahulKumar for the suggestion.

Source https://stackoverflow.com/questions/47053131

Community Discussions, Code Snippets contain sources that include Stack Exchange Network

Vulnerabilities

No vulnerabilities reported

Install SuperTextView

You can download it from GitHub.
You can use SuperTextView like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the SuperTextView component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .

Support

For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .

DOWNLOAD this Library from

Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases

Save this library and start creating your kit

Explore Related Topics

Share this Page

share link
Consider Popular Frontend Framework Libraries
Compare Frontend Framework Libraries with Highest Support
Compare Frontend Framework Libraries with Highest Security
Compare Frontend Framework Libraries with Permissive License
Compare Frontend Framework Libraries with Highest Reuse
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases

Save this library and start creating your kit

  • © 2022 Open Weaver Inc.