Giter VIP home page Giter VIP logo

Comments (5)

BraisGabin avatar BraisGabin commented on July 20, 2024

No, I would not. TableFixHeaders is only a view container just like ListView. It can only have images, for instance.

KISS solution: notifyDataSetCahnged();.

And remember:

Premature optimization is the root of all evil.

from tablefixheaders.

MariuszGSL avatar MariuszGSL commented on July 20, 2024

Thank you for replying.
I do not understand what you have said in your last two comments. Could you please elaborate in more details.
Also, please comment on my key question:
What would be the best, most efficient, recommended method to apply the font size setting globally to all table cells in your library ?

from tablefixheaders.

BraisGabin avatar BraisGabin commented on July 20, 2024

Kiss: http://en.wikipedia.org/wiki/KISS_principle

How many times your users change the font size? It's critical the performance?

Is premature optimization really the root of all evil?

The most efficient way? Extend TextView, listen the SharePreferences changes in all of them and force a redraw. You can use Otto too.

If you need more help, please use StackOverflow. This is not realted with TableFixHeader, is related with any type of view.

from tablefixheaders.

MariuszGSL avatar MariuszGSL commented on July 20, 2024

Here is a simple solution:
In the TableAdpater > setText method, replace this line of code:

((TextView) view.findViewById(android.R.id.text1)).setText(text);

with:
TextView cell_text = (TextView) view.findViewById(android.R.id.text1);
cell_text.setText(text);
if CellTextSize > 14){ // assuming Android Normal text size is 14 sp
cell_text.setTextSize(CellTextSize);
}
if (CellBold){
cell_text.setTypeface(null, Typeface.BOLD); // default is Typeface.NORMAL
}

CellTextSize and CellBold are user-defined preferences values.
The above is combined with the automatic scaling of column widths (by %), depending on the CellTextSize selection.
I also allow users to change the column height (globally in all tables).

Can you see any issues with this approach ?

from tablefixheaders.

BraisGabin avatar BraisGabin commented on July 20, 2024

No, I don't. Your approach is fine.

from tablefixheaders.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.